Commit 3f201eb2 authored by Mygod's avatar Mygod

Fix connection test button too small

parent 71b1d5fe
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:colorControlHighlight">
<item>
<color android:color="@color/material_accent_300"/>
</item>
</ripple>
<?xml version="1.0" encoding="utf-8"?>
<color xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/material_accent_300"/>
...@@ -6,6 +6,5 @@ ...@@ -6,6 +6,5 @@
android:layout_width="wrap_content" android:layout_height="wrap_content"/> android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<TextView android:id="@+id/connection_test" android:gravity="end" <TextView android:id="@+id/connection_test" android:gravity="end"
android:textSize="14sp" android:textColor="?android:attr/textColorSecondary" android:textSize="14sp" android:textColor="?android:attr/textColorSecondary"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1"/> android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1"/>
</LinearLayout> </LinearLayout>
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
<LinearLayout android:id="@+id/stat" android:elevation="4dp" android:visibility="gone" <LinearLayout android:id="@+id/stat" android:elevation="4dp" android:visibility="gone"
android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight" android:gravity="center_vertical" android:minHeight="?android:attr/listPreferredItemHeight" android:gravity="center_vertical"
android:paddingStart="16dip" android:paddingEnd="88dip" android:paddingStart="16dip" android:paddingEnd="88dip" android:focusable="true"
android:paddingLeft="16dip" android:paddingRight="88dip" android:paddingLeft="16dip" android:paddingRight="88dip"
android:paddingTop="16dip" android:paddingBottom="16dip" android:paddingTop="16dip" android:paddingBottom="16dip"
android:background="@color/material_accent_300" android:orientation="vertical"> android:background="@drawable/background_stat" android:orientation="vertical">
<include layout="@layout/layout_main_stat_title"/> <include layout="@layout/layout_main_stat_title"/>
<android.support.v7.widget.GridLayout android:layout_width="match_parent" <android.support.v7.widget.GridLayout android:layout_width="match_parent"
android:layout_height="wrap_content" app:columnCount="4"> android:layout_height="wrap_content" app:columnCount="4">
......
...@@ -6,6 +6,5 @@ ...@@ -6,6 +6,5 @@
android:layout_width="match_parent" android:layout_height="wrap_content"/> android:layout_width="match_parent" android:layout_height="wrap_content"/>
<TextView android:id="@+id/connection_test" <TextView android:id="@+id/connection_test"
android:textSize="14sp" android:textColor="?android:attr/textColorSecondary" android:textSize="14sp" android:textColor="?android:attr/textColorSecondary"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_width="match_parent" android:layout_height="wrap_content"/> android:layout_width="match_parent" android:layout_height="wrap_content"/>
</LinearLayout> </LinearLayout>
...@@ -221,7 +221,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext { ...@@ -221,7 +221,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
} }
private var testCount: Int = _ private var testCount: Int = _
private lazy val stat = findViewById(R.id.stat) private var stat: View = _
private var connectionTestText: TextView = _ private var connectionTestText: TextView = _
private var txText: TextView = _ private var txText: TextView = _
private var rxText: TextView = _ private var rxText: TextView = _
...@@ -370,13 +370,13 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext { ...@@ -370,13 +370,13 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
val tf = Typefaces.get(this, "fonts/Iceland.ttf") val tf = Typefaces.get(this, "fonts/Iceland.ttf")
if (tf != null) title.setTypeface(tf) if (tf != null) title.setTypeface(tf)
stat = findViewById(R.id.stat)
connectionTestText = findViewById(R.id.connection_test).asInstanceOf[TextView] connectionTestText = findViewById(R.id.connection_test).asInstanceOf[TextView]
txText = findViewById(R.id.tx).asInstanceOf[TextView] txText = findViewById(R.id.tx).asInstanceOf[TextView]
txRateText = findViewById(R.id.txRate).asInstanceOf[TextView] txRateText = findViewById(R.id.txRate).asInstanceOf[TextView]
rxText = findViewById(R.id.rx).asInstanceOf[TextView] rxText = findViewById(R.id.rx).asInstanceOf[TextView]
rxRateText = findViewById(R.id.rxRate).asInstanceOf[TextView] rxRateText = findViewById(R.id.rxRate).asInstanceOf[TextView]
connectionTestText.setFocusable(true) stat.setOnClickListener(_ => {
connectionTestText.setOnClickListener(_ => {
val id = synchronized { val id = synchronized {
testCount += 1 testCount += 1
handler.post(() => connectionTestText.setText(R.string.connection_test_testing)) handler.post(() => connectionTestText.setText(R.string.connection_test_testing))
......
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