Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
Pluggable Transports
Snowflake Mobile
Commits
7b25c10d
Verified
Commit
7b25c10d
authored
Jul 24, 2020
by
HashikD
Browse files
Chagend ET summary to null when switch is off in preference - on start up
parent
120c9b88
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/torproject/snowflake/fragments/AppSettingsFragment.java
View file @
7b25c10d
...
...
@@ -33,13 +33,16 @@ public class AppSettingsFragment extends PreferenceFragmentCompat implements Sha
String
editT
=
settingMap
.
get
(
settingSwitch
);
boolean
isEnabled
=
sharedPreferences
.
getBoolean
(
settingSwitch
,
false
);
if
(!
isEnabled
)
findPreference
(
settingSwitch
).
setSummary
(
SettingsConstants
.
DEFAULT
);
Preference
editText
=
findPreference
(
editT
);
editText
.
setEnabled
(
isEnabled
);
editText
.
setSummary
(
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
(
""
);
}
}
}
...
...
app/src/main/res/xml/app_settings.xml
View file @
7b25c10d
...
...
@@ -14,7 +14,6 @@
android:key=
"stun_edit_text"
android:selectAllOnFocus=
"true"
android:singleLine=
"true"
android:summary=
"Using Default"
android:title=
"Custom STUN server"
app:iconSpaceReserved=
"false"
/>
...
...
@@ -27,7 +26,6 @@
android:key=
"broker_edit_text"
android:selectAllOnFocus=
"true"
android:singleLine=
"true"
android:summary=
"Using Default"
android:title=
"Custom broker URL"
app:iconSpaceReserved=
"false"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment