|
@@ -51,6 +51,8 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
|
|
|
private var labelValue = 0
|
|
|
private var selectedPosition = 0
|
|
|
+ //印尼,马来默认印尼;阿拉伯语默认阿拉伯语;其他语默认打开是展示全球
|
|
|
+ private var matchLanguageId = 0
|
|
|
|
|
|
override val loadData: (page: Int) -> Unit = {
|
|
|
homeVm.getHotList(1, it + 1,labelValue)
|
|
@@ -71,12 +73,24 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
override fun initViewData() {
|
|
|
UrlConstant.getConfigModel()?.let {
|
|
|
if (!it.language_lables.isNullOrEmpty()){
|
|
|
+ matchLanguageId = when(SwagoInfo.languageId){
|
|
|
+ 3,4 -> {
|
|
|
+ 3
|
|
|
+ }
|
|
|
+ 5 -> {
|
|
|
+ 5
|
|
|
+ }
|
|
|
+ else -> {
|
|
|
+ 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
context?.let { context ->
|
|
|
val labelAdapter = LabelAdapter()
|
|
|
binding.rvLabel.layoutManager = LinearLayoutManager(context,RecyclerView.HORIZONTAL,false)
|
|
|
binding.rvLabel.adapter = labelAdapter
|
|
|
it.language_lables?.forEachIndexed { index, label ->
|
|
|
- if (SwagoInfo.languageId==label.id){
|
|
|
+ if (matchLanguageId==label.id){
|
|
|
label.isSelected = true
|
|
|
labelValue = label.id
|
|
|
selectedPosition = index
|