mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 03:29:28 +01:00
use TextInputLayout
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
efb5178761
commit
a504f53b3a
@ -58,7 +58,7 @@ class ListOpenConversationsActivity : BaseActivity() {
|
|||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
setupSystemColors()
|
setupSystemColors()
|
||||||
viewThemeUtils.platform.colorImageView(binding.searchOpenConversations, ColorRole.ON_SURFACE)
|
viewThemeUtils.platform.colorImageView(binding.searchOpenConversations, ColorRole.ON_SURFACE)
|
||||||
viewThemeUtils.platform.colorEditText(binding.searchEdit)
|
viewThemeUtils.material.colorTextInputLayout(binding.textInputLayout)
|
||||||
|
|
||||||
val user = currentUserProvider.currentUser.blockingGet()
|
val user = currentUserProvider.currentUser.blockingGet()
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class ListOpenConversationsActivity : BaseActivity() {
|
|||||||
searching = !searching
|
searching = !searching
|
||||||
handleSearchUI(searching)
|
handleSearchUI(searching)
|
||||||
}
|
}
|
||||||
binding.searchEdit.doOnTextChanged { text, _, _, count ->
|
binding.editText.doOnTextChanged { text, _, _, count ->
|
||||||
adapter.filter(text.toString())
|
adapter.filter(text.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,11 +78,11 @@ class ListOpenConversationsActivity : BaseActivity() {
|
|||||||
private fun handleSearchUI(show: Boolean) {
|
private fun handleSearchUI(show: Boolean) {
|
||||||
if (show) {
|
if (show) {
|
||||||
binding.searchOpenConversations.visibility = View.GONE
|
binding.searchOpenConversations.visibility = View.GONE
|
||||||
binding.searchEdit.visibility = View.VISIBLE
|
binding.textInputLayout.visibility = View.VISIBLE
|
||||||
binding.searchEdit.showKeyboardAndFocus()
|
binding.editText.showKeyboardAndFocus()
|
||||||
} else {
|
} else {
|
||||||
binding.searchOpenConversations.visibility = View.VISIBLE
|
binding.searchOpenConversations.visibility = View.VISIBLE
|
||||||
binding.searchEdit.visibility = View.GONE
|
binding.textInputLayout.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
-->
|
-->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
@ -38,13 +39,28 @@
|
|||||||
android:layout_marginHorizontal="@dimen/standard_margin"
|
android:layout_marginHorizontal="@dimen/standard_margin"
|
||||||
android:src="@drawable/ic_search_white_24dp" />
|
android:src="@drawable/ic_search_white_24dp" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/search_edit"
|
android:id="@+id/textInputLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
app:endIconMode="clear_text"
|
||||||
|
app:boxBackgroundMode="none"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
/>
|
tools:visibility="visible"
|
||||||
|
app:hintEnabled="false"
|
||||||
|
app:endIconTint="@color/icon_on_bg_default"
|
||||||
|
android:layout_marginEnd = "8dp">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/editText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="Search"
|
||||||
|
android:textColorHint="@color/low_emphasis_text"
|
||||||
|
android:textColor = "@color/high_emphasis_text"/>
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
</com.google.android.material.appbar.MaterialToolbar>
|
</com.google.android.material.appbar.MaterialToolbar>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
@ -400,6 +400,7 @@ How to translate with transifex:
|
|||||||
<string name="nc_refresh">Refresh</string>
|
<string name="nc_refresh">Refresh</string>
|
||||||
<string name="nc_check_your_internet">Please check your internet connection</string>
|
<string name="nc_check_your_internet">Please check your internet connection</string>
|
||||||
<string name="nc_visible">Visible</string>
|
<string name="nc_visible">Visible</string>
|
||||||
|
<string name="nc_clear_text">Clear search text</string>
|
||||||
|
|
||||||
<!-- Chat -->
|
<!-- Chat -->
|
||||||
<string name="nc_hint_enter_a_message">Enter a message …</string>
|
<string name="nc_hint_enter_a_message">Enter a message …</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user