android hide and show bottom navigation
Java
public class BottomNavigationViewBehavior extends CoordinatorLayout.Behavior<BottomNavigationView> {
private int height;
@Override
public boolean onLayoutChild(CoordinatorLayout parent, BottomNavigationView child, int layoutDirection) {
height = child.getHeight();
return super.onLayoutChild(parent, child, layoutDirection);
}
@Override
public boolean onStartNestedScroll(@NonNull CoordinatorLayout coordinatorLayout,
BottomNavigationView child, @NonNull
View directTargetChild, @NonNull View target,
int axes, int type)
{
return axes == ViewCompat.SCROLL_AXIS_VERTICAL;
}
@Override
public void onNestedScroll(@NonNull CoordinatorLayout coordinatorLayout, @NonNull BottomNavigationView child,
@NonNull View target, int dxConsumed, int dyConsumed,
int dxUnconsumed, int dyUnconsumed,
@ViewCompat.NestedScrollType int type)
{
if (dyConsumed > 0) {
slideDown(child);
} else if (dyConsumed < 0) {
slideUp(child);
}
}
private void slideUp(BottomNavigationView child) {
child.clearAnimation();
child.animate().translationY(0).setDuration(200);
}
private void slideDown(BottomNavigationView child) {
child.clearAnimation();
child.animate().translationY(height).setDuration(200);
}
Also in Java:
- Title
- how to crate a list in java script
- Category
- Java
- Title
- how to check if an arraylist contains a value in java recursion
- Category
- Java
- Title
- java stack methods
- Category
- Java
- Title
- phoneword converter
- Category
- Java
- Title
- java shortest if else statement
- Category
- Java
- Title
- spigot title
- Category
- Java
- Title
- Unrecognized option: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
- Category
- Java
- Title
- int4 spring jpa failling create command
- Category
- Java
- Title
- java program to find prime number between 1 and 100
- Category
- Java
- Title
- java get environment variables
- Category
- Java
- Title
- place.getlatlng() returning null
- Category
- Java
- Title
- Write a method that raises a number to a power without using Math.pow() method
- Category
- Java
- Title
- stack overflow recyclerview
- Category
- Java
- Title
- array in java
- Category
- Java
- Title
- if statement java
- Category
- Java
- Title
- random processing
- Category
- Java
- Title
- annotation spring notnull
- Category
- Java
- Title
- java long to int
- Category
- Java
- Title
- kotlin vs java
- Category
- Java
- Title
- java flood fill
- Category
- Java
- Title
- java square a number
- Category
- Java
- Title
- eclipse does not support logback with spring boot
- Category
- Java
- Title
- java max
- Category
- Java
- Title
- convert hashset to array
- Category
- Java
- Title
- java length of matrix
- Category
- Java
- Title
- queue implementation in java using arraylist
- Category
- Java
- Title
- java read public key from keystore
- Category
- Java
- Title
- separateur JMenu swing java
- Category
- Java
- Title
- java map string to list
- Category
- Java
- Title
- eliminar el primer caracter de un string java
- Category
- Java
- Title
- else statement java
- Category
- Java
- Title
- get host from request object java
- Category
- Java
- Title
- convert date to calendar java
- Category
- Java
- Title
- java repository sql find not in list
- Category
- Java
- Title
- create jdbc connection in java
- Category
- Java
- Title
- java taking console input
- Category
- Java
- Title
- java uuid
- Category
- Java
- Title
- contains example in java
- Category
- Java
- Title
- java how to put a string sentence in a map
- Category
- Java
- Title
- simple javascript to detect browser using java utils
- Category
- Java
- Title
- java read from connection even if 404
- Category
- Java
- Title
- read int from keyboard java
- Category
- Java
- Title
- Java.awt graphics tutorial
- Category
- Java
- Title
- how to read file from assets folder in android
- Category
- Java
- Title
- rewrite file java
- Category
- Java
- Title
- java get folder content
- Category
- Java
- Title
- set password visible in android
- Category
- Java
- Title
- java method overriding
- Category
- Java
- Title
- find maven version
- Category
- Java
- Title
- how to loop through an array
- Category
- Java
- Title
- input java
- Category
- Java
- Title
- java call another constructor
- Category
- Java
- Title
- processing sound android
- Category
- Java
- Title
- print hashtable in java
- Category
- Java
- Title
- find the triplet sum in java linked list
- Category
- Java
- Title
- java file exists
- Category
- Java
- Title
- java animated gif example
- Category
- Java
- Title
- java regex replace all characters before
- Category
- Java
- Title
- print map java
- Category
- Java
- Title
- Java copy file
- Category
- Java
- Title
- enum java
- Category
- Java
- Title
- how to instanciate map.entry java
- Category
- Java
- Title
- find the day of the week Calendar class in java
- Category
- Java
- Title
- java hashmap example
- Category
- Java
- Title
- java last element in array
- Category
- Java
- Title
- array rotation program in java
- Category
- Java
- Title
- java check if int
- Category
- Java
- Title
- java for each
- Category
- Java
- Title
- how to substring in java
- Category
- Java
- Title
- how to find the divisors of a number in java
- Category
- Java
- Title
- java read from file
- Category
- Java
- Title
- java 8 map foreach
- Category
- Java
- Title
- how to add a keylistener to a jframe
- Category
- Java
- Title
- java
- Category
- Java
- Title
- java manacher's algorithm
- Category
- Java
- Title
- counting repeated characters in a string in java
- Category
- Java
- Title
- link to method javadoc
- Category
- Java
- Title
- how to send http post create request using curl command
- Category
- Java
- Title
- install java debian 8
- Category
- Java
- Title
- protect java
- Category
- Java
- Title
- java string to int
- Category
- Java
- Title
- java how to call getReader twice
- Category
- Java
- Title
- has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 55.0
- Category
- Java
- Title
- Java how to copy file
- Category
- Java
- Title
- spigot chat color with symbol
- Category
- Java
- Title
- java android edit text set value
- Category
- Java
- Title
- how to change all the text in a textArea java at once
- Category
- Java
- Title
- Java system load from resources
- Category
- Java
- Title
- non primitive data types in java
- Category
- Java
- Title
- java exponencial
- Category
- Java
- Title
- how to limit double decimal places java
- Category
- Java
- Title
- resurce leak java
- Category
- Java
- Title
- how to check type of primitive value in java
- Category
- Java
- Title
- java create arraly list
- Category
- Java
- Title
- set top corner of shape radius programmatically android
- Category
- Java
- Title
- how to check if the file has remaining without reading from it java
- Category
- Java
- Title
- jbutton remove selection border
- Category
- Java
- Title
- java make arraylist
- Category
- Java
- Title
- jenkins decrypt password script console
- Category
- Java
- Title
- android switch on change
- Category
- Java