Horis 2 лет назад
Родитель
Сommit
ea54542dbf

+ 1 - 4
app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt

@@ -93,12 +93,9 @@ class ExploreFragment() : VMBaseFragment<ExploreViewModel>(R.layout.fragment_exp
 
     private fun initSearchView() {
         searchView.applyTint(primaryTextColor)
-        searchView.onActionViewExpanded()
+        searchView.setIconifiedByDefault(false)
         searchView.isSubmitButtonEnabled = true
         searchView.queryHint = getString(R.string.screen_find)
-        searchView.post {
-            searchView.clearFocus()
-        }
         searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
             override fun onQueryTextSubmit(query: String?): Boolean {
                 return false

+ 1 - 5
app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt

@@ -36,7 +36,6 @@ import io.legado.app.utils.startActivity
 import io.legado.app.utils.viewbindingdelegate.viewBinding
 import kotlinx.coroutines.Dispatchers.IO
 import kotlinx.coroutines.Job
-import kotlinx.coroutines.delay
 import kotlinx.coroutines.flow.catch
 import kotlinx.coroutines.flow.conflate
 import kotlinx.coroutines.flow.flowOn
@@ -110,12 +109,9 @@ class RssFragment() : VMBaseFragment<RssViewModel>(R.layout.fragment_rss),
 
     private fun initSearchView() {
         searchView.applyTint(primaryTextColor)
-        searchView.onActionViewExpanded()
+        searchView.setIconifiedByDefault(false)
         searchView.isSubmitButtonEnabled = true
         searchView.queryHint = getString(R.string.rss)
-        searchView.post {
-            searchView.clearFocus()
-        }
         searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
             override fun onQueryTextSubmit(query: String?): Boolean {
                 return false

+ 1 - 0
app/src/main/res/layout/view_search.xml

@@ -11,6 +11,7 @@
         android:layout_marginBottom="10dp"
         android:imeOptions="actionSearch"
         android:focusable="false"
+        app:searchIcon="@null"
         app:queryBackground="@null"
         app:submitBackground="@null"
         app:searchHintIcon="@drawable/ic_search_hint"