Fix connection test button too small

This commit is contained in:
Mygod
2016-06-09 21:16:02 +08:00
parent 71b1d5fef1
commit 3f201eb29b
6 changed files with 13 additions and 7 deletions
@@ -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))