pull/2448/head
kunfei 2 years ago
parent 849ac28752
commit 2d99fc0cbc
  1. 7
      app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt
  2. 5
      app/src/main/res/menu/book_search.xml

@ -10,6 +10,7 @@ import android.view.View.VISIBLE
import android.widget.TextView
import androidx.activity.viewModels
import androidx.appcompat.widget.SearchView
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@ -126,6 +127,7 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
searchView.setQuery(it, true)
}
}
R.id.menu_search_scope -> alertSearchScope()
R.id.menu_source_manage -> startActivity<BookSourceActivity>()
R.id.menu_log -> showDialogFragment(AppLogDialog())
}
@ -387,6 +389,11 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
searchScope.save()
viewModel.searchScope.update(searchScope.toString())
searchScopeAdapter.setItems(searchScope.displayNames)
if (!binding.llInputHelp.isVisible) {
searchView.query?.toString()?.trim()?.let {
searchView.setQuery(it, true)
}
}
}
private fun alertSearchScope() {

@ -3,6 +3,11 @@
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="AlwaysShowAction">
<item
android:id="@+id/menu_search_scope"
android:title="@string/search_scope"
app:showAsAction="never" />
<item
android:id="@+id/menu_precision_search"
android:checkable="true"

Loading…
Cancel
Save