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
07798c7e
Commit
07798c7e
authored
Jun 05, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix imported per-app proxy settings not updating UI
parent
8c3b4cc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
src/main/scala/com/github/shadowsocks/AppManager.scala
src/main/scala/com/github/shadowsocks/AppManager.scala
+9
-6
No files found.
src/main/scala/com/github/shadowsocks/AppManager.scala
View file @
07798c7e
...
@@ -134,13 +134,16 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
...
@@ -134,13 +134,16 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
new
AppViewHolder
(
LayoutInflater
.
from
(
vg
.
getContext
).
inflate
(
R
.
layout
.
layout_apps_item
,
vg
,
false
))
new
AppViewHolder
(
LayoutInflater
.
from
(
vg
.
getContext
).
inflate
(
R
.
layout
.
layout_apps_item
,
vg
,
false
))
}
}
private
va
l
proxiedApps
=
app
.
settings
.
getString
(
Key
.
proxied
,
""
).
split
(
'\n'
).
to
[
mutable.HashSet
]
private
va
r
proxiedApps
:
mutable.HashSet
[
String
]
=
_
private
var
toolbar
:
Toolbar
=
_
private
var
toolbar
:
Toolbar
=
_
private
var
appListView
:
RecyclerView
=
_
private
var
appListView
:
RecyclerView
=
_
private
var
loadingView
:
View
=
_
private
var
loadingView
:
View
=
_
private
val
appsLoading
=
new
AtomicBoolean
private
val
appsLoading
=
new
AtomicBoolean
private
var
handler
:
Handler
=
null
private
var
handler
:
Handler
=
null
private
def
initProxiedApps
(
str
:
String
=
app
.
settings
.
getString
(
Key
.
proxied
,
""
))
=
proxiedApps
=
str
.
split
(
'\n'
).
to
[
mutable.HashSet
]
override
def
onDestroy
()
{
override
def
onDestroy
()
{
instance
=
null
instance
=
null
super
.
onDestroy
()
super
.
onDestroy
()
...
@@ -170,14 +173,13 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
...
@@ -170,14 +173,13 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
val
editor
=
prefs
.
edit
val
editor
=
prefs
.
edit
val
i
=
proxiedAppString
.
indexOf
(
'\n'
)
val
i
=
proxiedAppString
.
indexOf
(
'\n'
)
try
{
try
{
if
(
i
<
0
)
val
(
enabled
,
apps
)
=
if
(
i
<
0
)
(
proxiedAppString
,
""
)
editor
.
putBoolean
(
Key
.
isBypassApps
,
proxiedAppString
.
toBoolean
).
putString
(
Key
.
proxied
,
""
).
apply
()
else
(
proxiedAppString
.
substring
(
0
,
i
),
proxiedAppString
.
substring
(
i
+
1
))
else
editor
.
putBoolean
(
Key
.
isBypassApps
,
proxiedAppString
.
substring
(
0
,
i
).
toBoolean
)
editor
.
putBoolean
(
Key
.
isBypassApps
,
enabled
.
toBoolean
).
putString
(
Key
.
proxied
,
apps
).
apply
()
.
putString
(
Key
.
proxied
,
proxiedAppString
.
substring
(
i
+
1
)).
apply
()
Toast
.
makeText
(
this
,
R
.
string
.
action_import_msg
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
this
,
R
.
string
.
action_import_msg
,
Toast
.
LENGTH_SHORT
).
show
()
// Restart activity
appListView
.
setVisibility
(
View
.
GONE
)
appListView
.
setVisibility
(
View
.
GONE
)
loadingView
.
setVisibility
(
View
.
VISIBLE
)
loadingView
.
setVisibility
(
View
.
VISIBLE
)
initProxiedApps
(
apps
)
reloadApps
()
reloadApps
()
return
true
return
true
}
catch
{
}
catch
{
...
@@ -221,6 +223,7 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
...
@@ -221,6 +223,7 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
app
.
editor
.
putBoolean
(
Key
.
isBypassApps
,
checked
).
apply
())
app
.
editor
.
putBoolean
(
Key
.
isBypassApps
,
checked
).
apply
())
bypassSwitch
.
setChecked
(
app
.
settings
.
getBoolean
(
Key
.
isBypassApps
,
false
))
bypassSwitch
.
setChecked
(
app
.
settings
.
getBoolean
(
Key
.
isBypassApps
,
false
))
initProxiedApps
()
loadingView
=
findViewById
(
R
.
id
.
loading
)
loadingView
=
findViewById
(
R
.
id
.
loading
)
appListView
=
findViewById
(
R
.
id
.
applistview
).
asInstanceOf
[
RecyclerView
]
appListView
=
findViewById
(
R
.
id
.
applistview
).
asInstanceOf
[
RecyclerView
]
appListView
.
setLayoutManager
(
new
LinearLayoutManager
(
this
))
appListView
.
setLayoutManager
(
new
LinearLayoutManager
(
this
))
...
...
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