Merge pull request #104 from twain47/preferenceFilter-use-TextInputEditText
Use TextInputEditText instead of TextView to preference filter
This commit is contained in:
commit
1eb9a47ba0
2 changed files with 10 additions and 28 deletions
|
@ -32,10 +32,6 @@ class PreferencesActivity : NoSplashAppCompatActivity(), PreferenceFragmentCompa
|
||||||
override fun afterTextChanged(s: Editable) {}
|
override fun afterTextChanged(s: Editable) {}
|
||||||
})
|
})
|
||||||
|
|
||||||
pref_filter_clear.setOnClickListener {
|
|
||||||
pref_filter.setText("")
|
|
||||||
}
|
|
||||||
|
|
||||||
title = resourceHelper.gs(R.string.nav_preferences)
|
title = resourceHelper.gs(R.string.nav_preferences)
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
supportActionBar?.setDisplayShowHomeEnabled(true)
|
supportActionBar?.setDisplayShowHomeEnabled(true)
|
||||||
|
|
|
@ -5,40 +5,26 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:hint="@string/filter"
|
||||||
|
app:endIconMode="clear_text">
|
||||||
|
|
||||||
<TextView
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/pref_filter"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:text="@string/filter"
|
|
||||||
android:textAppearance="@android:style/TextAppearance.Material.Medium"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/pref_filter"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_gravity="center_vertical"
|
android:autofillHints="@string/filter"
|
||||||
|
android:gravity="start"
|
||||||
|
android:textStyle="bold"
|
||||||
android:inputType="text" />
|
android:inputType="text" />
|
||||||
|
|
||||||
<ImageView
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
android:id="@+id/pref_filter_clear"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginStart="10dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
app:srcCompat="@android:drawable/ic_menu_close_clear_cancel" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in a new issue