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:
Elias Naur
2019-07-11 13:03:31 +02:00
parent 828a695086
commit 15c4ce9e22
3 changed files with 56 additions and 12 deletions
+3 -3
View File
@@ -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);
}