The answer from @Zeeshan is absolutely right.
as additional here is an example of code that works
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { StateListAnimator stateListAnimator = new StateListAnimator(); stateListAnimator.addState(new int[0], ObjectAnimator.ofFloat(appBarLayout, "elevation", 0.1f)); appBarLayout.setStateListAnimator(stateListAnimator); }
I needed to set the height to 0.1, because setting it to 0 did not work, the whole layout disappeared.
bisonfute Feb 16 '17 at 18:31 2017-02-16 18:31
source share