From 6624fefbdeda8e065fdd86a6f78bc57b576c2da6 Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 11 Apr 2019 12:13:05 +0300 Subject: [PATCH] Open keyboard automatically and change background image --- .../drawable/gradient_both_sides_light.xml | 21 ---------- .../res/layout/empty_state_search.xml | 39 +++---------------- .../telegram/ui/SearchDialogFragment.kt | 15 ++----- 3 files changed, 9 insertions(+), 66 deletions(-) delete mode 100644 OsmAnd-telegram/res/drawable/gradient_both_sides_light.xml diff --git a/OsmAnd-telegram/res/drawable/gradient_both_sides_light.xml b/OsmAnd-telegram/res/drawable/gradient_both_sides_light.xml deleted file mode 100644 index 89f6d1c4ca..0000000000 --- a/OsmAnd-telegram/res/drawable/gradient_both_sides_light.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd-telegram/res/layout/empty_state_search.xml b/OsmAnd-telegram/res/layout/empty_state_search.xml index 1f0eb39653..0a91771332 100644 --- a/OsmAnd-telegram/res/layout/empty_state_search.xml +++ b/OsmAnd-telegram/res/layout/empty_state_search.xml @@ -6,42 +6,13 @@ android:gravity="center_horizontal" android:orientation="vertical"> - - - - - - - - - - - - - + android:scaleType="center" + android:src="@drawable/img_empty_state_search" /> () @@ -74,7 +72,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch setNavigationOnClickListener { dismiss() } } - searchBox = mainView.findViewById(R.id.searchEditText).apply { + searchEditText = mainView.findViewById(R.id.searchEditText).apply { addTextChangedListener(object : TextWatcher { override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {} @@ -111,13 +109,6 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch }) } - val matrix = ColorMatrix() - matrix.setSaturation(0f) - val filter = ColorMatrixColorFilter(matrix) - - mainView.findViewById(R.id.empty_state_background).colorFilter = filter - mainView.findViewById(R.id.empty_state_placeholder).colorFilter = filter - buttonsBar = mainView.findViewById(R.id.buttons_bar).apply { findViewById(R.id.primary_btn).apply { text = getString(R.string.shared_string_continue) @@ -162,6 +153,8 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch telegramHelper.addSearchListener(this) locationViewCache = app.uiUtils.getUpdateLocationViewCache() startLocationUpdate() + searchEditText.requestFocus() + AndroidUtils.softKeyboardDelayed(searchEditText) } override fun onPause() {