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

refactoring

This commit is contained in:
Nikolay Pultsin 2014-05-03 02:21:58 +01:00
parent 471cef831c
commit 9f9b0ce63a
3 changed files with 17 additions and 24 deletions

View file

@ -24,6 +24,7 @@ import android.content.Intent;
import org.geometerplus.zlibrary.core.options.ZLStringOption;
import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.core.util.MiscUtil;
import org.geometerplus.android.util.FileChooserUtil;
@ -44,15 +45,19 @@ class FileChooserStringPreference extends FileChooserPreference {
@Override
protected void setValueFromIntent(Intent data) {
setValue(FileChooserUtil.pathFromData(data));
}
final String value = FileChooserUtil.pathFromData(data);
if (MiscUtil.isEmptyString(value)) {
return;
}
@Override
protected void setValueInternal(String value) {
final String currentValue = myOption.getValue();
if (!currentValue.equals(value)) {
myOption.setValue(value);
setSummary(value);
}
if (myOnValueSetAction != null) {
myOnValueSetAction.run();
}
}
}