mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
clear search button
This commit is contained in:
parent
ced24dcda1
commit
f7f29c5f64
@ -65,6 +65,7 @@ class SearchFragment : Fragment() {
|
|||||||
searchRecView = view.findViewById<RecyclerView>(R.id.search_recycler)
|
searchRecView = view.findViewById<RecyclerView>(R.id.search_recycler)
|
||||||
|
|
||||||
val autoTextView = view.findViewById<AutoCompleteTextView>(R.id.autoCompleteTextView)
|
val autoTextView = view.findViewById<AutoCompleteTextView>(R.id.autoCompleteTextView)
|
||||||
|
val clearSearchButton = view.findViewById<ImageView>(R.id.clearSearch_imageView)
|
||||||
val historyRecycler = view.findViewById<RecyclerView>(R.id.history_recycler)
|
val historyRecycler = view.findViewById<RecyclerView>(R.id.history_recycler)
|
||||||
val filterImageView = view.findViewById<ImageView>(R.id.filterMenu_imageView)
|
val filterImageView = view.findViewById<ImageView>(R.id.filterMenu_imageView)
|
||||||
|
|
||||||
@ -73,6 +74,10 @@ class SearchFragment : Fragment() {
|
|||||||
val sharedPreferences =
|
val sharedPreferences =
|
||||||
PreferenceManager.getDefaultSharedPreferences(requireContext())
|
PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||||
|
|
||||||
|
clearSearchButton.setOnClickListener {
|
||||||
|
autoTextView.text.clear()
|
||||||
|
}
|
||||||
|
|
||||||
filterImageView.setOnClickListener {
|
filterImageView.setOnClickListener {
|
||||||
val filterOptions = arrayOf(
|
val filterOptions = arrayOf(
|
||||||
getString(R.string.all),
|
getString(R.string.all),
|
||||||
|
@ -28,29 +28,44 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="20dp"
|
||||||
android:layout_marginRight="20dp"
|
android:layout_marginRight="30dp"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
app:hintEnabled="false">
|
app:hintEnabled="false" >
|
||||||
|
|
||||||
<AutoCompleteTextView
|
<AutoCompleteTextView
|
||||||
android:id="@+id/autoCompleteTextView"
|
android:id="@+id/autoCompleteTextView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
|
android:dropDownWidth="match_parent"
|
||||||
android:hint="@string/search_hint"
|
android:hint="@string/search_hint"
|
||||||
android:imeOptions="actionSearch"
|
android:imeOptions="actionSearch"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:padding="12dp"
|
android:padding="12dp" />
|
||||||
android:dropDownWidth="match_parent" />
|
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/clearSearch_imageView"
|
||||||
|
android:layout_width="20dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:src="@drawable/ic_close"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginRight="16dp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
Loading…
x
Reference in New Issue
Block a user