Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
VIPyinzhiwei committed Sep 29, 2023
2 parents 1e7bfe1 + 9d7d1a2 commit bc2fecc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ dependencies {
implementation "androidx.fragment:fragment-ktx:1.5.1"

//特定功能依赖库
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
implementation 'com.scwang.smart:refresh-header-material:2.0.0'
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ import androidx.paging.PagingConfig
import androidx.paging.PagingData
import com.eyepetizer.android.Const
import com.eyepetizer.android.logic.dao.MainPageDao
import com.eyepetizer.android.logic.model.*
import com.eyepetizer.android.logic.model.CommunityRecommend
import com.eyepetizer.android.logic.model.Daily
import com.eyepetizer.android.logic.model.Discovery
import com.eyepetizer.android.logic.model.Follow
import com.eyepetizer.android.logic.model.HomePageRecommend
import com.eyepetizer.android.logic.model.PushMessage
import com.eyepetizer.android.logic.network.EyepetizerNetwork
import com.eyepetizer.android.ui.community.commend.CommendPagingSource
import com.eyepetizer.android.ui.community.follow.FollowPagingSource
Expand Down Expand Up @@ -95,8 +100,15 @@ class MainPageRepository private constructor(private val mainPageDao: MainPageDa
@Volatile
private var INSTANCE: MainPageRepository? = null

fun getInstance(dao: MainPageDao, network: EyepetizerNetwork): MainPageRepository = INSTANCE ?: synchronized(this) {
INSTANCE ?: MainPageRepository(dao, network)
fun getInstance(dao: MainPageDao, network: EyepetizerNetwork): MainPageRepository {
if (INSTANCE == null) {
synchronized(this) {
if (INSTANCE == null) {
INSTANCE = MainPageRepository(dao, network)
}
}
}
return INSTANCE!!
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,15 @@ class VideoRepository(private val dao: VideoDao, private val network: Eyepetizer
@Volatile
private var INSTANCE: VideoRepository? = null

fun getInstance(dao: VideoDao, network: EyepetizerNetwork): VideoRepository = INSTANCE ?: synchronized(this) {
INSTANCE ?: VideoRepository(dao, network)
fun getInstance(dao: VideoDao, network: EyepetizerNetwork): VideoRepository {
if (INSTANCE == null) {
synchronized(this) {
if (INSTANCE == null) {
INSTANCE = VideoRepository(dao, network)
}
}
}
return INSTANCE!!
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class TypefaceEditText : AppCompatEditText {

@SuppressLint("CustomViewStyleable")
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
if (isInEditMode) return
attrs?.let {
val typedArray = context.obtainStyledAttributes(it, R.styleable.TypefaceTextView, 0, 0)
val typefaceType = typedArray.getInt(R.styleable.TypefaceTextView_typeface, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.eyepetizer.android.ui.common.view
import android.content.Context
import android.graphics.Typeface
import android.util.AttributeSet
import android.view.View
import androidx.appcompat.widget.AppCompatTextView
import com.eyepetizer.android.R
import com.eyepetizer.android.util.TypeFaceUtil
Expand All @@ -36,6 +37,7 @@ class TypefaceTextView : AppCompatTextView {
constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)

constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
if (isInEditMode) return
attrs?.let {
val typedArray = context.obtainStyledAttributes(it, R.styleable.TypefaceTextView, 0, 0)
val typefaceType = typedArray.getInt(R.styleable.TypefaceTextView_typeface, 0)
Expand Down

0 comments on commit bc2fecc

Please sign in to comment.