Merge branch 'dev-fix-issues2065' into 'dev'

fix: 修复猜你喜欢-发现页骨架屏显示异常

See merge request halo/android/assistant-android!402
This commit is contained in:
张玉久
2022-11-01 11:53:25 +08:00
4 changed files with 18 additions and 2 deletions

View File

@ -166,6 +166,7 @@ class DiscoveryAdapter(
is RecommendInterestViewHolder -> {
holder.binding.root.setBackgroundColor(R.color.background_white.toColor(mContext))
holder.binding.backgroundView.background = R.drawable.bg_shape_space_radius_8.toDrawable(mContext)
holder.binding.interestTv.setTextColor(R.color.text_title.toColor(mContext))
val labels = mEntityList[position].interestCardLabels ?: return
val labelTvList = arrayListOf(holder.binding.labelTv1, holder.binding.labelTv2, holder.binding.labelTv3)
labelTvList.forEachIndexed { index, labelTv ->

View File

@ -64,6 +64,10 @@ class DiscoveryFragment : LazyListFragment<DiscoveryItemData, DiscoveryViewModel
override fun initRealView() {
super.initRealView()
mListRv.setBackgroundColor(R.color.background_white.toColor(requireContext()))
}
override fun initSkeletonScreen() {
if (mSkeletonScreenView == null) return
mSkeletonScreen = Skeleton.bind(mSkeletonScreenView)
.shimmer(true)
.angle(Constants.SHIMMER_ANGLE)

View File

@ -149,7 +149,7 @@ public abstract class LazyListFragment<T, VM extends BaseListViewModel /* 该泛
mReuseNoData = mCachedView.findViewById(R.id.reuse_none_data);
mDataExceptionView = mCachedView.findViewById(R.id.reuse_data_exception);
mSkeletonScreenView = mCachedView.findViewById(R.id.skeleton);
initSkeletonScreen();
if (mListRefresh != null) {
mListRefresh.setColorSchemeResources(R.color.theme);
mListRefresh.setOnRefreshListener(this);
@ -302,6 +302,10 @@ public abstract class LazyListFragment<T, VM extends BaseListViewModel /* 该泛
}
}
protected void initSkeletonScreen() {
}
// 需要自动加载更多的页面重载这个方法 (默认空方法)
protected void autoLoadMore() {
@ -320,4 +324,10 @@ public abstract class LazyListFragment<T, VM extends BaseListViewModel /* 该泛
protected void hideRefreshingLayout() {
if (mListRefresh != null) mListRefresh.setRefreshing(false);
}
@Override
protected void onDarkModeChanged() {
super.onDarkModeChanged();
initSkeletonScreen();
}
}

View File

@ -17,7 +17,8 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_rv"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:visibility="gone" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<include