mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
Keep obsolete license values to prevent crashe after upgrade
This commit is contained in:
parent
db81e9c6bb
commit
87b3132d21
3 changed files with 28 additions and 0 deletions
|
|
@ -12,5 +12,9 @@ public class Prefs {
|
|||
public static final String CC_BY_SA_4 = "CC BY-SA 4.0";
|
||||
public static final String CC_BY_4 = "CC BY 4.0";
|
||||
public static final String CC0 = "CC0";
|
||||
|
||||
// kept for backward compatibility to v2.1
|
||||
@Deprecated public static final String CC_BY = "CC BY";
|
||||
@Deprecated public static final String CC_BY_SA = "CC BY-SA";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,22 @@ public class SettingsFragment extends PreferenceFragment {
|
|||
|
||||
// Update spinner to show selected value as summary
|
||||
ListPreference licensePreference = (ListPreference) findPreference(Prefs.DEFAULT_LICENSE);
|
||||
// WARNING: ORDERING NEEDS TO MATCH FOR THE LICENSE NAMES AND DISPLAY VALUES
|
||||
licensePreference.setEntries(new String[]{
|
||||
getString(R.string.license_name_cc0),
|
||||
getString(R.string.license_name_cc_by_3_0),
|
||||
getString(R.string.license_name_cc_by_4_0),
|
||||
getString(R.string.license_name_cc_by_sa_3_0),
|
||||
getString(R.string.license_name_cc_by_sa_4_0)
|
||||
});
|
||||
licensePreference.setEntryValues(new String[]{
|
||||
Prefs.Licenses.CC0,
|
||||
Prefs.Licenses.CC_BY_3,
|
||||
Prefs.Licenses.CC_BY_4,
|
||||
Prefs.Licenses.CC_BY_SA_3,
|
||||
Prefs.Licenses.CC_BY_SA_4
|
||||
});
|
||||
|
||||
licensePreference.setSummary(getString(Utils.licenseNameFor(licensePreference.getValue())));
|
||||
licensePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue