diff --git a/app/src/main/java/mw/gri/android/MainActivity.java b/app/src/main/java/mw/gri/android/MainActivity.java index 325da69..eb3dffa 100644 --- a/app/src/main/java/mw/gri/android/MainActivity.java +++ b/app/src/main/java/mw/gri/android/MainActivity.java @@ -1,15 +1,8 @@ package mw.gri.android; -import android.content.Context; -import android.graphics.Color; -import android.graphics.Point; -import android.os.Build; import android.os.Bundle; import android.system.ErrnoException; import android.system.Os; -import android.view.Display; -import android.view.WindowInsets; -import android.view.WindowManager; import com.google.androidgamesdk.GameActivity; public class MainActivity extends GameActivity { @@ -28,49 +21,10 @@ public class MainActivity extends GameActivity { super.onCreate(savedInstanceState); - findViewById(android.R.id.content).setBackgroundColor(Color.BLACK); - findViewById(android.R.id.content).setPadding(0, 0, 0, getNavigationBarHeight()); + int navBarHeight = Utils.getNavigationBarHeight(getApplicationContext()); +// int statusBarHeight = Utils.getStatusBarHeight(getApplicationContext()); + findViewById(android.R.id.content).setPadding(0, 0, 0, navBarHeight); } - public int getNavigationBarHeight() { - WindowManager windowManager = (WindowManager) getSystemService(Context.WINDOW_SERVICE); - if (Build.VERSION.SDK_INT >= 30) { - return windowManager - .getCurrentWindowMetrics() - .getWindowInsets() - .getInsets(WindowInsets.Type.navigationBars()) - .bottom; - } else { - Point appUsableSize = getAppUsableScreenSize(this); - Point realScreenSize = getRealScreenSize(this); - // navigation bar on the side - if (appUsableSize.x < realScreenSize.x) { - return appUsableSize.y; - } - - // navigation bar at the bottom - if (appUsableSize.y < realScreenSize.y) { - return realScreenSize.y - appUsableSize.y; - } - - // navigation bar is not present - return 0; - } - } - - public Point getAppUsableScreenSize(Context context) { - WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); - Point size = new Point(); - windowManager.getDefaultDisplay().getSize(size); - return size; - } - - public Point getRealScreenSize(Context context) { - WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); - Display display = windowManager.getDefaultDisplay(); - Point size = new Point(); - display.getRealSize(size); - return size; - } } \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index f8c6127..554c178 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,10 +1,7 @@ - #FFBB86FC - #FF6200EE - #FF3700B3 - #FF03DAC5 - #FF018786 + #FFFEF102 + #FFFEF102 #FF000000 #FFFFFFFF \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 608010d..19b3ae1 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,17 +1,13 @@ - \ No newline at end of file