1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 17:59:33 +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");
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
myChooserCollection.update(requestCode, data);
}
}
@Override
protected void init(Intent intent) {
final Config config = Config.Instance();
@ -84,28 +91,28 @@ public class PreferenceActivity extends ZLPreferenceActivity {
String.valueOf(new DecimalFormatSymbols(Locale.getDefault()).getDecimalSeparator());
final Screen directoriesScreen = createPreferenceScreen("directories");
directoriesScreen.addPreference(new ZLStringListOptionPreference(
this, Paths.BookPathOption, directoriesScreen.Resource, "bookPath"
) {
protected void setValue(String value) {
super.setValue(value);
final BookCollectionShadow collection = new BookCollectionShadow();
collection.bindToService(PreferenceActivity.this, new Runnable() {
public void run() {
collection.reset(false);
collection.unbind();
}
});
directoriesScreen.addPreference(myChooserCollection.createPreference(
directoriesScreen.Resource, "bookPath", Paths.BookPathOption, new Runnable() {
public void run() {
final BookCollectionShadow collection = new BookCollectionShadow();
collection.bindToService(PreferenceActivity.this, new Runnable() {
public void run() {
collection.reset(false);
collection.unbind();
}
});
}
}
});
directoriesScreen.addPreference(new ZLStringListOptionPreference(
this, Paths.FontPathOption, directoriesScreen.Resource, "fontPath"
));
directoriesScreen.addPreference(new ZLStringListOptionPreference(
this, Paths.WallpaperPathOption, directoriesScreen.Resource, "wallpaperPath"
directoriesScreen.addPreference(myChooserCollection.createPreference(
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");
appearanceScreen.addPreference(new LanguagePreference(