diff --git a/app/src/main/java/com/amaze/filemanager/ui/activities/superclasses/ThemedActivity.java b/app/src/main/java/com/amaze/filemanager/ui/activities/superclasses/ThemedActivity.java index cbee76f25d..7bfd377d2e 100644 --- a/app/src/main/java/com/amaze/filemanager/ui/activities/superclasses/ThemedActivity.java +++ b/app/src/main/java/com/amaze/filemanager/ui/activities/superclasses/ThemedActivity.java @@ -49,6 +49,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.Window; +import android.view.WindowInsetsController; import android.view.WindowManager; import android.widget.FrameLayout; @@ -142,11 +143,33 @@ public void initStatusBarResources(View parentView) { window.setNavigationBarColor(PreferenceUtils.getStatusColor(getPrimary())); } else { if (getAppTheme().equals(AppTheme.LIGHT)) { - window.setNavigationBarColor(Utils.getColor(this, android.R.color.white)); - } else if (getAppTheme().equals(AppTheme.BLACK)) { - window.setNavigationBarColor(Utils.getColor(this, android.R.color.black)); + // do nothing: since the default android colors were better than the ones we set. + // setting white led to usability issues too. ref: #4211 } else { - window.setNavigationBarColor(Utils.getColor(this, R.color.holo_dark_background)); + + if (SDK_INT >= Build.VERSION_CODES.R) { + WindowInsetsController windowInsetController = getWindow().getInsetsController(); + if (windowInsetController != null) + windowInsetController.setSystemBarsAppearance( + WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS, + WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS); + + if (getAppTheme().equals(AppTheme.BLACK)) { + getWindow().setNavigationBarColor(Utils.getColor(this, android.R.color.black)); + } else { + getWindow().setNavigationBarColor(Utils.getColor(this, R.color.holo_dark_background)); + } + + } else if (SDK_INT >= Build.VERSION_CODES.O) { + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR); + + if (getAppTheme().equals(AppTheme.BLACK)) { + getWindow().setNavigationBarColor(Utils.getColor(this, android.R.color.black)); + } else { + getWindow().setNavigationBarColor(Utils.getColor(this, R.color.holo_dark_background)); + } + } + } } } else if (SDK_INT == Build.VERSION_CODES.KITKAT_WATCH