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
baa2fdeb
Commit
baa2fdeb
authored
Dec 06, 2017
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine profile item layout
parent
334cd5ea
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
10 deletions
+20
-10
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
.../src/main/java/com/github/shadowsocks/ProfilesFragment.kt
+2
-2
mobile/src/main/res/layout/layout_profile.xml
mobile/src/main/res/layout/layout_profile.xml
+17
-8
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+1
-0
No files found.
mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt
View file @
baa2fdeb
...
...
@@ -157,8 +157,8 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
}
if
(
tx
<=
0
&&
rx
<=
0
)
traffic
.
visibility
=
View
.
GONE
else
{
traffic
.
visibility
=
View
.
VISIBLE
@SuppressLint
(
"SetTextI18n"
)
traffic
.
text
=
"${TrafficMonitor.formatTraffic(tx)}↑\t${TrafficMonitor.formatTraffic(rx)}↓"
traffic
.
text
=
getString
(
R
.
string
.
traffic
,
TrafficMonitor
.
formatTraffic
(
tx
),
TrafficMonitor
.
formatTraffic
(
rx
))
}
if
(
item
.
id
==
DataStore
.
profileId
)
{
...
...
mobile/src/main/res/layout/layout_profile.xml
View file @
baa2fdeb
...
...
@@ -3,6 +3,7 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -11,13 +12,16 @@
android:nextFocusRight=
"@+id/edit"
android:orientation=
"vertical"
>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"8dp"
/>
<LinearLayout
android:id=
"@+id/container"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:paddingLeft=
"16dp"
android:paddingRight=
"4dp"
>
android:layout_marginLeft=
"16dp"
>
<TextView
android:id=
"@android:id/text1"
...
...
@@ -30,7 +34,8 @@
android:maxLines=
"2"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textColor=
"?android:attr/textColorPrimary"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
tools:text=
"@string/profile_name"
/>
<android.support.v7.widget.AppCompatImageView
android:id=
"@+id/share"
...
...
@@ -59,10 +64,8 @@
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"16dp"
android:layout_marginEnd=
"8dp"
android:paddingLeft=
"16dp"
android:paddingRight=
"4dp"
>
android:layout_marginLeft=
"16dp"
>
<TextView
android:id=
"@android:id/text2"
...
...
@@ -73,6 +76,7 @@
android:layout_toStartOf=
"@+id/traffic"
android:ellipsize=
"end"
android:maxLines=
"2"
tools:text=
"@string/profile_plugin"
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:textColor=
"?android:attr/textColorSecondary"
/>
...
...
@@ -82,8 +86,13 @@
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_gravity=
"bottom"
android:layout_marginEnd=
"8dp"
android:ellipsize=
"end"
tools:text=
"@string/traffic"
android:textAppearance=
"?android:attr/textAppearanceSmall"
android:textColor=
"?android:attr/textColorSecondary"
/>
</RelativeLayout>
<Space
android:layout_width=
"match_parent"
android:layout_height=
"8dp"
/>
</LinearLayout>
mobile/src/main/res/values/strings.xml
View file @
baa2fdeb
...
...
@@ -17,6 +17,7 @@
<string
name=
"port_transproxy"
>
Transproxy port
</string>
<string
name=
"remote_dns"
>
Remote DNS
</string>
<string
name=
"traffic"
translatable=
"false"
>
%s↑\t%s↓
</string>
<string
name=
"stat_summary"
>
Sent: \t\t\t\t\t%3$s\t↑\t%1$s/s\nReceived: \t%4$s\t↓\t%2$s/s
</string>
<string
name=
"speed"
>
%s/s
</string>
<plurals
name=
"bytes"
>
...
...
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