Commit 0f0c9edb authored by Mygod's avatar Mygod

Remove redundant SummaryListPreference

parent 46fd69db
......@@ -26,7 +26,6 @@
<string name="auto_set_gfwlist">国内路由</string>
<string name="auto_set_gfwlist_summary">绕过所有位于中国的网站</string>
<string name="route_list">路由</string>
<string name="route_list_summary">绕过指定路由列表中的地址</string>
<string name="auto_set_proxy">全局代理</string>
<string name="auto_set_proxy_summary">设置系统代理</string>
<string name="proxied_apps">分应用代理</string>
......
......@@ -37,7 +37,6 @@
<string name="auto_set_gfwlist_summary">Bypass all sites located in China
</string>
<string name="route_list">Route</string>
<string name="route_list_summary">Bypass IP addresses in the route list</string>
<string name="auto_set_proxy">Global Proxy</string>
<string name="auto_set_proxy_summary">Set up system-wide proxy</string>
<string name="proxied_apps">Per-App Proxy</string>
......
......@@ -37,27 +37,28 @@
android:summary="@string/sitekey_summary"
android:title="@string/sitekey">
</com.github.shadowsocks.preferences.PasswordEditTextPreference>
<com.github.shadowsocks.preferences.SummaryListPreference
<ListPreference
android:defaultValue="rc4"
android:key="encMethod"
android:entries="@array/enc_method_entry"
android:entryValues="@array/enc_method_value"
android:summary="%s"
android:title="@string/enc_method">
</com.github.shadowsocks.preferences.SummaryListPreference>
</ListPreference>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/feature_cat">
<com.github.shadowsocks.preferences.SummaryListPreference
<ListPreference
android:defaultValue="all"
android:key="route"
android:entries="@array/route_entry"
android:entryValues="@array/route_value"
android:summary="@string/route_list_summary"
android:summary="%s"
android:title="@string/route_list">
</com.github.shadowsocks.preferences.SummaryListPreference>
</ListPreference>
<SwitchPreference
android:key="isIpv6"
android:defaultValue="false"
......
/*
* Shadowsocks - A shadowsocks client for Android
* Copyright (C) 2014 <max.c.lv@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* ___====-_ _-====___
* _--^^^#####// \\#####^^^--_
* _-^##########// ( ) \\##########^-_
* -############// |\^^/| \\############-
* _/############// (@::@) \\############\_
* /#############(( \\// ))#############\
* -###############\\ (oo) //###############-
* -#################\\ / VV \ //#################-
* -###################\\/ \//###################-
* _#/|##########/\######( /\ )######/\##########|\#_
* |/ |#/\#/\#/\/ \#/\##\ | | /##/\#/ \/\#/\#/\#| \|
* ` |/ V V ` V \#\| | | |/#/ V ' V V \| '
* ` ` ` ` / | | | | \ ' ' ' '
* ( | | | | )
* __\ | | | | /__
* (vvv(VVV)(VVV)vvv)
*
* HERE BE DRAGONS
*
*/
package com.github.shadowsocks.preferences
import android.preference.ListPreference
import android.content.Context
import android.util.AttributeSet
class SummaryListPreference(context: Context, attrs: AttributeSet)
extends ListPreference(context, attrs) {
override def setValue(text: String) {
super.setValue(text)
val entry = getEntry
if (entry != null)
setSummary(entry)
else
setSummary(text)
}
override def setSummary(summary: CharSequence) {
if (summary == null || summary.toString.isEmpty) {
super.setSummary("")
} else {
super.setSummary(summary)
}
}
}
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