From 31167538259cfd8497405be2c874b22b936956af Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 5 Aug 2019 10:13:19 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/ui/search/SearchActivity.kt | 3 +-- .../java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt | 3 +-- app/src/main/res/layout/item_search.xml | 4 ++++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt index d504f8724..ac24f5ab8 100644 --- a/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/search/SearchActivity.kt @@ -14,7 +14,6 @@ import io.legado.app.base.VMBaseActivity import io.legado.app.data.entities.SearchBook import io.legado.app.lib.theme.ATH import io.legado.app.utils.getViewModel -import io.legado.app.utils.hideSoftInput import kotlinx.android.synthetic.main.activity_search.* import kotlinx.android.synthetic.main.view_title_bar.* @@ -40,7 +39,7 @@ class SearchActivity : VMBaseActivity(R.layout.activity_search) search_view.clearFocus() search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener { override fun onQueryTextSubmit(query: String?): Boolean { - search_view.hideSoftInput() + search_view.clearFocus() query?.let { viewModel.search(it, { startTime -> content_view.showContentView() diff --git a/app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt b/app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt index 9049bbc75..80f7df36d 100644 --- a/app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt +++ b/app/src/main/java/io/legado/app/ui/sourcedebug/SourceDebugActivity.kt @@ -13,7 +13,6 @@ import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor import io.legado.app.ui.qrcode.QrCodeActivity 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.view_title_bar.* import kotlinx.coroutines.launch @@ -58,7 +57,7 @@ class SourceDebugActivity : VMBaseActivity(R.layout.activity_s search_view.clearFocus() search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener { override fun onQueryTextSubmit(query: String?): Boolean { - search_view.hideSoftInput() + search_view.clearFocus() startSearch(query ?: "我的") return true } diff --git a/app/src/main/res/layout/item_search.xml b/app/src/main/res/layout/item_search.xml index ff3b1149b..57d9b033f 100644 --- a/app/src/main/res/layout/item_search.xml +++ b/app/src/main/res/layout/item_search.xml @@ -24,6 +24,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="8dp" + android:singleLine="true" android:text="@string/app_name" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/iv_cover" @@ -48,6 +49,7 @@ android:id="@+id/tv_kind" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginEnd="6dp" android:singleLine="true" android:text="@string/app_name" /> @@ -55,6 +57,7 @@ android:id="@+id/tv_kind_1" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginEnd="6dp" android:singleLine="true" android:text="@string/app_name" /> @@ -62,6 +65,7 @@ android:id="@+id/tv_kind_2" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginEnd="6dp" android:singleLine="true" android:text="@string/app_name" />