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
9613d653
Commit
9613d653
authored
Aug 02, 2015
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a issue of progress dialog
parent
a510b111
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
+24
-19
src/main/jni/shadowsocks-libev
src/main/jni/shadowsocks-libev
+1
-1
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+23
-18
No files found.
shadowsocks-libev
@
91730267
Subproject commit
7260153439e5ec264b8eb5f7364bd2c73fdb0e39
Subproject commit
91730267dd23975ca3b3a05417e89df4865b6f88
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
9613d653
...
...
@@ -185,6 +185,7 @@ class Shadowsocks
// Variables
var
switchButton
:
Switch
=
null
var
progressDialog
:
ProgressDialog
=
null
var
progressTag
=
-
1
var
state
=
State
.
INIT
var
prepared
=
false
var
currentProfile
=
new
Profile
...
...
@@ -271,9 +272,10 @@ class Shadowsocks
switchButton
.
setOnCheckedChangeListener
(
this
)
}
private
def
showProgress
(
msg
:
String
)
:
Handler
=
{
private
def
showProgress
(
msg
:
Int
)
:
Handler
=
{
clearDialog
()
progressDialog
=
ProgressDialog
.
show
(
this
,
""
,
msg
,
true
,
false
)
progressDialog
=
ProgressDialog
.
show
(
this
,
""
,
getString
(
msg
),
true
,
false
)
progressTag
=
msg
new
Handler
{
override
def
handleMessage
(
msg
:
Message
)
{
clearDialog
()
...
...
@@ -397,7 +399,7 @@ class Shadowsocks
}
def
prepareStartService
()
{
showProgress
(
getString
(
R
.
string
.
connecting
)
)
showProgress
(
R
.
string
.
connecting
)
spawn
{
if
(!
status
.
getBoolean
(
getVersionName
,
false
))
{
status
.
edit
.
putBoolean
(
getVersionName
,
true
).
commit
()
...
...
@@ -616,7 +618,7 @@ class Shadowsocks
which
match
{
case
0
=>
dialog
.
dismiss
()
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
h
.
postDelayed
(
new
Runnable
()
{
def
run
()
{
val
integrator
=
new
IntentIntegrator
(
Shadowsocks
.
this
)
...
...
@@ -640,7 +642,7 @@ class Shadowsocks
def
reloadProfile
()
{
drawer
.
closeMenu
(
true
)
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
handler
.
postDelayed
(
new
Runnable
{
def
run
()
{
...
...
@@ -659,7 +661,7 @@ class Shadowsocks
def
addProfile
(
profile
:
Profile
)
{
drawer
.
closeMenu
(
true
)
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
handler
.
postDelayed
(
new
Runnable
{
def
run
()
{
...
...
@@ -678,7 +680,7 @@ class Shadowsocks
def
addProfile
(
id
:
Int
)
{
drawer
.
closeMenu
(
true
)
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
handler
.
postDelayed
(
new
Runnable
{
def
run
()
{
...
...
@@ -696,7 +698,7 @@ class Shadowsocks
def
updateProfile
(
id
:
Int
)
{
drawer
.
closeMenu
(
true
)
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
handler
.
postDelayed
(
new
Runnable
{
def
run
()
{
...
...
@@ -933,15 +935,11 @@ class Shadowsocks
}
private
def
recovery
()
{
val
h
=
showProgress
(
getString
(
R
.
string
.
recovering
))
serviceStop
()
val
h
=
showProgress
(
R
.
string
.
recovering
)
spawn
{
reset
()
handler
.
post
(
new
Runnable
{
override
def
run
()
{
serviceStop
h
.
sendEmptyMessage
(
0
)
}
})
h
.
sendEmptyMessage
(
0
)
}
}
...
...
@@ -971,7 +969,7 @@ class Shadowsocks
}
private
def
flushDnsCache
()
{
val
h
=
showProgress
(
getString
(
R
.
string
.
flushing
)
)
val
h
=
showProgress
(
R
.
string
.
flushing
)
spawn
{
Utils
.
toggleAirplaneMode
(
getBaseContext
)
h
.
sendEmptyMessage
(
0
)
...
...
@@ -1089,6 +1087,7 @@ class Shadowsocks
if
(
progressDialog
!=
null
)
{
progressDialog
.
dismiss
()
progressDialog
=
null
progressTag
=
-
1
}
}
...
...
@@ -1102,14 +1101,19 @@ class Shadowsocks
if
(
progressDialog
==
null
)
{
progressDialog
=
ProgressDialog
.
show
(
Shadowsocks
.
this
,
""
,
getString
(
R
.
string
.
connecting
),
true
,
true
)
progressTag
=
R
.
string
.
connecting
}
setPreferenceEnabled
(
enabled
=
false
)
case
State
.
CONNECTED
=>
clearDialog
()
if
(
progressTag
==
R
.
string
.
connecting
)
{
clearDialog
()
}
changeSwitch
(
checked
=
true
)
setPreferenceEnabled
(
enabled
=
false
)
case
State
.
STOPPED
=>
clearDialog
()
if
(
progressTag
==
R
.
string
.
stopping
)
{
clearDialog
()
}
changeSwitch
(
checked
=
false
)
if
(
m
!=
null
)
{
new
SnackBar
.
Builder
(
Shadowsocks
.
this
)
...
...
@@ -1124,6 +1128,7 @@ class Shadowsocks
if
(
progressDialog
==
null
)
{
progressDialog
=
ProgressDialog
.
show
(
Shadowsocks
.
this
,
""
,
getString
(
R
.
string
.
stopping
),
true
,
true
)
progressTag
=
R
.
string
.
stopping
}
}
}
...
...
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