fix: 【光环助手】排行榜详情页没有显示角标 https://jira.shanqu.cc/browse/GHZSCY-6680

This commit is contained in:
曾祥俊
2024-09-23 14:02:33 +08:00
parent 299eba4b60
commit 29729ec154
5 changed files with 41 additions and 26 deletions

View File

@ -72,6 +72,7 @@ android_build:
only:
- dev
- release
- feat/GHZSCY-6705
# 代码检查
sonarqube_analysis:
@ -157,3 +158,4 @@ oss-upload&send-email:
only:
- dev
- release
- feat/GHZSCY-6705

View File

@ -174,6 +174,7 @@ object ViewPagerFragmentHelper {
EntranceConsts.KEY_SUBJECT_DATA,
SubjectData(entity.link, entity.text, false, subjectType = subjectType)
)
bundle.putString(EntranceConsts.KEY_SUBJECT_TYPE, "detail")
bundle.putBoolean(EntranceConsts.KEY_SHOW_DOWNLOAD_MENU, !isTabWrapper)
}
// 专题合集详情页
@ -183,6 +184,7 @@ object ViewPagerFragmentHelper {
bundle.putInt(EntranceConsts.KEY_POSITION, 0)
bundle.putString(EntranceConsts.KEY_COLUMNNAME, entity.text)
bundle.putBoolean(EntranceConsts.KEY_IS_COLUMN_COLLECTION, true)
bundle.putString(EntranceConsts.KEY_SUBJECT_TYPE, "tab")
}
// 开服表
TYPE_SERVER -> {

View File

@ -4,10 +4,10 @@ import android.view.View
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.fragment.LazyFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.core.utils.PageSwitchDataHelper
import com.gh.gamecenter.R
import com.gh.gamecenter.databinding.FragmentSubjectBinding
import com.gh.gamecenter.entity.SubjectSettingEntity
import com.gh.gamecenter.subject.rows.SubjectRowsFragment
@ -28,7 +28,10 @@ open class SubjectFragment : LazyFragment() {
}
override fun onFragmentFirstVisible() {
initMenu(R.menu.menu_download)
// 是否为专题合集详情子页面
val isColumnCollection = arguments?.getBoolean(EntranceConsts.KEY_IS_COLUMN_COLLECTION) ?: false
// 专题合集详情子页面不需要显示菜单
if (!isColumnCollection) initMenu(R.menu.menu_download)
mViewModel = provideViewModel()
@ -49,11 +52,13 @@ open class SubjectFragment : LazyFragment() {
}
})
if (!isColumnCollection) {// 专题合集详情子页面不需要显示专题名称
// 获取专题名称
mViewModel?.subjectNameLD?.observe(this, Observer {
setNavigationTitle(it)
})
}
}
override fun initRealView() {
super.initRealView()
@ -75,11 +80,13 @@ open class SubjectFragment : LazyFragment() {
childFragmentManager.findFragmentByTag(tag)
?: SubjectTileFragment()
}
"rows" == entity.typeEntity.layout -> {
tag = SubjectRowsFragment::class.java.name
childFragmentManager.findFragmentByTag(tag)
?: SubjectRowsFragment()
}
else -> {
tag = SubjectTabFragment::class.java.name
childFragmentManager.findFragmentByTag(tag)

View File

@ -22,6 +22,7 @@ import com.gh.gamecenter.core.utils.UrlFilterUtils
import com.gh.gamecenter.databinding.FragmentSubjectTabBinding
import com.gh.gamecenter.entity.SubjectData
import com.gh.gamecenter.entity.SubjectSettingEntity
import com.gh.gamecenter.subject.SubjectFragment
import com.gh.gamecenter.subject.SubjectListFragment
import com.google.android.material.tabs.TabLayout
import org.json.JSONException
@ -62,7 +63,6 @@ class SubjectTabFragment : BaseFragment<Any>() {
UrlFilterUtils.getFilterQuery("tags", tag)
}
bundle?.putParcelable(EntranceConsts.KEY_SUBJECT_DATA, copyData)
bundle?.putString(EntranceConsts.KEY_SUBJECT_TYPE, "detail")
element.arguments = bundle
fragments.add(element)
}
@ -72,10 +72,10 @@ class SubjectTabFragment : BaseFragment<Any>() {
subjectList.filterIndexed { index, subject ->
val element = childFragmentManager.findFragmentByTag("${fragmentTag}$index")
?: SubjectListFragment()
?: SubjectFragment()
val bundle = arguments?.clone() as Bundle?
bundle?.putParcelable(EntranceConsts.KEY_SUBJECT_DATA, subject)
bundle?.putString(EntranceConsts.KEY_SUBJECT_TYPE, "tab")
bundle?.putParcelableArrayList(EntranceConsts.KEY_DATA, null)
element.arguments = bundle
fragments.add(element)

View File

@ -74,6 +74,9 @@ class SubjectTileFragment : BaseFragment<Any>() {
mBinding.subjectTypeList.adapter = adapter
}
// 是否为专题合集详情子页面
val isColumnCollection = arguments?.getBoolean(EntranceConsts.KEY_IS_COLUMN_COLLECTION) ?: false
if (!isColumnCollection) {
// Appbar 交互
mBinding.subjectAppbar.addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset ->
if (!TextUtils.isEmpty(mSubjectData.subjectName) && activity is ToolbarController) {
@ -92,6 +95,7 @@ class SubjectTileFragment : BaseFragment<Any>() {
}
}
})
}
loadData()
}