mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 02:09:35 +02:00
PreferenceSet.Reloader (in progress)
This commit is contained in:
parent
0274d73aa9
commit
a6aa805e81
2 changed files with 15 additions and 2 deletions
|
@ -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
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue