|
@@ -13,6 +13,7 @@ import com.swago.baseswago.cusview.SwagoRecyclerView
|
|
|
import com.swago.baseswago.fragment.BaseListFragment
|
|
|
import com.swago.baseswago.model.MomentModel
|
|
|
import com.swago.baseswago.model.home.BannerModel
|
|
|
+import com.swago.baseswago.util.SpUtil
|
|
|
import com.swago.baseswago.util.SwagoInfo
|
|
|
import com.swago.home.databinding.FragmentHotBinding
|
|
|
import com.swago.home.databinding.LayoutViewHeaderBinding
|
|
@@ -43,6 +44,9 @@ 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)
|
|
|
}
|
|
@@ -60,6 +64,7 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
|
|
|
|
|
|
override fun initViewData() {
|
|
|
+ SpUtil.putInt("hotCloseRoomed" , 0)
|
|
|
UrlConstant.getConfigModel()?.let {
|
|
|
if (!it.language_lables.isNullOrEmpty()){
|
|
|
matchLanguageId = when(SwagoInfo.languageId){
|
|
@@ -117,6 +122,7 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
|
|
|
smartRecyclerView.recyclerView?.addItemDecoration(HomeGridItemDecoration())
|
|
|
adapter.setOnItemClickListener { _, _, position ->
|
|
|
+ mCurrentPosition = position
|
|
|
ARouter.getInstance()
|
|
|
.build(ARouteConstant.Room.user)
|
|
|
.withInt("position", position)
|
|
@@ -159,8 +165,10 @@ class HotFragment : BaseListFragment<FragmentHotBinding, MomentModel>() {
|
|
|
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
- if (!isFirstLoadData){
|
|
|
- smartRecyclerView.startRefresh()
|
|
|
+ if (SpUtil.readInt("hotCloseRoomed") == 1 && adapter.data.size > mCurrentPosition){
|
|
|
+ adapter.data.removeAt(mCurrentPosition)
|
|
|
+ adapter.notifyDataSetChanged()
|
|
|
+ SpUtil.putInt("hotCloseRoomed" , 0)
|
|
|
}
|
|
|
isFirstLoadData = false
|
|
|
}
|