Commit 365f2e62 authored by Fynn Godau's avatar Fynn Godau Committed by Isabelle K
Browse files

Go when pressing enter in url bar

parent b3733543
......@@ -2,13 +2,10 @@ package rocks.ism.decentral.geminiclient
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.view.KeyEvent
import android.widget.Button
import android.widget.EditText
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import java.net.URI
......@@ -42,6 +39,14 @@ class MainActivity : AppCompatActivity() {
goToPage(URI.create(uriField.text.toString()))
}
uriField.setOnKeyListener { _, keyCode, event ->
if (event?.action == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_ENTER) {
goButton.callOnClick()
true
} else false
}
goToPage(URI.create(getString(R.string.default_url)))
}
......
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