Commit 7a13bfd9 authored by Waweic's avatar Waweic 💬
Browse files

Merge branch 'patch-1' into 'master'

Merge Uri bar improvements from other PR

Closes #2

See merge request !4
parents ac09f06a 2525b1fb
Pipeline #290570 passed with stages
in 11 minutes and 26 seconds
package rocks.ism.decentral.geminiclient
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.KeyEvent
import android.view.inputmethod.InputMethodManager
import android.widget.Button
import android.widget.EditText
import android.widget.TextView
......@@ -37,7 +40,22 @@ class MainActivity : AppCompatActivity() {
// Create handlers
goButton.setOnClickListener {
geminiClient.goToPage(uriField.text.toString())
// Hide keyboard
uriField.clearFocus()
val inputService = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
inputService.hideSoftInputFromWindow(uriField.windowToken, 0)
}
uriField.setOnKeyListener { _, keyCode, event ->
if (event?.action == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_ENTER) {
goButton.callOnClick()
true
} else false
}
backButton.setOnClickListener {
geminiClient.goBack()
}
......
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