Skip to content

Commit d80952c

Browse files
author
why
committed
[Fix]: 首页高度预估
1 parent 1c02c82 commit d80952c

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

app/src/main/java/com/xiaoyv/bangumi/ui/media/detail/overview/binder/OverviewEpBinder.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ class OverviewEpBinder(
4040
holder.binding.tvTitleEp.title = item.title
4141

4242
item.entity.forceCast<MediaDetailEntity>().apply {
43-
holder.binding.epGrid.isVisible = MediaType.canEditEpProgress(mediaType)
44-
holder.binding.vHolder.isVisible = MediaType.canEditEpProgress(mediaType) && isFirstBind
43+
val canEditEpProgress = MediaType.canEditEpProgress(mediaType)
44+
45+
holder.binding.epGrid.isVisible = canEditEpProgress
46+
holder.binding.vHolder.isVisible = canEditEpProgress && isFirstBind
4547

4648
holder.binding.pb1.bind(this, true, clickAddEpProgress)
4749
holder.binding.pb2.bind(this, false, clickAddEpProgress)
4850

49-
holder.binding.ivLocation.isVisible = EpGridView.isHorizontalGrid(epList.size)
51+
holder.binding.ivLocation.isVisible =
52+
canEditEpProgress && EpGridView.isHorizontalGrid(epList.size)
53+
5054
holder.binding.ivLocation.setOnFastLimitClickListener {
5155
holder.binding.epGrid.scrollToWatched()
5256
}

app/src/main/res/layout/fragment_home_banner.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<com.xiaoyv.common.widget.scroll.AnimeRecyclerView
1010
android:id="@+id/rv_banner"
1111
android:layout_width="match_parent"
12-
android:layout_height="wrap_content"
12+
android:layout_height="@dimen/ui_size_180"
1313
android:layout_marginTop="@dimen/ui_layout_margin"
1414
android:clipToPadding="false"
1515
android:nestedScrollingEnabled="false"
@@ -23,6 +23,7 @@
2323
android:layout_width="match_parent"
2424
android:layout_height="wrap_content"
2525
android:layout_marginTop="@dimen/ui_size_24"
26+
android:minHeight="@dimen/ui_size_200"
2627
android:nestedScrollingEnabled="false"
2728
android:orientation="vertical"
2829
android:paddingHorizontal="@dimen/ui_size_8"

app/src/main/res/layout/fragment_home_banner_image.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
6-
android:layout_height="@dimen/ui_size_180"
7-
android:layout_marginHorizontal="@dimen/ui_size_8">
6+
android:layout_height="match_parent"
7+
android:layout_marginHorizontal="@dimen/ui_size_8"
8+
tools:showIn="@layout/fragment_home_banner">
89

910
<com.xiaoyv.common.widget.image.AnimeImageView
1011
android:id="@+id/iv_cover"

0 commit comments

Comments
 (0)