pull/32/head
kunfei 5 years ago
parent 510afe272b
commit 3116753825
  1. 3
      app/src/main/java/io/legado/app/ui/search/SearchActivity.kt
  2. 3
      app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt
  3. 4
      app/src/main/res/layout/item_search.xml

@ -14,7 +14,6 @@ import io.legado.app.base.VMBaseActivity
import io.legado.app.data.entities.SearchBook import io.legado.app.data.entities.SearchBook
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
import io.legado.app.utils.hideSoftInput
import kotlinx.android.synthetic.main.activity_search.* import kotlinx.android.synthetic.main.activity_search.*
import kotlinx.android.synthetic.main.view_title_bar.* import kotlinx.android.synthetic.main.view_title_bar.*
@ -40,7 +39,7 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_search)
search_view.clearFocus() search_view.clearFocus()
search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener { search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String?): Boolean { override fun onQueryTextSubmit(query: String?): Boolean {
search_view.hideSoftInput() search_view.clearFocus()
query?.let { query?.let {
viewModel.search(it, { startTime -> viewModel.search(it, { startTime ->
content_view.showContentView() content_view.showContentView()

@ -13,7 +13,6 @@ import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.qrcode.QrCodeActivity import io.legado.app.ui.qrcode.QrCodeActivity
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
import io.legado.app.utils.hideSoftInput
import kotlinx.android.synthetic.main.activity_source_debug.* import kotlinx.android.synthetic.main.activity_source_debug.*
import kotlinx.android.synthetic.main.view_title_bar.* import kotlinx.android.synthetic.main.view_title_bar.*
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@ -58,7 +57,7 @@ class SourceDebugActivity : VMBaseActivity<SourceDebugModel>(R.layout.activity_s
search_view.clearFocus() search_view.clearFocus()
search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener { search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
override fun onQueryTextSubmit(query: String?): Boolean { override fun onQueryTextSubmit(query: String?): Boolean {
search_view.hideSoftInput() search_view.clearFocus()
startSearch(query ?: "我的") startSearch(query ?: "我的")
return true return true
} }

@ -24,6 +24,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="8dp" android:layout_margin="8dp"
android:singleLine="true"
android:text="@string/app_name" android:text="@string/app_name"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/iv_cover" app:layout_constraintStart_toEndOf="@+id/iv_cover"
@ -48,6 +49,7 @@
android:id="@+id/tv_kind" android:id="@+id/tv_kind"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:singleLine="true" android:singleLine="true"
android:text="@string/app_name" /> android:text="@string/app_name" />
@ -55,6 +57,7 @@
android:id="@+id/tv_kind_1" android:id="@+id/tv_kind_1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:singleLine="true" android:singleLine="true"
android:text="@string/app_name" /> android:text="@string/app_name" />
@ -62,6 +65,7 @@
android:id="@+id/tv_kind_2" android:id="@+id/tv_kind_2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:singleLine="true" android:singleLine="true"
android:text="@string/app_name" /> android:text="@string/app_name" />

Loading…
Cancel
Save