1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 10:19:33 +02:00

better 'status-bar-when-menu-became-active' implementation by Steffen

This commit is contained in:
Nikolay Pultsin 2011-02-09 00:11:45 +00:00
parent 985bde0dce
commit 79c36fe6c9
2 changed files with 3 additions and 9 deletions

View file

@ -109,10 +109,7 @@ public final class FBReader extends ZLAndroidActivity {
final ZLAndroidApplication application = ZLAndroidApplication.Instance();
if (!application.ShowStatusBarOption.getValue() &&
application.ShowStatusBarWhenMenuIsActiveOption.getValue()) {
final Window window = getWindow();
final WindowManager.LayoutParams attrs = window.getAttributes();
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
window.setAttributes(attrs);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
return super.onPrepareOptionsMenu(menu);
}
@ -123,10 +120,7 @@ public final class FBReader extends ZLAndroidActivity {
final ZLAndroidApplication application = ZLAndroidApplication.Instance();
if (!application.ShowStatusBarOption.getValue() &&
application.ShowStatusBarWhenMenuIsActiveOption.getValue()) {
final Window window = getWindow();
final WindowManager.LayoutParams attrs = window.getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
window.setAttributes(attrs);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
}

View file

@ -35,7 +35,7 @@ public class ZLAndroidApplication extends Application {
public final ZLBooleanOption AutoOrientationOption = new ZLBooleanOption("LookNFeel", "AutoOrientation", false);
public final ZLBooleanOption ShowStatusBarOption = new ZLBooleanOption("LookNFeel", "ShowStatusBar", hasNoHardwareMenuButton());
public final ZLBooleanOption ShowStatusBarWhenMenuIsActiveOption = new ZLBooleanOption("LookNFeel", "ShowStatusBarWithMenu", false);
public final ZLBooleanOption ShowStatusBarWhenMenuIsActiveOption = new ZLBooleanOption("LookNFeel", "ShowStatusBarWithMenu", true);
public final ZLIntegerRangeOption BatteryLevelToTurnScreenOffOption = new ZLIntegerRangeOption("LookNFeel", "BatteryLevelToTurnScreenOff", 0, 100, 50);
public final ZLBooleanOption DontTurnScreenOffDuringChargingOption = new ZLBooleanOption("LookNFeel", "DontTurnScreenOffDuringCharging", true);
public final ZLIntegerRangeOption ScreenBrightnessLevelOption = new ZLIntegerRangeOption("LookNFeel", "ScreenBrightnessLevel", 0, 100, 0);