mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
commit
c6885ec143
1 changed files with 8 additions and 3 deletions
|
|
@ -71,7 +71,12 @@ public class SettingsFragment extends PreferenceFragment {
|
||||||
uploadLimit.setText(uploads + "");
|
uploadLimit.setText(uploads + "");
|
||||||
uploadLimit.setSummary(uploads + "");
|
uploadLimit.setSummary(uploads + "");
|
||||||
uploadLimit.setOnPreferenceChangeListener((preference, newValue) -> {
|
uploadLimit.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||||
int value = Integer.parseInt(newValue.toString());
|
int value;
|
||||||
|
try {
|
||||||
|
value = Integer.parseInt(newValue.toString());
|
||||||
|
} catch(Exception e) {
|
||||||
|
value = 100; //Default number
|
||||||
|
}
|
||||||
final SharedPreferences.Editor editor = prefs.edit();
|
final SharedPreferences.Editor editor = prefs.edit();
|
||||||
if (value > 500) {
|
if (value > 500) {
|
||||||
new AlertDialog.Builder(getActivity())
|
new AlertDialog.Builder(getActivity())
|
||||||
|
|
@ -85,9 +90,9 @@ public class SettingsFragment extends PreferenceFragment {
|
||||||
uploadLimit.setSummary(500 + "");
|
uploadLimit.setSummary(500 + "");
|
||||||
uploadLimit.setText(500 + "");
|
uploadLimit.setText(500 + "");
|
||||||
} else {
|
} else {
|
||||||
editor.putInt(Prefs.UPLOADS_SHOWING, Integer.parseInt(newValue.toString()));
|
editor.putInt(Prefs.UPLOADS_SHOWING, value);
|
||||||
editor.putBoolean(Prefs.IS_CONTRIBUTION_COUNT_CHANGED,true);
|
editor.putBoolean(Prefs.IS_CONTRIBUTION_COUNT_CHANGED,true);
|
||||||
uploadLimit.setSummary(newValue.toString());
|
uploadLimit.setSummary(String.valueOf(value));
|
||||||
}
|
}
|
||||||
editor.apply();
|
editor.apply();
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue