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