Compare commits
16 Commits
v5.34.2-10
...
v5.34.5-10
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c23c4f0eb | |||
| 2c2031f623 | |||
| 41ddf53e23 | |||
| b911edb83c | |||
| 7524144c3d | |||
| aef5bb0021 | |||
| 1e45790280 | |||
| 907f840537 | |||
| 07dfd58538 | |||
| 4491865aef | |||
| 9dabe9fa03 | |||
| 79349d51ee | |||
| a3319b71d2 | |||
| b06341959d | |||
| 089e552e0f | |||
| 16e0da0c7c |
@ -8,7 +8,7 @@ import com.gh.gamecenter.core.provider.IFlavorProvider
|
||||
import com.gh.gamecenter.core.utils.SPUtils
|
||||
import com.gh.gamecenter.core.utils.TimeUtils
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.leon.channel.helper.ChannelReaderUtil
|
||||
import com.tencent.vasdolly.helper.ChannelReaderUtil
|
||||
|
||||
class FlavorProviderImp : IFlavorProvider {
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ import com.gh.gamecenter.core.utils.TimeUtils
|
||||
import com.gh.gamecenter.core.utils.ToastUtils
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.kwai.monitor.payload.TurboHelper
|
||||
import com.leon.channel.helper.ChannelReaderUtil
|
||||
import com.tencent.vasdolly.helper.ChannelReaderUtil
|
||||
|
||||
class FlavorProviderImp : IFlavorProvider {
|
||||
|
||||
|
||||
@ -29,7 +29,6 @@ import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMMON_CONTE
|
||||
|
||||
class CustomCommonCollectionDetailAdapter(
|
||||
context: Context,
|
||||
val layout: Int,
|
||||
var collectionStyle: String,
|
||||
val mViewModel: CustomCommonCollectionDetailViewModel,
|
||||
val mLocation: String,
|
||||
@ -51,8 +50,8 @@ class CustomCommonCollectionDetailAdapter(
|
||||
return if (viewType == ItemViewType.ITEM_BODY) {
|
||||
when (collectionStyle) {
|
||||
"1-1" -> CommonCollectionDetailOneItemViewHolder(parent.toBinding())
|
||||
"1-2" -> if (layout == COMMON_CONTENT_COLLECTION_LAYOUT_HORIZONTAL_SLIDE_BANNER ||
|
||||
layout == COMMON_CONTENT_COLLECTION_LAYOUT_DOUBLE_ROW_BANNER
|
||||
"1-2" -> if (mViewModel.getLayout() == COMMON_CONTENT_COLLECTION_LAYOUT_HORIZONTAL_SLIDE_BANNER
|
||||
|| mViewModel.getLayout() == COMMON_CONTENT_COLLECTION_LAYOUT_DOUBLE_ROW_BANNER
|
||||
) {
|
||||
CommonCollectionDetailTwoItemHorizontalViewHolder(parent.toBinding())
|
||||
} else {
|
||||
|
||||
@ -60,7 +60,6 @@ class CustomCommonCollectionDetailFragment : LazyListFragment<LinkEntity, Custom
|
||||
requireArguments().getParcelableArrayList<ExposureSource>(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST)
|
||||
mAdapter = CustomCommonCollectionDetailAdapter(
|
||||
requireContext(),
|
||||
mLayout,
|
||||
mCollectionStyle,
|
||||
mViewModel,
|
||||
mLocation,
|
||||
@ -74,7 +73,7 @@ class CustomCommonCollectionDetailFragment : LazyListFragment<LinkEntity, Custom
|
||||
|
||||
override fun provideListViewModel(): CustomCommonCollectionDetailViewModel {
|
||||
val collectionId = arguments?.getString(EntranceConsts.KEY_COLLECTION_ID) ?: ""
|
||||
mViewModel = viewModelProvider(CustomCommonCollectionDetailViewModel.Factory(collectionId))
|
||||
mViewModel = viewModelProvider(CustomCommonCollectionDetailViewModel.Factory(collectionId, mLayout))
|
||||
return mViewModel
|
||||
}
|
||||
|
||||
|
||||
@ -13,16 +13,25 @@ import io.reactivex.Observable
|
||||
|
||||
class CustomCommonCollectionDetailViewModel(
|
||||
application: Application,
|
||||
private val mCollectionId: String
|
||||
private val mCollectionId: String,
|
||||
cachedLayout: Int,
|
||||
) : ListViewModel<CommonCollectionContentEntity, CommonCollectionContentEntity>(application) {
|
||||
|
||||
var finalLayout = cachedLayout
|
||||
val commonCollectionLiveData = MutableLiveData<CommonCollectionEntity>()
|
||||
|
||||
fun getLayout() : Int {
|
||||
return finalLayout
|
||||
}
|
||||
|
||||
override fun provideDataObservable(page: Int): Observable<MutableList<CommonCollectionContentEntity>>? {
|
||||
return if (page == 1) {
|
||||
RetrofitManager.getInstance().api
|
||||
.getCommonCollectionDetail(mCollectionId)
|
||||
.map {
|
||||
if (it.layout != -1) {
|
||||
finalLayout = it.layout
|
||||
}
|
||||
commonCollectionLiveData.postValue(it)
|
||||
it.collectionList
|
||||
}
|
||||
@ -36,10 +45,10 @@ class CustomCommonCollectionDetailViewModel(
|
||||
mResultLiveData.addSource(mListLiveData) { mResultLiveData.postValue(it) }
|
||||
}
|
||||
|
||||
class Factory(private val collectionId: String) : ViewModelProvider.NewInstanceFactory() {
|
||||
class Factory(private val collectionId: String, private val layout: Int) : ViewModelProvider.NewInstanceFactory() {
|
||||
|
||||
override fun <T : ViewModel> create(modelClass: Class<T>): T {
|
||||
return CustomCommonCollectionDetailViewModel(HaloApp.getInstance().application, collectionId) as T
|
||||
return CustomCommonCollectionDetailViewModel(HaloApp.getInstance().application, collectionId, layout) as T
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -48,7 +48,10 @@ class CustomIconMatrixAdapter(
|
||||
CustomChildIconMatrixViewHolder(parent.toBinding())
|
||||
|
||||
override fun onBindViewHolder(holder: CustomChildIconMatrixViewHolder, position: Int, payloads: MutableList<Any>) {
|
||||
if (payloads.isNotEmpty()) {
|
||||
val isRefreshDownloadStatus = payloads.any {
|
||||
PAYLOAD_REFRESH_GAME_CHANGED == it
|
||||
}
|
||||
if (isRefreshDownloadStatus) {
|
||||
DownloadItemUtils.updateItem(
|
||||
context,
|
||||
getItem(position),
|
||||
|
||||
@ -4,6 +4,8 @@ import android.graphics.Rect
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.forEach
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
@ -88,6 +90,12 @@ class ScrollCalculatorHelper(val mListRv: RecyclerView, private val mPlayId: Int
|
||||
if (child is RecyclerView && child.layoutManager is LinearLayoutManager) {
|
||||
val hasChildVideoPlaying = playChildVideo(child)
|
||||
if (hasChildVideoPlaying) break
|
||||
} else if (child is ViewGroup) {
|
||||
val childList = findRecyclerView(child)
|
||||
if (childList != null) {
|
||||
val hasChildVideoPlaying = playChildVideo(childList)
|
||||
if (hasChildVideoPlaying) break
|
||||
}
|
||||
}
|
||||
|
||||
val player: View? = child?.findViewById(mPlayId)
|
||||
@ -163,6 +171,20 @@ class ScrollCalculatorHelper(val mListRv: RecyclerView, private val mPlayId: Int
|
||||
return false
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果布局层次结构复杂,这里递归可能过深,为避免此情况,这里暂时只考虑一层的情况
|
||||
*/
|
||||
private fun findRecyclerView(container: ViewGroup): RecyclerView? {
|
||||
val childCount = container.childCount
|
||||
for (index in 0 until childCount) {
|
||||
val child = container.getChildAt(index)
|
||||
if (child is RecyclerView && child.layoutManager is LinearLayoutManager) {
|
||||
return child
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
private inner class PlayRunnable(var videoView: AutomaticVideoView?) : Runnable {
|
||||
override fun run() {
|
||||
if (videoView != null && !videoView!!.isInPlayingState) {
|
||||
|
||||
@ -746,6 +746,8 @@ abstract class BaseCommentAdapter(
|
||||
val loginEntrance = if (isVoted) "帖子评论-取消点赞" else "帖子评论-点赞"
|
||||
binding.likeCountTv.context.ifLogin(loginEntrance) {
|
||||
if (isVoted) {
|
||||
viewModel.unLike(comment)
|
||||
} else {
|
||||
viewModel.like(comment)
|
||||
|
||||
if (viewModel is ArticleDetailViewModel) {
|
||||
@ -758,8 +760,6 @@ abstract class BaseCommentAdapter(
|
||||
comment.user.id ?: "", contentType, comment.id
|
||||
?: "", bbsId, bbsType
|
||||
)
|
||||
} else {
|
||||
viewModel.unLike(comment)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,7 +407,7 @@ class SearchGameIndexAdapter(
|
||||
(holder.getAdapterPosition() + 1).toString(),
|
||||
"])"
|
||||
),
|
||||
location = "搜索-列表:" + gameEntity.name!!,
|
||||
location = "搜索-列表:${gameEntity.name ?: ""}",
|
||||
traceEvent = exposureEvent,
|
||||
clickCallback = null,
|
||||
refreshCallback = null
|
||||
|
||||
@ -11,7 +11,7 @@ import com.gh.gamecenter.core.utils.SPUtils
|
||||
import com.gh.gamecenter.core.utils.TimeUtils
|
||||
import com.gh.gamecenter.core.utils.ToastUtils
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.leon.channel.helper.ChannelReaderUtil
|
||||
import com.tencent.vasdolly.helper.ChannelReaderUtil
|
||||
|
||||
class FlavorProviderImp : IFlavorProvider {
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ ext {
|
||||
targetSdkVersion = 28
|
||||
|
||||
// application info (每个大版本之间的 versionCode 增加 20)
|
||||
versionCode = 1032
|
||||
versionName = "5.34.2"
|
||||
versionCode = 1035
|
||||
versionName = "5.34.5"
|
||||
applicationId = "com.gh.gamecenter"
|
||||
applicationIdGat = "com.gh.gamecenter.intl"
|
||||
|
||||
@ -132,7 +132,7 @@ ext {
|
||||
composeCompilerVersion = "1.3.2"
|
||||
constraintlayoutCompose = "1.0.1"
|
||||
|
||||
sensorsDataVersion = "6.6.8"
|
||||
sensorsDataVersion = "6.7.10"
|
||||
|
||||
documentfile = "1.0.1"
|
||||
|
||||
|
||||
@ -5,10 +5,10 @@ import io.reactivex.SingleEmitter
|
||||
|
||||
class ACloudPushCommonCallback(private val emitter: SingleEmitter<String>) : CommonCallback {
|
||||
override fun onSuccess(response: String) {
|
||||
emitter.onSuccess(response)
|
||||
if (!emitter.isDisposed) emitter.onSuccess(response)
|
||||
}
|
||||
|
||||
override fun onFailed(errorCode: String, errorMessage: String) {
|
||||
emitter.onError(ACloudPushException(errorCode, errorMessage))
|
||||
if (!emitter.isDisposed) emitter.onError(ACloudPushException(errorCode, errorMessage))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user