Fix connection test button too small
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?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 @@
|
||||
android:layout_width="wrap_content" android:layout_height="wrap_content"/>
|
||||
<TextView android:id="@+id/connection_test" android:gravity="end"
|
||||
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"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
<LinearLayout android:id="@+id/stat" android:elevation="4dp" android:visibility="gone"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
||||
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: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"/>
|
||||
<android.support.v7.widget.GridLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" app:columnCount="4">
|
||||
|
||||
@@ -6,6 +6,5 @@
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"/>
|
||||
<TextView android:id="@+id/connection_test"
|
||||
android:textSize="14sp" android:textColor="?android:attr/textColorSecondary"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -221,7 +221,7 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
|
||||
}
|
||||
|
||||
private var testCount: Int = _
|
||||
private lazy val stat = findViewById(R.id.stat)
|
||||
private var stat: View = _
|
||||
private var connectionTestText: TextView = _
|
||||
private var txText: TextView = _
|
||||
private var rxText: TextView = _
|
||||
@@ -370,13 +370,13 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
|
||||
val tf = Typefaces.get(this, "fonts/Iceland.ttf")
|
||||
if (tf != null) title.setTypeface(tf)
|
||||
|
||||
stat = findViewById(R.id.stat)
|
||||
connectionTestText = findViewById(R.id.connection_test).asInstanceOf[TextView]
|
||||
txText = findViewById(R.id.tx).asInstanceOf[TextView]
|
||||
txRateText = findViewById(R.id.txRate).asInstanceOf[TextView]
|
||||
rxText = findViewById(R.id.rx).asInstanceOf[TextView]
|
||||
rxRateText = findViewById(R.id.rxRate).asInstanceOf[TextView]
|
||||
connectionTestText.setFocusable(true)
|
||||
connectionTestText.setOnClickListener(_ => {
|
||||
stat.setOnClickListener(_ => {
|
||||
val id = synchronized {
|
||||
testCount += 1
|
||||
handler.post(() => connectionTestText.setText(R.string.connection_test_testing))
|
||||
|
||||
Reference in New Issue
Block a user