Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
e9505465
Commit
e9505465
authored
Jun 08, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the list preference
parent
22d0abc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
2 deletions
+64
-2
src/main/res/xml/pref_all.xml
src/main/res/xml/pref_all.xml
+2
-2
src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala
...ithub/shadowsocks/preferences/SummaryListPreference.scala
+62
-0
No files found.
src/main/res/xml/pref_all.xml
View file @
e9505465
...
...
@@ -35,13 +35,13 @@
android:summary=
"@string/sitekey_summary"
android:title=
"@string/sitekey"
>
</com.github.shadowsocks.preferences.PasswordEditTextPreference>
<ListPreference
<
com.github.shadowsocks.preferences.Summary
ListPreference
android:defaultValue=
"rc4"
android:key=
"encMethod"
android:entries=
"@array/enc_method_entry"
android:entryValues=
"@array/enc_method_value"
android:title=
"@string/enc_method"
>
</ListPreference>
</
com.github.shadowsocks.preferences.Summary
ListPreference>
</PreferenceCategory>
...
...
src/main/scala/com/github/shadowsocks/preferences/SummaryListPreference.scala
0 → 100644
View file @
e9505465
/*
* 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
)
setSummary
(
text
.
toUpperCase
)
}
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
""
)
}
else
{
super
.
setSummary
(
summary
)
}
}
}
Write
Preview
Markdown
is supported
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