android - Translated view (AppBarLayout) is put back in its original position -


i'm on api 22. orange view appbarlayout inside coordinatorlayout. i'm trying make disappear translating top. want out of screen.

i'm getting translation height from:

appbarlayout bar; rect r = new rect(); bar.getlocalvisiblerect(r ); float h = r.height(); 
  • animated call bar.animate().translationy(-h) , on; (tried viewcompat.animate(bar), new translateanimation(), ...)
  • direct call direct call bar.settranslationy(-h).

enter image description here

problem gets instantly replaced @ previous place, , translation gets 0 (i.e., bar.gettranslationy() == 0, if have set -h). spent hours on this; might think

maybe it's not possible; coordinatorlayout not allowing such behavior

that's not true. exact same code works like charm on api17, , in last hours failed see why should not on api22. appreciate help, either in understanding why not possible, or what's difference between api17 & api22 causes this.

or, maybe, how around problem. sorry low framerate. (side question: should file bug report? believe it's bug?)


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -