mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
* UploadController: Added support for using author names. Fixes #1707. * Minor PR tidy-up * Reword preference item * Null check to pass startUpload test
This commit is contained in:
parent
809c0c32d7
commit
8e967a3698
4 changed files with 34 additions and 0 deletions
|
|
@ -63,6 +63,15 @@ public class SettingsFragment extends PreferenceFragment {
|
|||
return true;
|
||||
});
|
||||
|
||||
//Check if the Author Name switch is enabled and appropriately handle the author name usage
|
||||
SwitchPreference useAuthorName = (SwitchPreference) findPreference("useAuthorName");
|
||||
EditTextPreference authorName = (EditTextPreference) findPreference("authorName");
|
||||
authorName.setEnabled(prefs.getBoolean("useAuthorName", false));
|
||||
useAuthorName.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
authorName.setEnabled((Boolean)newValue);
|
||||
return true;
|
||||
});
|
||||
|
||||
final EditTextPreference uploadLimit = (EditTextPreference) findPreference("uploads");
|
||||
int uploads = prefs.getInt(Prefs.UPLOADS_SHOWING, 100);
|
||||
uploadLimit.setText(uploads + "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue