|
@@ -44,9 +44,6 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
//印尼,马来默认印尼;阿拉伯语默认阿拉伯语;其他语默认打开是展示全球
|
|
|
private var matchLanguageId = 0
|
|
|
|
|
|
- //点击position
|
|
|
- private var mCurrentPosition = 0
|
|
|
-
|
|
|
override val loadData: (page: Int) -> Unit = {
|
|
|
homeVm.getHotList(1, it + 1,labelValue)
|
|
|
}
|
|
@@ -64,7 +61,7 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
|
|
|
|
|
|
override fun initViewData() {
|
|
|
- SpUtil.putInt("hotCloseRoomed" , 0)
|
|
|
+ SpUtil.putString("hotCloseRoomed" , "0")
|
|
|
UrlConstant.getConfigModel()?.let {
|
|
|
if (!it.language_lables.isNullOrEmpty()){
|
|
|
matchLanguageId = when(SwagoInfo.languageId){
|
|
@@ -122,7 +119,6 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
|
|
|
smartRecyclerView.recyclerView?.addItemDecoration(HomeGridItemDecoration())
|
|
|
adapter.setOnItemClickListener { _, _, position ->
|
|
|
- mCurrentPosition = position
|
|
|
ARouter.getInstance()
|
|
|
.build(ARouteConstant.Room.user)
|
|
|
.withInt("position", position)
|
|
@@ -165,10 +161,11 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
- if (SpUtil.readInt("hotCloseRoomed") == 1 && adapter.data.size > mCurrentPosition){
|
|
|
- adapter.data.removeAt(mCurrentPosition)
|
|
|
+ val hotCloseRoomed = SpUtil.readString("hotCloseRoomed")
|
|
|
+ if (hotCloseRoomed != "0"){
|
|
|
+ adapter.data.removeAll { it.id == hotCloseRoomed }
|
|
|
adapter.notifyDataSetChanged()
|
|
|
- SpUtil.putInt("hotCloseRoomed" , 0)
|
|
|
+ SpUtil.putString("hotCloseRoomed" , "0")
|
|
|
}
|
|
|
isFirstLoadData = false
|
|
|
}
|