iFixed issue https://github.com/BelledonneCommunications/linphone-android/issues/1269 by replacing SearchView by EditText..., TODO: use our own search icon
This commit is contained in:
parent
908ef58162
commit
0f3c9fb2a0
4 changed files with 21 additions and 45 deletions
|
@ -505,29 +505,3 @@ fun setEditTextErrorListener(editText: EditText, attrChange: InverseBindingListe
|
||||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@BindingAdapter("queryValue")
|
|
||||||
fun setSearchViewQuery(view: SearchView, query: String?) {
|
|
||||||
if (query != view.query) {
|
|
||||||
view.setQuery(query, false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@InverseBindingAdapter(attribute = "queryValue")
|
|
||||||
fun getSearchViewQuery(view: SearchView): String? {
|
|
||||||
return view.query?.toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
@BindingAdapter("queryValueAttrChanged")
|
|
||||||
fun setSearchViewQueryListener(view: SearchView, attrChange: InverseBindingListener) {
|
|
||||||
view.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
|
|
||||||
override fun onQueryTextSubmit(query: String?): Boolean {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onQueryTextChange(newText: String?): Boolean {
|
|
||||||
attrChange.onChange()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
|
@ -128,18 +128,19 @@
|
||||||
android:layout_alignTop="@id/top_bar"
|
android:layout_alignTop="@id/top_bar"
|
||||||
tools:layout="@layout/list_edit_top_bar_fragment" />
|
tools:layout="@layout/list_edit_top_bar_fragment" />
|
||||||
|
|
||||||
<SearchView
|
<EditText
|
||||||
android:id="@+id/searchBar"
|
android:id="@+id/searchBar"
|
||||||
queryValue="@={viewModel.filter}"
|
android:text="@={viewModel.filter}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:gravity="center"
|
|
||||||
android:iconifiedByDefault="false"
|
|
||||||
android:inputType="textPersonName"
|
android:inputType="textPersonName"
|
||||||
android:layout_below="@id/top_bar"
|
android:layout_below="@id/top_bar"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:queryBackground="@color/transparent_color"
|
android:drawableLeft="@android:drawable/ic_menu_search"
|
||||||
android:queryHint="@string/contact_filter_hint"/>
|
android:drawablePadding="10dp"
|
||||||
|
android:background="@color/transparent_color"
|
||||||
|
android:backgroundTint="@color/transparent_color"
|
||||||
|
android:hint="@string/contact_filter_hint"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -148,19 +148,19 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<SearchView
|
<EditText
|
||||||
android:id="@+id/searchBar"
|
android:id="@+id/searchBar"
|
||||||
queryValue="@={viewModel.filter}"
|
android:text="@={viewModel.filter}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:gravity="center"
|
|
||||||
android:iconifiedByDefault="false"
|
|
||||||
android:inputType="textPersonName"
|
android:inputType="textPersonName"
|
||||||
android:layout_below="@id/top_bar"
|
android:layout_below="@id/top_bar"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:paddingRight="5dp"
|
android:drawableLeft="@android:drawable/ic_menu_search"
|
||||||
android:queryBackground="@color/transparent_color"
|
android:drawablePadding="10dp"
|
||||||
android:queryHint="@string/contact_filter_hint"/>
|
android:background="@color/transparent_color"
|
||||||
|
android:backgroundTint="@color/transparent_color"
|
||||||
|
android:hint="@string/contact_filter_hint"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -118,18 +118,19 @@
|
||||||
android:layout_alignTop="@id/top_bar"
|
android:layout_alignTop="@id/top_bar"
|
||||||
tools:layout="@layout/list_edit_top_bar_fragment" />
|
tools:layout="@layout/list_edit_top_bar_fragment" />
|
||||||
|
|
||||||
<SearchView
|
<EditText
|
||||||
android:id="@+id/searchBar"
|
android:id="@+id/searchBar"
|
||||||
queryValue="@={viewModel.filter}"
|
android:text="@={viewModel.filter}"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_below="@id/top_bar"
|
android:layout_below="@id/top_bar"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:gravity="center"
|
|
||||||
android:iconifiedByDefault="false"
|
|
||||||
android:inputType="textPersonName"
|
android:inputType="textPersonName"
|
||||||
android:queryBackground="@color/transparent_color"
|
android:drawableLeft="@android:drawable/ic_menu_search"
|
||||||
android:queryHint="@string/contact_filter_hint"/>
|
android:drawablePadding="10dp"
|
||||||
|
android:background="@color/transparent_color"
|
||||||
|
android:backgroundTint="@color/transparent_color"
|
||||||
|
android:hint="@string/contact_filter_hint"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in a new issue