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
432ab6cc
Commit
432ab6cc
authored
Jul 04, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the bug where UI is not updated after importing
parent
31ed8480
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
src/main/scala/com/github/shadowsocks/AppManager.scala
src/main/scala/com/github/shadowsocks/AppManager.scala
+7
-5
No files found.
src/main/scala/com/github/shadowsocks/AppManager.scala
View file @
432ab6cc
...
...
@@ -84,7 +84,7 @@ object AppManager {
synchronized
{
if
(
cachedApps
==
null
)
cachedApps
=
pm
.
getInstalledPackages
(
PackageManager
.
GET_PERMISSIONS
)
.
filter
(
p
=>
p
.
requestedPermissions
!=
null
&&
p
.
requestedPermissions
.
contains
(
permission
.
INTERNET
))
.
map
(
p
=>
new
ProxiedApp
(
pm
.
getApplicationLabel
(
p
.
applicationInfo
).
toString
,
p
.
packageName
,
.
map
(
p
=>
ProxiedApp
(
pm
.
getApplicationLabel
(
p
.
applicationInfo
).
toString
,
p
.
packageName
,
p
.
applicationInfo
.
loadIcon
(
pm
))).
toArray
cachedApps
}
...
...
@@ -136,10 +136,11 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
private
var
proxiedApps
:
mutable.HashSet
[
String
]
=
_
private
var
toolbar
:
Toolbar
=
_
private
var
bypassSwitch
:
Switch
=
_
private
var
appListView
:
RecyclerView
=
_
private
var
loadingView
:
View
=
_
private
val
appsLoading
=
new
AtomicBoolean
private
var
handler
:
Handler
=
null
private
var
handler
:
Handler
=
_
private
def
initProxiedApps
(
str
:
String
=
app
.
settings
.
getString
(
Key
.
proxied
,
""
))
=
proxiedApps
=
str
.
split
(
'\n'
).
to
[
mutable.HashSet
]
...
...
@@ -187,7 +188,8 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
try
{
val
(
enabled
,
apps
)
=
if
(
i
<
0
)
(
proxiedAppString
,
""
)
else
(
proxiedAppString
.
substring
(
0
,
i
),
proxiedAppString
.
substring
(
i
+
1
))
editor
.
putBoolean
(
Key
.
isBypassApps
,
enabled
.
toBoolean
).
putString
(
Key
.
proxied
,
apps
).
apply
()
bypassSwitch
.
setChecked
(
enabled
.
toBoolean
)
editor
.
putString
(
Key
.
proxied
,
apps
).
apply
()
Toast
.
makeText
(
this
,
R
.
string
.
action_import_msg
,
Toast
.
LENGTH_SHORT
).
show
()
appListView
.
setVisibility
(
View
.
GONE
)
loadingView
.
setVisibility
(
View
.
VISIBLE
)
...
...
@@ -230,10 +232,10 @@ class AppManager extends AppCompatActivity with OnMenuItemClickListener {
finish
()
})
val
bypassSwitch
=
findViewById
(
R
.
id
.
bypassSwitch
).
asInstanceOf
[
Switch
]
bypassSwitch
=
findViewById
(
R
.
id
.
bypassSwitch
).
asInstanceOf
[
Switch
]
bypassSwitch
.
setChecked
(
app
.
settings
.
getBoolean
(
Key
.
isBypassApps
,
false
))
bypassSwitch
.
setOnCheckedChangeListener
((
_
,
checked
)
=>
app
.
editor
.
putBoolean
(
Key
.
isBypassApps
,
checked
).
apply
())
bypassSwitch
.
setChecked
(
app
.
settings
.
getBoolean
(
Key
.
isBypassApps
,
false
))
initProxiedApps
()
loadingView
=
findViewById
(
R
.
id
.
loading
)
...
...
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