Commit f67695a6 authored by Mygod's avatar Mygod

Replace CheckBoxes with Switches

parent 8d4a1ad6
...@@ -151,8 +151,8 @@ object Shadowsocks { ...@@ -151,8 +151,8 @@ object Shadowsocks {
pref.asInstanceOf[ProfileEditTextPreference].setText(value) pref.asInstanceOf[ProfileEditTextPreference].setText(value)
} }
def updateCheckBoxPreference(pref: Preference, value: Boolean) { def updateSwitchPreference(pref: Preference, value: Boolean) {
pref.asInstanceOf[CheckBoxPreference].setChecked(value) pref.asInstanceOf[SwitchPreference].setChecked(value)
} }
def updatePreference(pref: Preference, name: String, profile: Profile) { def updatePreference(pref: Preference, name: String, profile: Profile) {
...@@ -164,10 +164,10 @@ object Shadowsocks { ...@@ -164,10 +164,10 @@ object Shadowsocks {
case Key.sitekey => updatePasswordEditTextPreference(pref, profile.password) case Key.sitekey => updatePasswordEditTextPreference(pref, profile.password)
case Key.encMethod => updateListPreference(pref, profile.method) case Key.encMethod => updateListPreference(pref, profile.method)
case Key.route => updateListPreference(pref, profile.route) case Key.route => updateListPreference(pref, profile.route)
case Key.isGlobalProxy => updateCheckBoxPreference(pref, profile.global) case Key.isGlobalProxy => updateSwitchPreference(pref, profile.global)
case Key.isUdpDns => updateCheckBoxPreference(pref, profile.udpdns) case Key.isUdpDns => updateSwitchPreference(pref, profile.udpdns)
case Key.isAuth => updateCheckBoxPreference(pref, profile.auth) case Key.isAuth => updateSwitchPreference(pref, profile.auth)
case Key.isIpv6 => updateCheckBoxPreference(pref, profile.ipv6) case Key.isIpv6 => updateSwitchPreference(pref, profile.ipv6)
case _ => case _ =>
} }
} }
......
Markdown is supported
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