mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Don't have default values when obtaining item from spinner
This commit is contained in:
parent
16553cc5e1
commit
3926b2165d
2 changed files with 5 additions and 3 deletions
|
|
@ -101,7 +101,7 @@ public class SingleUploadFragment extends Fragment {
|
|||
licenseItems.add(getString(R.string.license_name_cc_by_sa_four));
|
||||
|
||||
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
license = prefs.getString(Prefs.DEFAULT_LICENSE, Prefs.Licenses.CC_BY_SA_3);
|
||||
license = prefs.getString(Prefs.DEFAULT_LICENSE, null);
|
||||
|
||||
Log.d("Single Upload fragment", license);
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ public class SingleUploadFragment extends Fragment {
|
|||
selectedText.setBackgroundColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
String license = Prefs.Licenses.CC_BY_SA_3; // default value
|
||||
String license;
|
||||
if(getString(R.string.license_name_cc0).equals(licenseName)) {
|
||||
license = Prefs.Licenses.CC0;
|
||||
} else if(getString(R.string.license_name_cc_by).equals(licenseName)) {
|
||||
|
|
@ -163,6 +163,8 @@ public class SingleUploadFragment extends Fragment {
|
|||
license = Prefs.Licenses.CC_BY_4;
|
||||
} else if(getString(R.string.license_name_cc_by_sa_four).equals(licenseName)) {
|
||||
license = Prefs.Licenses.CC_BY_SA_4;
|
||||
} else {
|
||||
throw new IllegalStateException("Unknown licenseName: " + licenseName);
|
||||
}
|
||||
|
||||
setLicenseSummary(license);
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public class UploadController {
|
|||
contribution.setDescription("");
|
||||
}
|
||||
|
||||
String license = prefs.getString(Prefs.DEFAULT_LICENSE, Prefs.Licenses.CC_BY_SA_3);
|
||||
String license = prefs.getString(Prefs.DEFAULT_LICENSE, null);
|
||||
contribution.setLicense(license);
|
||||
|
||||
//FIXME: Add permission request here. Only executeAsyncTask if permission has been granted
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue