Merge pull request #6811 from osmandapp/TrackerSearchImprovements

Tracker search UI improvements
This commit is contained in:
Alexey 2019-04-11 18:22:22 +03:00 committed by GitHub
commit 53bfad5e5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 69 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

View file

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<gradient
android:angle="0"
android:centerColor="#00ffffff"
android:centerX="0.2"
android:startColor="@color/card_bg_light" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient
android:angle="180"
android:centerColor="#00ffffff"
android:centerX="0.2"
android:startColor="@color/card_bg_light" />
</shape>
</item>
</layer-list>

View file

@ -6,42 +6,13 @@
android:gravity="center_horizontal"
android:orientation="vertical">
<FrameLayout
android:id="@+id/empty_state_image_container"
<ImageView
android:id="@+id/empty_state_background_image"
android:layout_width="match_parent"
android:layout_height="@dimen/my_location_image_height"
android:layout_marginBottom="16dp"
android:foreground="@drawable/gradient_both_sides_light">
<ImageView
android:id="@+id/empty_state_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="center"
android:src="@drawable/img_my_location_roadbg" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/content_padding_standard">
<ImageView
android:id="@+id/empty_state_placeholder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/img_my_location_user" />
<ImageView
android:id="@+id/empty_state_user_icon"
android:layout_width="@dimen/my_location_user_icon_size"
android:layout_height="@dimen/my_location_user_icon_size"
android:layout_gravity="center"
android:src="@drawable/img_user_placeholder" />
</FrameLayout>
</FrameLayout>
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding_standard"
android:scaleType="center"
android:src="@drawable/img_empty_state_search" />
<net.osmand.telegram.ui.views.TextViewEx
android:layout_width="wrap_content"
@ -56,8 +27,8 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="68dp"
android:layout_marginRight="68dp"
android:layout_marginLeft="@dimen/empty_state_descr_margin"
android:layout_marginRight="@dimen/empty_state_descr_margin"
android:background="@null"
android:gravity="center"
android:text="@string/search_contacts_descr"

View file

@ -60,6 +60,7 @@
<dimen name="disable_sharing_icon_top_margin">30dp</dimen>
<dimen name="search_box_height">48dp</dimen>
<dimen name="empty_state_descr_margin">68dp</dimen>
<dimen name="buttons_bottom_bar_height">56dp</dimen>

View file

@ -2,8 +2,6 @@ package net.osmand.telegram.ui
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
@ -43,7 +41,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
private lateinit var locationViewCache: UiUtils.UpdateLocationViewCache
private lateinit var searchBox: EditText
private lateinit var searchEditText: EditText
private lateinit var buttonsBar: LinearLayout
private var searchedChatsIds = mutableSetOf<Long>()
@ -74,7 +72,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
setNavigationOnClickListener { dismiss() }
}
searchBox = mainView.findViewById<EditText>(R.id.searchEditText).apply {
searchEditText = mainView.findViewById<EditText>(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<ImageView>(R.id.empty_state_background).colorFilter = filter
mainView.findViewById<ImageView>(R.id.empty_state_placeholder).colorFilter = filter
buttonsBar = mainView.findViewById<LinearLayout>(R.id.buttons_bar).apply {
findViewById<TextView>(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() {