mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix hardware keyboards not being able to search in tracking
This commit is contained in:
parent
e94059a1f4
commit
a279053ac5
1 changed files with 5 additions and 2 deletions
|
@ -8,6 +8,7 @@ import android.text.Spannable
|
||||||
import android.text.SpannableString
|
import android.text.SpannableString
|
||||||
import android.text.style.StyleSpan
|
import android.text.style.StyleSpan
|
||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
|
import android.view.KeyEvent
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
@ -103,8 +104,10 @@ class TrackingBottomSheet(private val controller: MangaDetailsController) :
|
||||||
activity.openInBrowser(item.trackSearch.tracking_url)
|
activity.openInBrowser(item.trackSearch.tracking_url)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.trackSearch.setOnEditorActionListener { _, actionId, _ ->
|
binding.trackSearch.setOnEditorActionListener { _, actionId, keyEvent ->
|
||||||
if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEARCH) {
|
if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEARCH ||
|
||||||
|
keyEvent.keyCode == KeyEvent.KEYCODE_ENTER
|
||||||
|
) {
|
||||||
val text = binding.trackSearch.text?.toString() ?: ""
|
val text = binding.trackSearch.text?.toString() ?: ""
|
||||||
if (text.isNotBlank()) {
|
if (text.isNotBlank()) {
|
||||||
startTransition()
|
startTransition()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue