added iitc source preference summary to strings

This commit is contained in:
Philipp Schaefer 2013-06-12 21:13:45 +02:00
parent b98a9a1d0c
commit 0f92d694e6
3 changed files with 6 additions and 4 deletions

View File

@ -49,6 +49,7 @@
<string name="pref_enable_dev_mode_sum">If enabled, all IITC sources will be loaded from external storage of the Android device.
Please copy all sources from $IITC_folder/build/mobile/ to /sdcard/IITC_Mobile/dev/.</string>
<string name="pref_select_iitc">IITC source</string>
<string name="pref_select_iitc_sum">Load IITC main script from url or use local script. Currently used source:</string>
<string name="menu_chat">Chat</string>
<string name="menu_full">Full</string>

View File

@ -37,10 +37,10 @@
<PreferenceCategory
android:key="pref_mics"
android:title="@string/pref_misc_cat">
<!-- summary is set in settings fragment -->
<EditTextPreference
android:key="pref_iitc_source"
android:title="@string/pref_select_iitc"
android:summary="Load IITC main script from url or use local script. Currently used source: "
android:defaultValue="local"/>
<PreferenceScreen
android:key="pref_plugins"

View File

@ -59,15 +59,16 @@ public class IITC_SettingsFragment extends PreferenceFragment {
@Override
public boolean onPreferenceChange(Preference preference,
Object newValue) {
preference.setSummary((CharSequence) newValue);
preference.setSummary(getString(R.string.pref_select_iitc_sum) +
" " + (CharSequence) newValue);
// TODO: update iitc_version when iitc source has
// changed
return true;
}
});
// first init of summary
String pref_iitc_source_sum = (String) pref_iitc_source.getSummary()
+ pref_iitc_source.getText();
String pref_iitc_source_sum = getString(R.string.pref_select_iitc_sum)
+ " " + pref_iitc_source.getText();
pref_iitc_source.setSummary(pref_iitc_source_sum);
}