优化
This commit is contained in:
@@ -3,6 +3,8 @@ package io.legado.app.ui.book.searchContent
|
|||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.MotionEvent
|
||||||
|
import android.widget.EditText
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
import io.legado.app.R
|
import io.legado.app.R
|
||||||
@@ -71,6 +73,18 @@ class SearchContentActivity :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
|
||||||
|
if (ev.action == MotionEvent.ACTION_DOWN) {
|
||||||
|
currentFocus?.let {
|
||||||
|
if (it is EditText) {
|
||||||
|
it.clearFocus()
|
||||||
|
it.hideSoftInput()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.dispatchTouchEvent(ev)
|
||||||
|
}
|
||||||
|
|
||||||
private fun initSearchView(clearFocus: Boolean) {
|
private fun initSearchView(clearFocus: Boolean) {
|
||||||
searchView.applyTint(primaryTextColor)
|
searchView.applyTint(primaryTextColor)
|
||||||
searchView.onActionViewExpanded()
|
searchView.onActionViewExpanded()
|
||||||
|
|||||||
Reference in New Issue
Block a user