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

preference dependency has been added

This commit is contained in:
Nikolay Pultsin 2011-01-21 06:49:19 +00:00
parent c8d571f7e1
commit 10b09a2a4b
3 changed files with 25 additions and 5 deletions

View file

@ -328,8 +328,22 @@ public class PreferenceActivity extends ZLPreferenceActivity {
final ScrollingPreferences scrollingPreferences = ScrollingPreferences.Instance();
scrollingScreen.addOption(scrollingPreferences.FingerScrollingOption, "fingerScrolling");
scrollingScreen.addOption(fbReader.EnableDoubleTapOption, "enableDoubleTapDetection");
scrollingScreen.addOption(scrollingPreferences.VolumeKeysOption, "volumeKeys");
scrollingScreen.addOption(scrollingPreferences.InvertVolumeKeysOption, "invertVolumeKeys");
final ZLPreferenceSet volumeKeysPreferences = new ZLPreferenceSet();
scrollingScreen.addPreference(new ZLBooleanPreference(
this, scrollingPreferences.VolumeKeysOption, scrollingScreen.Resource, "volumeKeys"
) {
@Override
protected void onClick() {
super.onClick();
volumeKeysPreferences.setEnabled(isChecked());
}
});
volumeKeysPreferences.add(scrollingScreen.addOption(
scrollingPreferences.InvertVolumeKeysOption, "invertVolumeKeys"
));
volumeKeysPreferences.setEnabled(scrollingPreferences.VolumeKeysOption.getValue());
scrollingScreen.addOption(scrollingPreferences.AnimationOption, "animation");
scrollingScreen.addOption(scrollingPreferences.HorizontalOption, "horizontal");

View file

@ -39,7 +39,12 @@ class ZLBooleanPreference extends CheckBoxPreference implements ZLPreference {
setChecked(option.getValue());
}
public void onAccept() {
@Override
protected void onClick() {
super.onClick();
myOption.setValue(isChecked());
}
public void onAccept() {
}
}

View file

@ -46,11 +46,12 @@ class ZLIntegerRangePreference extends ListPreference implements ZLPreference {
protected void onDialogClosed(boolean result) {
super.onDialogClosed(result);
if (result) {
setSummary(getValue());
final String value = getValue();
setSummary(value);
myOption.setValue(myOption.MinValue + findIndexOfValue(value));
}
}
public void onAccept() {
myOption.setValue(myOption.MinValue + findIndexOfValue(getValue()));
}
}