feat:调整首页-排行榜-UI
fix:修复首页-我的列表不能主动刷新问题
This commit is contained in:
@@ -3,6 +3,7 @@ package com.chwl.app.home.fragment
|
||||
import android.view.View
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseViewBindingFragment
|
||||
@@ -18,7 +19,8 @@ import com.chwl.app.support.FragmentVisibleStateHelper
|
||||
/**
|
||||
* 收藏
|
||||
*/
|
||||
class HomeRoomCollectListFragment : BaseViewBindingFragment<HomeTabRoomFragmentBinding>() {
|
||||
class HomeRoomCollectListFragment : BaseViewBindingFragment<HomeTabRoomFragmentBinding>(),
|
||||
SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
private lateinit var adapter: HomeRoomAdapter
|
||||
|
||||
@@ -90,4 +92,10 @@ class HomeRoomCollectListFragment : BaseViewBindingFragment<HomeTabRoomFragmentB
|
||||
}
|
||||
viewModel.getHomeCollectList(pageNum)
|
||||
}
|
||||
|
||||
override fun onRefresh() {
|
||||
if (isResumed) {
|
||||
loadData(true)
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,6 +3,7 @@ package com.chwl.app.home.fragment
|
||||
import android.view.View
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chwl.app.R
|
||||
import com.chwl.app.base.BaseViewBindingFragment
|
||||
@@ -18,7 +19,8 @@ import com.chwl.app.support.FragmentVisibleStateHelper
|
||||
/**
|
||||
* 最近访问记录
|
||||
*/
|
||||
class HomeRoomHistoryListFragment : BaseViewBindingFragment<HomeTabRoomFragmentBinding>() {
|
||||
class HomeRoomHistoryListFragment : BaseViewBindingFragment<HomeTabRoomFragmentBinding>(),
|
||||
SwipeRefreshLayout.OnRefreshListener {
|
||||
|
||||
private lateinit var adapter: HomeRoomAdapter
|
||||
|
||||
@@ -90,4 +92,10 @@ class HomeRoomHistoryListFragment : BaseViewBindingFragment<HomeTabRoomFragmentB
|
||||
}
|
||||
viewModel.getHomeHistoryList(pageNum)
|
||||
}
|
||||
|
||||
override fun onRefresh() {
|
||||
if (isResumed) {
|
||||
loadData(true)
|
||||
}
|
||||
}
|
||||
}
|
@@ -71,10 +71,10 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="42.5:33"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.164"
|
||||
app:layout_constraintHorizontal_bias="0.172"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.683"
|
||||
app:layout_constraintVertical_bias="0.642"
|
||||
app:layout_constraintWidth_percent="0.25" />
|
||||
|
||||
<ImageView
|
||||
@@ -82,12 +82,13 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/home_rank_3"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_rank_border_2"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintDimensionRatio="42.5:33"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.835"
|
||||
app:layout_constraintHorizontal_bias="0.827"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_rank_border_2"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.683"
|
||||
app:layout_constraintWidth_percent="0.25" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Reference in New Issue
Block a user