Overlay over navigation bar in Android 4 -
i struggling despite going through samples...
i want overlay on android navigation bar - have tried following code...
s_translucentparams = new windowmanager.layoutparams( windowmanager.layoutparams.match_parent, windowmanager.layoutparams.match_parent, windowmanager.layoutparams.type_system_error, windowmanager.layoutparams.flag_layout_in_screen | windowmanager.layoutparams.flag_not_touchable | windowmanager.layoutparams.flag_not_focusable | windowmanager.layoutparams.flag_fullscreen , pixelformat.translucent);
but of course, fills window not cover navigation bar... after doing reading, tried following (from draw bitmaps on top of navigation bar in android) ...
w = new android.view.windowmanager.layoutparams(-1, -1,0,-navigationbarheight(), windowmanager.layoutparams.type_system_overlay, windowmanager.layoutparams.flag_fullscreen |windowmanager.layoutparams.flag_not_focusable |windowmanager.layoutparams.flag_not_touchable |windowmanager.layoutparams.flag_layout_inset_decor |windowmanager.layoutparams.flag_layout_no_limits, pixel.translucent); f.addview(v, w);
but not overlay me despite me altering window size ... doesn't overlap navigation bar :(
i want make following...
https://play.google.com/store/apps/details?id=com.haxor&hl=en_gb
this not display above navigation bar, below (which fine needs)
can me? thanks.
what see on screenshots @ play market link android kitkat's (api 19) translucent decor.
you can make system bars partially translucent new themes,
theme.holo.noactionbar.translucentdecor
,theme.holo.light.noactionbar.translucentdecor
. enabling translucent system bars, layout fill area behind system bars, must enablefitssystemwindows
portion of layout should not covered system bars.if you're creating custom theme, set 1 of these themes parent theme or include
windowtranslucentnavigation
,windowtranslucentstatus
style properties in theme.
your translucent activity should declared in androidmanifest.xml
like:
<activity android:name="com.example.app.translucentactivity" android:theme="@android:style/theme.holo.noactionbar.translucentdecor" />
other way might want go hiding navigation bar api 14+:
view decorview = getwindow().getdecorview(); // hide both navigation bar , status bar. // system_ui_flag_fullscreen available on android 4.1 , higher, // general rule, should design app hide status bar whenever // hide navigation bar. int uioptions = view.system_ui_flag_hide_navigation | view.system_ui_flag_fullscreen; decorview.setsystemuivisibility(uioptions);
or might want use immersive full-screen mode api 19:
@override public void onwindowfocuschanged(boolean hasfocus) { super.onwindowfocuschanged(hasfocus); if (hasfocus) { decorview.setsystemuivisibility( view.system_ui_flag_layout_stable | view.system_ui_flag_layout_hide_navigation | view.system_ui_flag_layout_fullscreen | view.system_ui_flag_hide_navigation | view.system_ui_flag_fullscreen | view.system_ui_flag_immersive_sticky);} }
take @ using immersive full-screen mode , hiding navigation bar more detailed information.
Comments
Post a Comment