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

used file chooser options

This commit is contained in:
Nikolay Pultsin 2014-04-14 04:11:23 +01:00
parent d368c40c8f
commit dbb30c11b6

View file

@ -56,6 +56,13 @@ public class PreferenceActivity extends ZLPreferenceActivity {
super("Preferences"); super("Preferences");
} }
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
myChooserCollection.update(requestCode, data);
}
}
@Override @Override
protected void init(Intent intent) { protected void init(Intent intent) {
final Config config = Config.Instance(); final Config config = Config.Instance();
@ -84,28 +91,28 @@ public class PreferenceActivity extends ZLPreferenceActivity {
String.valueOf(new DecimalFormatSymbols(Locale.getDefault()).getDecimalSeparator()); String.valueOf(new DecimalFormatSymbols(Locale.getDefault()).getDecimalSeparator());
final Screen directoriesScreen = createPreferenceScreen("directories"); final Screen directoriesScreen = createPreferenceScreen("directories");
directoriesScreen.addPreference(new ZLStringListOptionPreference( directoriesScreen.addPreference(myChooserCollection.createPreference(
this, Paths.BookPathOption, directoriesScreen.Resource, "bookPath" directoriesScreen.Resource, "bookPath", Paths.BookPathOption, new Runnable() {
) { public void run() {
protected void setValue(String value) { final BookCollectionShadow collection = new BookCollectionShadow();
super.setValue(value); collection.bindToService(PreferenceActivity.this, new Runnable() {
public void run() {
final BookCollectionShadow collection = new BookCollectionShadow(); collection.reset(false);
collection.bindToService(PreferenceActivity.this, new Runnable() { collection.unbind();
public void run() { }
collection.reset(false); });
collection.unbind(); }
}
});
} }
});
directoriesScreen.addPreference(new ZLStringListOptionPreference(
this, Paths.FontPathOption, directoriesScreen.Resource, "fontPath"
)); ));
directoriesScreen.addPreference(new ZLStringListOptionPreference( directoriesScreen.addPreference(myChooserCollection.createPreference(
this, Paths.WallpaperPathOption, directoriesScreen.Resource, "wallpaperPath" directoriesScreen.Resource, "fontPath", Paths.FontPathOption
));
directoriesScreen.addPreference(myChooserCollection.createPreference(
directoriesScreen.Resource, "wallpaperPath", Paths.WallpaperPathOption
));
directoriesScreen.addPreference(myChooserCollection.createPreference(
directoriesScreen.Resource, "tempDir", Paths.TempDirectoryOption()
)); ));
directoriesScreen.addOption(Paths.TempDirectoryOption(), "tempDir");
final Screen appearanceScreen = createPreferenceScreen("appearance"); final Screen appearanceScreen = createPreferenceScreen("appearance");
appearanceScreen.addPreference(new LanguagePreference( appearanceScreen.addPreference(new LanguagePreference(