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
10ebf884
Commit
10ebf884
authored
Dec 15, 2015
by
Mygod
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of shadowsocks/shadowsocks-android
parents
62a572ee
e82c7ccb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/main/scala/com/github/shadowsocks/AppManager.scala
src/main/scala/com/github/shadowsocks/AppManager.scala
+1
-0
src/main/scala/com/github/shadowsocks/ShadowsocksSettings.scala
...in/scala/com/github/shadowsocks/ShadowsocksSettings.scala
+5
-6
No files found.
src/main/scala/com/github/shadowsocks/AppManager.scala
View file @
10ebf884
...
@@ -221,6 +221,7 @@ class AppManager extends AppCompatActivity with OnCheckedChangeListener with OnC
...
@@ -221,6 +221,7 @@ 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
))
ShadowsocksApplication
.
settings
.
edit
().
putBoolean
(
Key
.
isProxyApps
,
true
).
commit
()
findViewById
(
R
.
id
.
onSwitch
).
asInstanceOf
[
Switch
]
findViewById
(
R
.
id
.
onSwitch
).
asInstanceOf
[
Switch
]
.
setOnCheckedChangeListener
((
button
:
CompoundButton
,
checked
:
Boolean
)
=>
{
.
setOnCheckedChangeListener
((
button
:
CompoundButton
,
checked
:
Boolean
)
=>
{
ShadowsocksApplication
.
settings
.
edit
().
putBoolean
(
Key
.
isProxyApps
,
checked
).
commit
()
ShadowsocksApplication
.
settings
.
edit
().
putBoolean
(
Key
.
isProxyApps
,
checked
).
commit
()
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksSettings.scala
View file @
10ebf884
package
com.github.shadowsocks
package
com.github.shadowsocks
import
java.lang.System.currentTimeMillis
import
java.lang.System.currentTimeMillis
import
java.lang.
{
Long
=>
jLong
}
import
java.net.
{
HttpURLConnection
,
URL
}
import
java.net.
{
HttpURLConnection
,
URL
}
import
java.util.Locale
import
java.util.Locale
...
@@ -67,6 +66,11 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
...
@@ -67,6 +66,11 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
})
})
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"
)
...
@@ -108,15 +112,10 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
...
@@ -108,15 +112,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
)
=>
{
startActivity
(
new
Intent
(
activity
,
classOf
[
AppManager
]))
newValue
.
asInstanceOf
[
Boolean
]
// keep it ON
})
}
}
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