I am animating a view so that a bottom navigation bar is hidden when the keyboard appears.
My issue is that I can translate away the bottom navigation bar and the main 'message area' can follow it, but at the top of the 'message area' a gap forms. Is there a way to translate, but keep the top of the 'message area' aligned with the action bar?
Here is an example of the animation and the gap that is forming:
My animation code is as follows:
if (lowerNavigationBar.getVisibility() == View.VISIBLE) {
lowerNavigationBar.animate()
.translationY(lowerNavigationBar.getHeight()).setDuration(1000).start();
viewPager.animate()
.translationY(lowerNavigationBar.getHeight()).setDuration(1000).start();
lowerNavigationBar.setVisibility(View.INVISIBLE);
}
else{
lowerNavigationBar.setVisibility(View.VISIBLE);
lowerNavigationBar.animate()
.translationY(0).setDuration(1000).start();
viewPager.animate()
.translationY(0).setDuration(1000).start();
}