1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

always show status bar in menu mode (option has been removed)

This commit is contained in:
Nikolay Pultsin 2012-01-01 21:49:32 +00:00
parent b41a8d4b7c
commit 908e6c1ccc
3 changed files with 5 additions and 30 deletions

View file

@ -154,8 +154,7 @@ public final class FBReader extends ZLAndroidActivity {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
final ZLAndroidLibrary zlibrary = (ZLAndroidLibrary)ZLibrary.Instance();
if (!zlibrary.ShowStatusBarOption.getValue() &&
zlibrary.ShowStatusBarWhenMenuIsActiveOption.getValue()) {
if (!zlibrary.ShowStatusBarOption.getValue()) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
return super.onPrepareOptionsMenu(menu);
@ -165,8 +164,7 @@ public final class FBReader extends ZLAndroidActivity {
public void onOptionsMenuClosed(Menu menu) {
super.onOptionsMenuClosed(menu);
final ZLAndroidLibrary zlibrary = (ZLAndroidLibrary)ZLibrary.Instance();
if (!zlibrary.ShowStatusBarOption.getValue() &&
zlibrary.ShowStatusBarWhenMenuIsActiveOption.getValue()) {
if (!zlibrary.ShowStatusBarOption.getValue()) {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
}
@ -174,8 +172,7 @@ public final class FBReader extends ZLAndroidActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final ZLAndroidLibrary zlibrary = (ZLAndroidLibrary)ZLibrary.Instance();
if (!zlibrary.ShowStatusBarOption.getValue() &&
zlibrary.ShowStatusBarWhenMenuIsActiveOption.getValue()) {
if (!zlibrary.ShowStatusBarOption.getValue()) {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
return super.onOptionsItemSelected(item);

View file

@ -56,30 +56,12 @@ public class PreferenceActivity extends ZLPreferenceActivity {
}
directoriesScreen.addOption(Paths.WallpapersDirectoryOption(), "wallpapers");
final ZLPreferenceSet statusBarPreferences = new ZLPreferenceSet();
final Screen appearanceScreen = createPreferenceScreen("appearance");
appearanceScreen.addPreference(new ZLStringChoicePreference(
this, appearanceScreen.Resource, "screenOrientation",
androidLibrary.OrientationOption, androidLibrary.allOrientations()
));
appearanceScreen.addPreference(
new ZLBooleanPreference(
this, androidLibrary.ShowStatusBarOption, appearanceScreen.Resource, "showStatusBar"
) {
@Override
public void onClick() {
super.onClick();
statusBarPreferences.setEnabled(!isChecked());
}
}
);
statusBarPreferences.add(
appearanceScreen.addOption(
androidLibrary.ShowStatusBarWhenMenuIsActiveOption,
"showStatusBarWhenMenuIsActive"
)
);
statusBarPreferences.setEnabled(!androidLibrary.ShowStatusBarOption.getValue());
appearanceScreen.addOption(androidLibrary.ShowStatusBarOption, "showStatusBar");
appearanceScreen.addOption(androidLibrary.DisableButtonLightsOption, "disableButtonLights");
final Screen textScreen = createPreferenceScreen("text");
@ -112,10 +94,7 @@ public class PreferenceActivity extends ZLPreferenceActivity {
this, textScreen.Resource, "alignment",
baseStyle.AlignmentOption, alignments
));
textScreen.addPreference(new ZLBooleanPreference(
this, baseStyle.AutoHyphenationOption,
textScreen.Resource, "autoHyphenations"
));
textScreen.addOption(baseStyle.AutoHyphenationOption, "autoHyphenations");
final Screen moreStylesScreen = textScreen.createPreferenceScreen("more");

View file

@ -43,7 +43,6 @@ import org.geometerplus.zlibrary.ui.android.view.ZLAndroidWidget;
public final class ZLAndroidLibrary extends ZLibrary {
public final ZLBooleanOption ShowStatusBarOption = new ZLBooleanOption("LookNFeel", "ShowStatusBar", hasNoHardwareMenuButton());
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);