Verified Commit 7b25c10d authored by HashikD's avatar HashikD
Browse files

Chagend ET summary to null when switch is off in preference - on start up

parent 120c9b88
...@@ -33,13 +33,16 @@ public class AppSettingsFragment extends PreferenceFragmentCompat implements Sha ...@@ -33,13 +33,16 @@ public class AppSettingsFragment extends PreferenceFragmentCompat implements Sha
String editT = settingMap.get(settingSwitch); String editT = settingMap.get(settingSwitch);
boolean isEnabled = sharedPreferences.getBoolean(settingSwitch, false); boolean isEnabled = sharedPreferences.getBoolean(settingSwitch, false);
if (!isEnabled)
findPreference(settingSwitch).setSummary(SettingsConstants.DEFAULT);
Preference editText = findPreference(editT); Preference editText = findPreference(editT);
editText.setEnabled(isEnabled); editText.setEnabled(isEnabled);
editText.setSummary( editText.setSummary(
sharedPreferences.getString(editT, SettingsConstants.DEFAULT)); sharedPreferences.getString(editT, SettingsConstants.DEFAULT));
if (!isEnabled) {
findPreference(settingSwitch).setSummary(SettingsConstants.DEFAULT);
//Setting the summary of EditText to empty when the switch is off.
editText.setSummary("");
}
} }
} }
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
android:key="stun_edit_text" android:key="stun_edit_text"
android:selectAllOnFocus="true" android:selectAllOnFocus="true"
android:singleLine="true" android:singleLine="true"
android:summary="Using Default"
android:title="Custom STUN server" android:title="Custom STUN server"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
...@@ -27,7 +26,6 @@ ...@@ -27,7 +26,6 @@
android:key="broker_edit_text" android:key="broker_edit_text"
android:selectAllOnFocus="true" android:selectAllOnFocus="true"
android:singleLine="true" android:singleLine="true"
android:summary="Using Default"
android:title="Custom broker URL" android:title="Custom broker URL"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment