android - trasparent statusbar navigationdrawer after setstatusbarcolor -
i'm try developing app navigation drawer template found on github.
in style.xml have:
<style name="apptheme" parent="theme.appcompat.noactionbar"> <!-- customize theme here. --> <item name="colorprimary">#ff0000</item> <item name="colorprimarydark">#0000ff</item> 
and status bar in navigation drawer ok. 
when click button runs command: getwindow().setstatusbarcolor(color.green); 
now status bar color in navigation drawer no more translucent 
how restore status bar color translucent?
the difference xml defined colors colorprimary , colorprimarydark not used directly set status bar color.
actually statusbar transparent time , underlaying view colored. thats why can have color on left on right side (have @ second screenshot). if call getwindow().setstatusbarcolor(..) indeed color statusbar directly , over-draw color of both views. needs stay transparent!
what want do, changing color of view underlaying status bar, done scriminsetsframelayout class.
have @ this question , this class library provided
there should find necessary information change color of area want to.
in case want reset color:
getwindow().setstatusbarcolor(color.transparent);
Comments
Post a Comment