fix: hide recent if its empty
This commit is contained in:
parent
76e11e5a3e
commit
95b2939532
2 changed files with 46 additions and 35 deletions
|
@ -203,8 +203,12 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
|
||||||
animeRecently
|
animeRecently
|
||||||
)
|
)
|
||||||
animePopular.visibility = View.VISIBLE
|
animePopular.visibility = View.VISIBLE
|
||||||
binding.animePopular.startAnimation(setSlideUp())
|
animePopular.startAnimation(setSlideUp())
|
||||||
|
if (adaptor.itemCount == 0) {
|
||||||
|
animeRecentlyContainer.visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
fun updateMovies(adaptor: MediaAdaptor) {
|
fun updateMovies(adaptor: MediaAdaptor) {
|
||||||
binding.apply{
|
binding.apply{
|
||||||
|
|
|
@ -178,45 +178,52 @@
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/animeRecently"
|
android:id="@+id/animeRecentlyContainer"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="24dp"
|
android:orientation="horizontal">
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:text="@string/updated"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:visibility="invisible"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<FrameLayout
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/animeRecently"
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:minHeight="250dp">
|
|
||||||
|
|
||||||
<ProgressBar
|
|
||||||
android:id="@+id/animeUpdatedProgressBar"
|
|
||||||
style="?android:attr/progressBarStyle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="48dp"
|
|
||||||
android:layout_gravity="center" />
|
|
||||||
|
|
||||||
<ani.dantotsu.FadingEdgeRecyclerView
|
|
||||||
android:id="@+id/animeUpdatedRecyclerView"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="250dp"
|
android:layout_height="wrap_content"
|
||||||
android:clipToPadding="false"
|
android:layout_marginStart="24dp"
|
||||||
android:nestedScrollingEnabled="true"
|
android:fontFamily="@font/poppins_bold"
|
||||||
android:paddingStart="20dp"
|
android:padding="8dp"
|
||||||
android:paddingEnd="20dp"
|
android:text="@string/updated"
|
||||||
android:requiresFadingEdge="horizontal"
|
android:textSize="16sp"
|
||||||
tools:itemCount="4"
|
android:visibility="invisible"
|
||||||
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
tools:visibility="visible" />
|
||||||
tools:listitem="@layout/item_media_compact"
|
|
||||||
tools:orientation="horizontal" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="250dp">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/animeUpdatedProgressBar"
|
||||||
|
style="?android:attr/progressBarStyle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_gravity="center" />
|
||||||
|
|
||||||
|
<ani.dantotsu.FadingEdgeRecyclerView
|
||||||
|
android:id="@+id/animeUpdatedRecyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="250dp"
|
||||||
|
android:clipToPadding="false"
|
||||||
|
android:nestedScrollingEnabled="true"
|
||||||
|
android:paddingStart="20dp"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
|
android:requiresFadingEdge="horizontal"
|
||||||
|
tools:itemCount="4"
|
||||||
|
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
tools:listitem="@layout/item_media_compact"
|
||||||
|
tools:orientation="horizontal" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/animeMovies"
|
android:id="@+id/animeMovies"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue