Black navigation bar in dark theme

pull/169/head
M66B 5 years ago
parent 274c397c65
commit 3c919a645b

@ -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);

@ -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>

Loading…
Cancel
Save