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

PreferenceSet.Reloader (in progress)

This commit is contained in:
Nikolay Pultsin 2014-05-03 22:00:28 +01:00
parent 0274d73aa9
commit a6aa805e81
2 changed files with 15 additions and 2 deletions

View file

@ -218,10 +218,13 @@ public class PreferenceActivity extends ZLPreferenceActivity {
fontPropertiesScreen.addOption(ZLAndroidPaintContext.SubpixelOption, "subpixel"); fontPropertiesScreen.addOption(ZLAndroidPaintContext.SubpixelOption, "subpixel");
final ZLTextBaseStyle baseStyle = collection.getBaseStyle(); final ZLTextBaseStyle baseStyle = collection.getBaseStyle();
textScreen.addPreference(new FontPreference(
final FontPreference fontPreference = new FontPreference(
this, textScreen.Resource, "font", this, textScreen.Resource, "font",
baseStyle.FontFamilyOption, false baseStyle.FontFamilyOption, false
)); );
textScreen.addPreference(fontPreference);
textScreen.addPreference(new ZLIntegerRangePreference( textScreen.addPreference(new ZLIntegerRangePreference(
this, textScreen.Resource.getResource("fontSize"), this, textScreen.Resource.getResource("fontSize"),
baseStyle.FontSizeOption baseStyle.FontSizeOption

View file

@ -45,4 +45,14 @@ abstract class PreferenceSet<T> {
preference.setEnabled(state); preference.setEnabled(state);
} }
} }
static class Reloader extends PreferenceSet<Void> {
protected Void detectState() {
return null;
}
protected void update(Preference preference, Void state) {
((ReloadablePreference)preference).reload();
}
}
} }