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
f35a4b05
Commit
f35a4b05
authored
Jul 10, 2016
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #752
parent
82e6266f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
src/main/scala/com/github/shadowsocks/preferences/DropDownPreference.scala
...m/github/shadowsocks/preferences/DropDownPreference.scala
+7
-1
No files found.
src/main/scala/com/github/shadowsocks/preferences/DropDownPreference.scala
View file @
f35a4b05
...
@@ -104,6 +104,12 @@ final class DropDownPreference(private val mContext: Context, attrs: AttributeSe
...
@@ -104,6 +104,12 @@ final class DropDownPreference(private val mContext: Context, attrs: AttributeSe
/**
/**
* Sets the value to the given index from the entry values.
* Sets the value to the given index from the entry values.
*
*
* Remember to callChangeListener() if this extends Preference directly
*
* https://github.com/android/platform_frameworks_base/blob/
* 4535e11fb7010f2b104d3f8b3954407b9f330e0f/core/java/
* android/preference/ListPreference.java#L282
*
* @param index The index of the value to set.
* @param index The index of the value to set.
*/
*/
def
setValueIndex
(
index
:
Int
)
{
def
setValueIndex
(
index
:
Int
)
{
...
@@ -113,8 +119,8 @@ final class DropDownPreference(private val mContext: Context, attrs: AttributeSe
...
@@ -113,8 +119,8 @@ final class DropDownPreference(private val mContext: Context, attrs: AttributeSe
mValueSet
=
true
mValueSet
=
true
if
(
mEntryValues
!=
null
)
{
if
(
mEntryValues
!=
null
)
{
val
value
=
mEntryValues
(
index
).
toString
val
value
=
mEntryValues
(
index
).
toString
if
(
changed
)
callChangeListener
(
value
)
persistString
(
value
)
persistString
(
value
)
setValue
(
value
)
}
}
if
(
changed
)
notifyChanged
if
(
changed
)
notifyChanged
}
}
...
...
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