Display summary line for license with current license text

Change-Id: Id7f524f46ef336046978766131b896f3147f0a54
GitHub: https://github.com/wikimedia/apps-android-commons/pull/19
This commit is contained in:
YuviPanda 2013-06-18 18:50:28 +00:00 committed by SuchABot
parent 48a2363051
commit 00c0ccea49

View file

@ -5,6 +5,7 @@ import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.preference.ListPreference; import android.preference.ListPreference;
import android.preference.Preference; import android.preference.Preference;
import android.preference.PreferenceManager;
import android.util.Log; import android.util.Log;
import com.actionbarsherlock.app.SherlockPreferenceActivity; import com.actionbarsherlock.app.SherlockPreferenceActivity;
@ -26,6 +27,15 @@ public class SettingsActivity extends SherlockPreferenceActivity implements Shar
Prefs.Licenses.CC_BY, Prefs.Licenses.CC_BY,
Prefs.Licenses.CC_BY_SA Prefs.Licenses.CC_BY_SA
}); });
licensePreference.setSummary(getString(Utils.licenseNameFor(licensePreference.getValue())));
licensePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(Preference preference, Object newValue) {
preference.setSummary(getString(Utils.licenseNameFor((String)newValue)));
return true;
}
});
app = (CommonsApplication)getApplicationContext(); app = (CommonsApplication)getApplicationContext();
} }