android hide and show bottom navigation

Solutions on MaxInterview for android hide and show bottom navigation by the best coders in the world

showing results for - "android hide and show bottom navigation"
Jaqueline
09 Feb 2020
1public class BottomNavigationViewBehavior extends CoordinatorLayout.Behavior<BottomNavigationView> {
2
3private int height;
4
5@Override
6public boolean onLayoutChild(CoordinatorLayout parent, BottomNavigationView child, int layoutDirection) {
7    height = child.getHeight();
8    return super.onLayoutChild(parent, child, layoutDirection);
9}
10
11@Override
12public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
13                               BottomNavigationView child, @NonNull 
14                               View directTargetChild, @NonNull View target,
15                               int axes, int type)
16{
17    return axes == ViewCompat.SCROLL_AXIS_VERTICAL;
18}
19
20@Override
21public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull BottomNavigationView child,
22           @NonNull View target, int dxConsumed, int dyConsumed,
23           int dxUnconsumed, int dyUnconsumed, 
24            @ViewCompat.NestedScrollType int type)
25{
26   if (dyConsumed > 0) {
27       slideDown(child);
28   } else if (dyConsumed < 0) {
29       slideUp(child);
30   }
31}
32
33private void slideUp(BottomNavigationView child) {
34    child.clearAnimation();
35    child.animate().translationY(0).setDuration(200);
36}
37
38private void slideDown(BottomNavigationView child) {
39    child.clearAnimation();
40    child.animate().translationY(height).setDuration(200);
41}
queries leading to this page
bottomnavigationview hide on scrollhow to hide system bottom navigation bar in androidscrolling should hide bottom navigation bar androidhow to hide bottom navigation bar in a fragment androidhow to auto hide bottom navigation bar in androidhow to hide bottom bar in android showing and hidingandroid bottom navigation bar hidescrolling view inside bottom navigation fragmentsandroid phone how to hide bottom barbottomnavigationview hide on scroll android navigation componentandroid hide bottom nav on scrollandroid hide bottom navigation menu itemandroid meow navigation autohideandroid show and hide bottom navigation barscrolling activity in bottom navigationandroid show hide bottom navigationhide bottom navigation bar android while fragment transactionandroid hide bottom nav menu fragmentandroid bottom navigation bar should disappear when scrolledscroll hide navigation androidhow to hide item in bottom menu in androidandroid hide system bottom navigation barandroid hide bottom menu barhow to hide bottom navigation bar in android studiohide bottom navigation bar while scrolling kotlinhide bottom navigation bar android from fragmenthide bottom navigation bar android while scrollinghide bottom navigation bar androidhow to hide bottom navigation view on scrollhow to remove bounce animation on bottom navigation view in androidreact native combine drawer and tab bottom navigationhow to hide bottom navigation barhide bottom navigation title androidhow to hide bottom navigation mrenu in android stack overflowbottom navigation going down on scrollandroid hide bottom navigation bar settingsbottom navigation bar android hide fragment bottom contenthow to hide bottom navigation buttons in androidbottom navigation bar on hide androidandroid show bottom bar hiden by scrollhow to hide bottom navigation bar in androidandroid activity no bottom navigationbottomnavigationview hide on scroll androidhow to hide bar at bottom of screen android in android studioandroid hide bottom nav menu on navigationandroid 2b hide bottom navigation barhow to hide bottom navigation bar in android stack overflowandroid how to hide bottom barauto hide bar on scroll android signature change navigation layout behaviour androidhide bottom navigation bar android kotlinandroid hide bottom navigation bar programmaticallyandroid navigation bar hidehide bottom navigaton bar on scroll in androidauto hide bottom navigation bar androidhow to hide bottom navigation view in androidhide bottom navigation view androidhide bottom navigation bar android on scrollhide title from bottom navigation androidhide complete bottom navigation bar in fragment android javaandroid hide bottom navigation barhow to hide bottom navigation bar in android programmatically in fragmenthide top bar android activityhow to get navigation visible while scrollinghow to hide bottom navigation menu in android stack overflowhide bottom navigation bar in activity androidhide show bottom navigation bar android using codnator layoutandroid bottom navigation bar scrollandroid bottom navigation hidehide bottom navigation bar android manuallyhide bottom bar androidbottom navbar android hide texthide complete bottom navigation bar in fragment androidhow to hide bottom bar in androidandroid studio hide bottom barandroid bottom menu how to hide an elementhow to use hide in fragment android in bottom navigationmaterila design bottom nav hide on scroll androidandroid studio hide bottom navigation barhide show bottom navigation bar androidhow to hide android bottom barhow to hide bottom navigation bar in android programmaticallyandroid when nav upp with bottom hidden it keep hideandroid hide bottom nav menuhide the bottom navigation when the page is scrolled in android studioshow hide fragment on bottom navigationhide bottom nav using motion layout android studioandroid hide and show bottom navigationandroid hide and show bottom navigation