1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 04:35:57 +00:00

Black navigation bar in dark theme

This commit is contained in:
M66B 2019-12-08 10:48:49 +01:00
parent 274c397c65
commit 3c919a645b
2 changed files with 15 additions and 0 deletions

View file

@ -25,9 +25,12 @@ import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.os.PowerManager;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;
@ -102,6 +105,16 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
else
setTheme(R.style.AppThemeGreyLight);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
boolean dark = Helper.isDarkTheme(this);
Window window = getWindow();
View view = window.getDecorView();
int flags = view.getSystemUiVisibility();
if (dark)
flags &= ~View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
view.setSystemUiVisibility(flags);
}
}
prefs.registerOnSharedPreferenceChangeListener(this);

View file

@ -70,6 +70,8 @@
<item name="themeName">dark</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:navigationBarColor">@color/black</item>
<item name="colorPrimary">@color/darkPrimary</item>
<item name="colorPrimaryDark">@color/darkPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>