don't override summary value in PreferenceController
This commit is contained in:
parent
605e02fa70
commit
ee1809001d
|
@ -464,15 +464,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
ui.findPreference(UserPreferences.PREF_EPISODE_CACHE_SIZE)
|
|
||||||
.setOnPreferenceChangeListener(
|
|
||||||
(preference, o) -> {
|
|
||||||
if (o instanceof String) {
|
|
||||||
setEpisodeCacheSizeText(UserPreferences.readEpisodeCacheSize((String) o));
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupNetworkScreen() {
|
private void setupNetworkScreen() {
|
||||||
|
@ -695,7 +686,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
|
||||||
setParallelDownloadsText(UserPreferences.getParallelDownloads());
|
setParallelDownloadsText(UserPreferences.getParallelDownloads());
|
||||||
break;
|
break;
|
||||||
case R.xml.preferences_autodownload:
|
case R.xml.preferences_autodownload:
|
||||||
setEpisodeCacheSizeText(UserPreferences.getEpisodeCacheSize());
|
|
||||||
checkAutodownloadItemVisibility(UserPreferences.isEnableAutodownload());
|
checkAutodownloadItemVisibility(UserPreferences.isEnableAutodownload());
|
||||||
break;
|
break;
|
||||||
case R.xml.preferences_storage:
|
case R.xml.preferences_storage:
|
||||||
|
@ -942,20 +932,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
|
||||||
ui.findPreference(UserPreferences.PREF_PARALLEL_DOWNLOADS).setSummary(s);
|
ui.findPreference(UserPreferences.PREF_PARALLEL_DOWNLOADS).setSummary(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setEpisodeCacheSizeText(int cacheSize) {
|
|
||||||
final Resources res = ui.getActivity().getResources();
|
|
||||||
|
|
||||||
String s;
|
|
||||||
if (cacheSize == res.getInteger(
|
|
||||||
R.integer.episode_cache_size_unlimited)) {
|
|
||||||
s = res.getString(R.string.pref_episode_cache_unlimited);
|
|
||||||
} else {
|
|
||||||
s = Integer.toString(cacheSize)
|
|
||||||
+ res.getString(R.string.episodes_suffix);
|
|
||||||
}
|
|
||||||
ui.findPreference(UserPreferences.PREF_EPISODE_CACHE_SIZE).setSummary(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDataFolderText() {
|
private void setDataFolderText() {
|
||||||
File f = UserPreferences.getDataFolder(null);
|
File f = UserPreferences.getDataFolder(null);
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
|
|
Loading…
Reference in New Issue