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
...
@@ -185,6 +185,7 @@ class Shadowsocks
// Variables
// Variables
var
switchButton
:
Switch
=
null
var
switchButton
:
Switch
=
null
var
progressDialog
:
ProgressDialog
=
null
var
progressDialog
:
ProgressDialog
=
null
var
progressTag
=
-
1
var
state
=
State
.
INIT
var
state
=
State
.
INIT
var
prepared
=
false
var
prepared
=
false
var
currentProfile
=
new
Profile
var
currentProfile
=
new
Profile
...
@@ -271,9 +272,10 @@ class Shadowsocks
...
@@ -271,9 +272,10 @@ class Shadowsocks
switchButton
.
setOnCheckedChangeListener
(
this
)
switchButton
.
setOnCheckedChangeListener
(
this
)
}
}
private
def
showProgress
(
msg
:
String
)
:
Handler
=
{
private
def
showProgress
(
msg
:
Int
)
:
Handler
=
{
clearDialog
()
clearDialog
()
progressDialog
=
ProgressDialog
.
show
(
this
,
""
,
msg
,
true
,
false
)
progressDialog
=
ProgressDialog
.
show
(
this
,
""
,
getString
(
msg
),
true
,
false
)
progressTag
=
msg
new
Handler
{
new
Handler
{
override
def
handleMessage
(
msg
:
Message
)
{
override
def
handleMessage
(
msg
:
Message
)
{
clearDialog
()
clearDialog
()
...
@@ -397,7 +399,7 @@ class Shadowsocks
...
@@ -397,7 +399,7 @@ class Shadowsocks
}
}
def
prepareStartService
()
{
def
prepareStartService
()
{
showProgress
(
getString
(
R
.
string
.
connecting
)
)
showProgress
(
R
.
string
.
connecting
)
spawn
{
spawn
{
if
(!
status
.
getBoolean
(
getVersionName
,
false
))
{
if
(!
status
.
getBoolean
(
getVersionName
,
false
))
{
status
.
edit
.
putBoolean
(
getVersionName
,
true
).
commit
()
status
.
edit
.
putBoolean
(
getVersionName
,
true
).
commit
()
...
@@ -616,7 +618,7 @@ class Shadowsocks
...
@@ -616,7 +618,7 @@ class Shadowsocks
which
match
{
which
match
{
case
0
=>
case
0
=>
dialog
.
dismiss
()
dialog
.
dismiss
()
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
h
.
postDelayed
(
new
Runnable
()
{
h
.
postDelayed
(
new
Runnable
()
{
def
run
()
{
def
run
()
{
val
integrator
=
new
IntentIntegrator
(
Shadowsocks
.
this
)
val
integrator
=
new
IntentIntegrator
(
Shadowsocks
.
this
)
...
@@ -640,7 +642,7 @@ class Shadowsocks
...
@@ -640,7 +642,7 @@ class Shadowsocks
def
reloadProfile
()
{
def
reloadProfile
()
{
drawer
.
closeMenu
(
true
)
drawer
.
closeMenu
(
true
)
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
handler
.
postDelayed
(
new
Runnable
{
handler
.
postDelayed
(
new
Runnable
{
def
run
()
{
def
run
()
{
...
@@ -659,7 +661,7 @@ class Shadowsocks
...
@@ -659,7 +661,7 @@ class Shadowsocks
def
addProfile
(
profile
:
Profile
)
{
def
addProfile
(
profile
:
Profile
)
{
drawer
.
closeMenu
(
true
)
drawer
.
closeMenu
(
true
)
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
handler
.
postDelayed
(
new
Runnable
{
handler
.
postDelayed
(
new
Runnable
{
def
run
()
{
def
run
()
{
...
@@ -678,7 +680,7 @@ class Shadowsocks
...
@@ -678,7 +680,7 @@ class Shadowsocks
def
addProfile
(
id
:
Int
)
{
def
addProfile
(
id
:
Int
)
{
drawer
.
closeMenu
(
true
)
drawer
.
closeMenu
(
true
)
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
handler
.
postDelayed
(
new
Runnable
{
handler
.
postDelayed
(
new
Runnable
{
def
run
()
{
def
run
()
{
...
@@ -696,7 +698,7 @@ class Shadowsocks
...
@@ -696,7 +698,7 @@ class Shadowsocks
def
updateProfile
(
id
:
Int
)
{
def
updateProfile
(
id
:
Int
)
{
drawer
.
closeMenu
(
true
)
drawer
.
closeMenu
(
true
)
val
h
=
showProgress
(
getString
(
R
.
string
.
loading
)
)
val
h
=
showProgress
(
R
.
string
.
loading
)
handler
.
postDelayed
(
new
Runnable
{
handler
.
postDelayed
(
new
Runnable
{
def
run
()
{
def
run
()
{
...
@@ -933,15 +935,11 @@ class Shadowsocks
...
@@ -933,15 +935,11 @@ class Shadowsocks
}
}
private
def
recovery
()
{
private
def
recovery
()
{
val
h
=
showProgress
(
getString
(
R
.
string
.
recovering
))
serviceStop
()
val
h
=
showProgress
(
R
.
string
.
recovering
)
spawn
{
spawn
{
reset
()
reset
()
handler
.
post
(
new
Runnable
{
h
.
sendEmptyMessage
(
0
)
override
def
run
()
{
serviceStop
h
.
sendEmptyMessage
(
0
)
}
})
}
}
}
}
...
@@ -971,7 +969,7 @@ class Shadowsocks
...
@@ -971,7 +969,7 @@ class Shadowsocks
}
}
private
def
flushDnsCache
()
{
private
def
flushDnsCache
()
{
val
h
=
showProgress
(
getString
(
R
.
string
.
flushing
)
)
val
h
=
showProgress
(
R
.
string
.
flushing
)
spawn
{
spawn
{
Utils
.
toggleAirplaneMode
(
getBaseContext
)
Utils
.
toggleAirplaneMode
(
getBaseContext
)
h
.
sendEmptyMessage
(
0
)
h
.
sendEmptyMessage
(
0
)
...
@@ -1089,6 +1087,7 @@ class Shadowsocks
...
@@ -1089,6 +1087,7 @@ class Shadowsocks
if
(
progressDialog
!=
null
)
{
if
(
progressDialog
!=
null
)
{
progressDialog
.
dismiss
()
progressDialog
.
dismiss
()
progressDialog
=
null
progressDialog
=
null
progressTag
=
-
1
}
}
}
}
...
@@ -1102,14 +1101,19 @@ class Shadowsocks
...
@@ -1102,14 +1101,19 @@ class Shadowsocks
if
(
progressDialog
==
null
)
{
if
(
progressDialog
==
null
)
{
progressDialog
=
ProgressDialog
progressDialog
=
ProgressDialog
.
show
(
Shadowsocks
.
this
,
""
,
getString
(
R
.
string
.
connecting
),
true
,
true
)
.
show
(
Shadowsocks
.
this
,
""
,
getString
(
R
.
string
.
connecting
),
true
,
true
)
progressTag
=
R
.
string
.
connecting
}
}
setPreferenceEnabled
(
enabled
=
false
)
setPreferenceEnabled
(
enabled
=
false
)
case
State
.
CONNECTED
=>
case
State
.
CONNECTED
=>
clearDialog
()
if
(
progressTag
==
R
.
string
.
connecting
)
{
clearDialog
()
}
changeSwitch
(
checked
=
true
)
changeSwitch
(
checked
=
true
)
setPreferenceEnabled
(
enabled
=
false
)
setPreferenceEnabled
(
enabled
=
false
)
case
State
.
STOPPED
=>
case
State
.
STOPPED
=>
clearDialog
()
if
(
progressTag
==
R
.
string
.
stopping
)
{
clearDialog
()
}
changeSwitch
(
checked
=
false
)
changeSwitch
(
checked
=
false
)
if
(
m
!=
null
)
{
if
(
m
!=
null
)
{
new
SnackBar
.
Builder
(
Shadowsocks
.
this
)
new
SnackBar
.
Builder
(
Shadowsocks
.
this
)
...
@@ -1124,6 +1128,7 @@ class Shadowsocks
...
@@ -1124,6 +1128,7 @@ class Shadowsocks
if
(
progressDialog
==
null
)
{
if
(
progressDialog
==
null
)
{
progressDialog
=
ProgressDialog
progressDialog
=
ProgressDialog
.
show
(
Shadowsocks
.
this
,
""
,
getString
(
R
.
string
.
stopping
),
true
,
true
)
.
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