1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +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(); final ZLAndroidApplication application = ZLAndroidApplication.Instance();
if (!application.ShowStatusBarOption.getValue() && if (!application.ShowStatusBarOption.getValue() &&
application.ShowStatusBarWhenMenuIsActiveOption.getValue()) { application.ShowStatusBarWhenMenuIsActiveOption.getValue()) {
final Window window = getWindow(); getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
final WindowManager.LayoutParams attrs = window.getAttributes();
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
window.setAttributes(attrs);
} }
return super.onPrepareOptionsMenu(menu); return super.onPrepareOptionsMenu(menu);
} }
@ -123,10 +120,7 @@ public final class FBReader extends ZLAndroidActivity {
final ZLAndroidApplication application = ZLAndroidApplication.Instance(); final ZLAndroidApplication application = ZLAndroidApplication.Instance();
if (!application.ShowStatusBarOption.getValue() && if (!application.ShowStatusBarOption.getValue() &&
application.ShowStatusBarWhenMenuIsActiveOption.getValue()) { application.ShowStatusBarWhenMenuIsActiveOption.getValue()) {
final Window window = getWindow(); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
final WindowManager.LayoutParams attrs = window.getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
window.setAttributes(attrs);
} }
} }

View file

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