forked from joejulian/gio
ui/app,cmd/gio: support edge-to-edge layout on Android
Implement recomendations from https://developer.android.com/preview/features/gesturalnav#java While here, give up on providing translucent top and bottom bars on Android 4.4 and below. It's simpler to use the app drawn system backgrounds from 5.0 and newer. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -17,11 +17,11 @@ public class GioActivity extends Activity {
|
||||
super.onCreate(state);
|
||||
|
||||
Window w = getWindow();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
w.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
}
|
||||
|
||||
this.view = new GioView(this);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
this.view.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
}
|
||||
this.view.setLayoutParams(new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT));
|
||||
setContentView(view);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user