Commit baa2fdeb authored by Mygod's avatar Mygod

Refine profile item layout

parent 334cd5ea
...@@ -157,8 +157,8 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener { ...@@ -157,8 +157,8 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
} }
if (tx <= 0 && rx <= 0) traffic.visibility = View.GONE else { if (tx <= 0 && rx <= 0) traffic.visibility = View.GONE else {
traffic.visibility = View.VISIBLE traffic.visibility = View.VISIBLE
@SuppressLint("SetTextI18n") traffic.text = getString(R.string.traffic,
traffic.text = "${TrafficMonitor.formatTraffic(tx)}↑\t${TrafficMonitor.formatTraffic(rx)}↓" TrafficMonitor.formatTraffic(tx), TrafficMonitor.formatTraffic(rx))
} }
if (item.id == DataStore.profileId) { if (item.id == DataStore.profileId) {
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content" android:id="@+id/content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -11,13 +12,16 @@ ...@@ -11,13 +12,16 @@
android:nextFocusRight="@+id/edit" android:nextFocusRight="@+id/edit"
android:orientation="vertical"> android:orientation="vertical">
<Space
android:layout_width="match_parent"
android:layout_height="8dp"/>
<LinearLayout <LinearLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginLeft="16dp"
android:paddingLeft="16dp" >
android:paddingRight="4dp">
<TextView <TextView
android:id="@android:id/text1" android:id="@android:id/text1"
...@@ -30,7 +34,8 @@ ...@@ -30,7 +34,8 @@
android:maxLines="2" android:maxLines="2"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"/> android:textStyle="bold"
tools:text="@string/profile_name"/>
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
android:id="@+id/share" android:id="@+id/share"
...@@ -59,10 +64,8 @@ ...@@ -59,10 +64,8 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_marginLeft="16dp"
android:layout_marginEnd="8dp" >
android:paddingLeft="16dp"
android:paddingRight="4dp">
<TextView <TextView
android:id="@android:id/text2" android:id="@android:id/text2"
...@@ -73,6 +76,7 @@ ...@@ -73,6 +76,7 @@
android:layout_toStartOf="@+id/traffic" android:layout_toStartOf="@+id/traffic"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
tools:text="@string/profile_plugin"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"/> android:textColor="?android:attr/textColorSecondary"/>
...@@ -82,8 +86,13 @@ ...@@ -82,8 +86,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginEnd="8dp"
android:ellipsize="end" android:ellipsize="end"
tools:text="@string/traffic"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"/> android:textColor="?android:attr/textColorSecondary"/>
</RelativeLayout> </RelativeLayout>
<Space
android:layout_width="match_parent"
android:layout_height="8dp"/>
</LinearLayout> </LinearLayout>
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
<string name="port_transproxy">Transproxy port</string> <string name="port_transproxy">Transproxy port</string>
<string name="remote_dns">Remote DNS</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="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> <string name="speed">%s/s</string>
<plurals name="bytes"> <plurals name="bytes">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment