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
19e93966
Commit
19e93966
authored
Jun 07, 2013
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update stat
parent
4eca51de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
src/main/res/values/strings.xml
src/main/res/values/strings.xml
+1
-1
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
...ain/scala/com/github/shadowsocks/ShadowsocksService.scala
+4
-5
No files found.
src/main/res/values/strings.xml
View file @
19e93966
...
...
@@ -44,7 +44,7 @@
<!-- notification category -->
<string
name=
"forward_success"
>
Shadowsocks started.
</string>
<string
name=
"service_running"
>
Running in the background.
</string>
<string
name=
"service_status"
formatted=
"false"
>
TX Rate: %d KB/s, RX Rate
: %d KB/s
</string>
<string
name=
"service_status"
formatted=
"false"
>
Upload: %d KB/s, Download
: %d KB/s
</string>
<string
name=
"forward_fail"
>
Shadowsocks failed to start.
</string>
<string
name=
"service_stopped"
>
Shadowsocks stopped.
</string>
<string
name=
"forward_stop"
>
Shadowsocks stopped.
</string>
...
...
src/main/scala/com/github/shadowsocks/ShadowsocksService.scala
View file @
19e93966
...
...
@@ -310,11 +310,10 @@ class ShadowsocksService extends Service {
val
icon
=
getResources
.
getDrawable
(
R
.
drawable
.
ic_stat_shadowsocks
)
if
(
rate
>=
0
)
{
val
bitmap
=
Bitmap
.
createBitmap
(
icon
.
getIntrinsicWidth
*
2
,
icon
.
getIntrinsicHeight
*
2
,
Bitmap
.
Config
.
ARGB_8888
)
val
bitmap
=
Bitmap
.
createBitmap
(
icon
.
getIntrinsicWidth
*
4
,
icon
.
getIntrinsicHeight
*
4
,
Bitmap
.
Config
.
ARGB_8888
)
val
r
=
rate
.
toString
val
padding
=
bitmap
.
getHeight
/
4
val
size
=
bitmap
.
getHeight
/
2
val
size
=
bitmap
.
getHeight
/
3
val
canvas
=
new
Canvas
(
bitmap
)
val
paint
=
new
Paint
()
paint
.
setColor
(
Color
.
WHITE
)
...
...
@@ -322,7 +321,7 @@ class ShadowsocksService extends Service {
val
bounds
=
new
Rect
()
paint
.
getTextBounds
(
r
,
0
,
r
.
length
,
bounds
)
canvas
.
drawText
(
r
,
(
bitmap
.
getWidth
-
bounds
.
width
())
/
2
,
bitmap
.
getHeight
-
padding
,
paint
)
bitmap
.
getHeight
-
(
bitmap
.
getHeight
-
bounds
.
height
())
/
2
,
paint
)
builder
.
setLargeIcon
(
bitmap
)
if
(
rate
<
1000
)
{
...
...
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