android - Prevent CollapsingToolbar continuing under status bar in Lollipop -


i have developed custom behaviours textview changes position , size based on height of appbarlayout inside coordinatorlayout. title appears large , in centre of expanded toolbar when open, in normal title position when toolbar collapsed.

take @ videos see on lollipop device (not working correctly) , jellybean device (working fine).

the issue occurs (i believe, based on tests) on lollipop devices only, , seems linked fact status bar overlay on lollipop device, not on jellybean one. reflected in code well, calculate final y positions need following final position correct:

if (mfinalyposition == 0) {     mfinalyposition = (build.version.sdk_int >= build.version_codes.lollipop)         ? (((mcontext.getresources().getdimensionpixeloffset(r.dimen.abc_action_bar_default_height_material)/2)) + getstatusbarheight())         : ((mcontext.getresources().getdimensionpixeloffset(r.dimen.abc_action_bar_default_height_material)/2));     }  

the best solution me if have lollipop devices treat status bar in same earlier android versions, i.e. in locked position, , not overlay.

how go achieving this?

i able resolve issue removing android:fitssystemwindows elements layout xml file. in addition, may clear video posted views disappeared during animations on lollipop device reappeared later. able fix setting elevation on views ensure didn't vanish behind others during animation.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -