question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Collapsible NavigationBar on scrolling inside a TabBar

See original GitHub issue

Continuing from https://github.com/grahammendick/navigation/issues/339#issuecomment-570185443.

Relevant questions:

For a bare-basic support, from what i understood, two new container views will need to be introduced. The overall CoordinatorLayout view that wraps everything and the new CollapsingToolbarLayout view that will have the existing Toolbar as a direct last-child descendent.

So will that mean that the NavigationBar class will now have to extend CoordinatorLayout and not AppBarLayout? And then use the addView method to add the required hierarchy?

public class NavigationBarView extends CoordinatorLayout {
    private IconResolver iconResolver;
    Toolbar toolbar;
    AppBarLayout appBarLayout;
    CollapsingToolbarLayout collapsingToolbarLayout;

.....

public NavigationBarView(Context context) {
        super(context);

        toolbar = new Toolbar(context);
        appBarLayout = new AppBarLayout(context);
        collapsingToolbarLayout = new CollapsingToolbarLayout(context);
        addView(appBarLayout, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
        addView(collapsingToolbarLayout, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
        addView(toolbar, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
 ......

Please let me know if my thinking is correct

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:44 (44 by maintainers)

github_iconTop GitHub Comments

1reaction
grahammendickcommented, Jan 6, 2020

I hope you don’t give up on this because it would be a great addition to the Navigation router. But it does need a lot more research so I’m happy to close this while you concentrate your efforts elsewhere. Thanks again for all your hard work

1reaction
grahammendickcommented, Jan 4, 2020

Ok, you do some more research and I’ll give it a go too. Don’t worry, we’ll get there!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Collapsing navigation bar with pag… | Apple Developer Forums
When a navigation view is scrolled, common behaviour in iOS is for the large navigation title to collapse into the navigation bar.
Read more >
Flutter TabBar and SliverAppBar that hides when you scroll ...
When you scroll down, the bar should hide by moving off the screen (but tabs should stay), and when you scroll back up,...
Read more >
Flutter : Collapsing Toolbar — Sliver App Bar - Medium
The Collapsing Toolbar is UI component widely used in our applications today. ... by scrolling upwards, the content changes and becomes a navigation...
Read more >
Flutter Tutorial - How To Show/Hide AppBar On Scroll [2021 ...
To Show/Hide AppBar on scroll in Flutter use a SliverAppBar to create a Flutter collapsing toolbar animation.Click here to Subscribe to ...
Read more >
Starbucks in Swift: Collapsible Header (Ep.2) - YouTube
Starbucks in Swift: Scroll Views, Stack Views, and Tiles (Ep. · SwiftUI Animated Sticky Header - Xcode 13 - SwiftUI Tutorial · SwiftUI...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found