Skip to content

Commit 6f6d192

Browse files
dhanuarfBnyro
authored andcommitted
feat: show toolbar when scrolling up in subscriptions feed
1 parent 22c3422 commit 6f6d192

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class SubscriptionsFragment : DynamicLayoutManagerFragment(R.layout.fragment_sub
9191

9292
// Determine if the child can scroll up
9393
binding.subRefresh.setOnChildScrollUpCallback { _, _ ->
94-
!isAppBarFullyExpanded
94+
!isAppBarFullyExpanded || binding.subFeed.canScrollVertically(-1)
9595
}
9696

9797
binding.subRefresh.isEnabled = true
@@ -328,7 +328,6 @@ class SubscriptionsFragment : DynamicLayoutManagerFragment(R.layout.fragment_sub
328328
if (restoreScrollState) {
329329
// manually restore the previous feed state
330330
binding.subFeed.layoutManager?.onRestoreInstanceState(viewModel.subFeedRecyclerViewState)
331-
binding.subscriptionsAppBar.setExpanded(viewModel.subFeedRecyclerViewState == null)
332331
} else {
333332
binding.subFeed.scrollToPosition(0)
334333
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,14 @@
5353
<com.google.android.material.appbar.AppBarLayout
5454
android:id="@+id/subscriptions_app_bar"
5555
android:layout_width="match_parent"
56-
android:layout_height="wrap_content">
56+
android:layout_height="wrap_content"
57+
app:liftOnScroll="false">
5758

5859
<com.google.android.material.appbar.CollapsingToolbarLayout
5960
android:id="@+id/subscriptions_collapsing_tb"
6061
android:layout_width="match_parent"
6162
android:layout_height="wrap_content"
62-
app:layout_scrollFlags="scroll"
63+
app:layout_scrollFlags="scroll|enterAlways"
6364
app:titleCollapseMode="scale">
6465

6566
<LinearLayout

0 commit comments

Comments
 (0)