Improve non-fullscreen reading

This commit is contained in:
NekoInverter committed 2021-01-24 17:28:22 +08:00
1 parent 251efdb292
commit 1ce8f894d1
6 files changed
+36 -541

No files matched your search

@@ -377,12 +377,28 @@ public class GalleryActivity extends EhActivity implements SeekBar.OnSeekBarChan
// System UI helper
if (Settings.getReadingFullscreen()) {
int systemUiLevel;
systemUiLevel = SystemUiHelper.LEVEL_IMMERSIVE;
mSystemUiHelper = new SystemUiHelper(this, systemUiLevel,
SystemUiHelper.FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES | SystemUiHelper.FLAG_IMMERSIVE_STICKY);
mSystemUiHelper = new SystemUiHelper(this);
mSystemUiHelper.hide();
mShowSystemUi = false;
} else {
Window window = getWindow();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
View decorView = window.getDecorView();
int flags = decorView.getSystemUiVisibility();
if ((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_YES) <= 0) {
flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
} else {
flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR;
}
decorView.setSystemUiVisibility(flags);
window.setStatusBarColor(AttrResources.getAttrColor(this, android.R.attr.colorBackground));
} else {
if ((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_YES) <= 0) {
window.setStatusBarColor(AttrResources.getAttrColor(this, R.attr.colorPrimaryDark));
} else {
window.setStatusBarColor(AttrResources.getAttrColor(this, android.R.attr.colorBackground));
}
}
}
mMaskView = (ColorView) ViewUtils.$$(this, R.id.mask);