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
e82c7ccb
Commit
e82c7ccb
authored
Dec 15, 2015
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine #478
parent
88b87537
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
src/main/scala/com/github/shadowsocks/AppManager.scala
src/main/scala/com/github/shadowsocks/AppManager.scala
+4
-2
src/main/scala/com/github/shadowsocks/ShadowsocksSettings.scala
...in/scala/com/github/shadowsocks/ShadowsocksSettings.scala
+5
-7
No files found.
src/main/scala/com/github/shadowsocks/AppManager.scala
View file @
e82c7ccb
...
@@ -221,8 +221,10 @@ class AppManager extends AppCompatActivity with OnCheckedChangeListener with OnC
...
@@ -221,8 +221,10 @@ class AppManager extends AppCompatActivity with OnCheckedChangeListener with OnC
WindowManager
.
LayoutParams
.
FLAG_NOT_FOCUSABLE
|
WindowManager
.
LayoutParams
.
FLAG_NOT_FOCUSABLE
|
WindowManager
.
LayoutParams
.
FLAG_NOT_TOUCHABLE
,
PixelFormat
.
TRANSLUCENT
))
WindowManager
.
LayoutParams
.
FLAG_NOT_TOUCHABLE
,
PixelFormat
.
TRANSLUCENT
))
findViewById
(
R
.
id
.
onSwitch
).
asInstanceOf
[
Switch
]
ShadowsocksApplication
.
settings
.
edit
().
putBoolean
(
Key
.
isProxyApps
,
true
).
commit
()
.
setOnCheckedChangeListener
((
button
:
CompoundButton
,
checked
:
Boolean
)
=>
{
val
onSwitch
=
findViewById
(
R
.
id
.
onSwitch
).
asInstanceOf
[
Switch
]
onSwitch
.
setChecked
(
true
)
onSwitch
.
setOnCheckedChangeListener
((
button
:
CompoundButton
,
checked
:
Boolean
)
=>
{
ShadowsocksApplication
.
settings
.
edit
().
putBoolean
(
Key
.
isProxyApps
,
checked
).
commit
()
ShadowsocksApplication
.
settings
.
edit
().
putBoolean
(
Key
.
isProxyApps
,
checked
).
commit
()
finish
()
finish
()
})
})
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksSettings.scala
View file @
e82c7ccb
...
@@ -24,6 +24,11 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
...
@@ -24,6 +24,11 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
getPreferenceManager
.
getSharedPreferences
.
registerOnSharedPreferenceChangeListener
(
this
)
getPreferenceManager
.
getSharedPreferences
.
registerOnSharedPreferenceChangeListener
(
this
)
isProxyApps
=
findPreference
(
Key
.
isProxyApps
).
asInstanceOf
[
SwitchPreference
]
isProxyApps
=
findPreference
(
Key
.
isProxyApps
).
asInstanceOf
[
SwitchPreference
]
isProxyApps
.
setOnPreferenceClickListener
((
preference
:
Preference
)
=>
{
startActivity
(
new
Intent
(
activity
,
classOf
[
AppManager
]))
isProxyApps
.
setChecked
(
true
)
false
})
findPreference
(
"recovery"
).
setOnPreferenceClickListener
((
preference
:
Preference
)
=>
{
findPreference
(
"recovery"
).
setOnPreferenceClickListener
((
preference
:
Preference
)
=>
{
ShadowsocksApplication
.
track
(
Shadowsocks
.
TAG
,
"reset"
)
ShadowsocksApplication
.
track
(
Shadowsocks
.
TAG
,
"reset"
)
...
@@ -65,17 +70,10 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
...
@@ -65,17 +70,10 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
override
def
onResume
{
override
def
onResume
{
super
.
onResume
()
super
.
onResume
()
isProxyApps
.
setChecked
(
ShadowsocksApplication
.
settings
.
getBoolean
(
Key
.
isProxyApps
,
false
))
// update
isProxyApps
.
setChecked
(
ShadowsocksApplication
.
settings
.
getBoolean
(
Key
.
isProxyApps
,
false
))
// update
isProxyApps
.
setOnPreferenceChangeListener
((
preference
:
Preference
,
newValue
:
Any
)
=>
{
if
(
newValue
.
asInstanceOf
[
Boolean
]
==
true
)
{
startActivity
(
new
Intent
(
activity
,
classOf
[
AppManager
]))
}
true
})
}
}
override
def
onPause
{
override
def
onPause
{
super
.
onPause
()
super
.
onPause
()
isProxyApps
.
setOnPreferenceChangeListener
(
null
)
}
}
def
onSharedPreferenceChanged
(
sharedPreferences
:
SharedPreferences
,
key
:
String
)
=
key
match
{
def
onSharedPreferenceChanged
(
sharedPreferences
:
SharedPreferences
,
key
:
String
)
=
key
match
{
...
...
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