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
d5be325a
Commit
d5be325a
authored
Jan 14, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some bugfixes for new UI
parent
a38c9920
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
mobile/src/main/scala/com/github/shadowsocks/ProfileConfigFragment.scala
.../scala/com/github/shadowsocks/ProfileConfigFragment.scala
+1
-0
mobile/src/main/scala/com/github/shadowsocks/plugin/PluginConfiguration.scala
...a/com/github/shadowsocks/plugin/PluginConfiguration.scala
+3
-2
mobile/src/main/scala/com/github/shadowsocks/preference/BottomSheetPreferenceDialogFragment.scala
...ocks/preference/BottomSheetPreferenceDialogFragment.scala
+1
-1
No files found.
mobile/src/main/scala/com/github/shadowsocks/ProfileConfigFragment.scala
View file @
d5be325a
...
...
@@ -105,6 +105,7 @@ class ProfileConfigFragment extends PreferenceFragment with OnMenuItemClickListe
pluginConfiguration
=
new
PluginConfiguration
(
app
.
settings
.
getString
(
Key
.
plugin
,
null
))
plugin
.
setValue
(
pluginConfiguration
.
selected
)
plugin
.
checkSummary
()
pluginConfigure
.
setEnabled
(!
TextUtils
.
isEmpty
(
pluginConfiguration
.
selected
))
pluginConfigure
.
setText
(
pluginConfiguration
.
selectedOptions
.
toString
)
}
...
...
mobile/src/main/scala/com/github/shadowsocks/plugin/PluginConfiguration.scala
View file @
d5be325a
...
...
@@ -10,7 +10,7 @@ import scala.collection.mutable
*/
class
PluginConfiguration
(
val
pluginsOptions
:
Map
[
String
,
PluginOptions
],
val
selected
:
String
)
{
private
def
this
(
plugins
:
Array
[
PluginOptions
])
=
this
(
plugins
.
map
(
opt
=>
opt
.
id
->
opt
).
toMap
,
if
(
plugins
.
isEmpty
)
""
else
plugins
(
0
).
id
)
this
(
plugins
.
filter
(
_
.
id
.
nonEmpty
).
map
(
opt
=>
opt
.
id
->
opt
).
toMap
,
if
(
plugins
.
isEmpty
)
""
else
plugins
(
0
).
id
)
def
this
(
plugin
:
String
)
=
this
(
if
(
plugin
==
null
)
Array
[
PluginOptions
]()
else
plugin
.
split
(
"\n"
).
map
{
case
line
if
line
.
startsWith
(
"kcptun "
)
=>
val
opt
=
new
PluginOptions
()
...
...
@@ -30,7 +30,8 @@ class PluginConfiguration(val pluginsOptions: Map[String, PluginOptions], val se
case
line
=>
new
PluginOptions
(
line
)
})
def
selectedOptions
:
PluginOptions
=
pluginsOptions
(
selected
)
def
getOptions
(
id
:
String
)
:
PluginOptions
=
if
(
id
.
isEmpty
)
new
PluginOptions
()
else
pluginsOptions
(
id
)
def
selectedOptions
:
PluginOptions
=
getOptions
(
selected
)
override
def
toString
:
String
=
{
val
result
=
new
mutable
.
ListBuffer
[
PluginOptions
]()
...
...
mobile/src/main/scala/com/github/shadowsocks/preference/BottomSheetPreferenceDialogFragment.scala
View file @
d5be325a
...
...
@@ -34,7 +34,7 @@ final class BottomSheetPreferenceDialogFragment extends PreferenceDialogFragment
dialog
}
def
onDialogClosed
(
positiveResult
:
Boolean
)
:
Unit
=
if
(
clickedIndex
>=
0
)
{
def
onDialogClosed
(
positiveResult
:
Boolean
)
:
Unit
=
if
(
clickedIndex
>=
0
&&
clickedIndex
!=
index
)
{
val
value
=
preference
.
getEntryValues
()(
clickedIndex
).
toString
if
(
preference
.
callChangeListener
(
value
))
preference
.
setValue
(
value
)
}
...
...
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