Fix ripple of button in App Drawer search bar

This commit is contained in:
Patryk Michalik
2021-10-09 16:29:45 +02:00
parent 07fc8fa808
commit 77db002abf
5 changed files with 26 additions and 15 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:bottom="2dp">
<item>
<shape android:shape="rectangle">
<solid android:color="?searchboxHighlight" />
<corners android:radius="32dp" />
@@ -15,10 +15,10 @@
~ limitations under the License.
-->
<app.lawnchair.allapps.AllAppsSearchInput
xmlns:android="http://schemas.android.com/apk/res/android"
<app.lawnchair.allapps.AllAppsSearchInput xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/search_box_container_height"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/search_container_all_apps"
android:focusable="true"
android:clickable="true">
@@ -64,16 +64,25 @@
android:privateImeOptions="bc_search"
android:imeOptions="actionGo|flagNoExtractUi" />
<ImageButton
android:id="@+id/action_btn"
android:layout_width="@dimen/search_box_height"
android:layout_height="@dimen/search_box_height"
android:layout_gravity="bottom|center|end"
android:background="?android:selectableItemBackgroundBorderless"
android:clickable="true"
android:src="@drawable/ic_remove_no_shadow"
android:scaleType="center"
android:tint="?android:textColorSecondary"
android:contentDescription="@string/search_input_action_clear_results" />
<FrameLayout
android:id="@+id/button_wrapper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:background="@drawable/circle">
<ImageButton
android:id="@+id/action_btn"
android:layout_width="@dimen/search_box_height"
android:layout_height="@dimen/search_box_height"
android:layout_gravity="bottom|center"
android:background="?android:selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/search_input_action_clear_results"
android:scaleType="center"
android:src="@drawable/ic_remove_no_shadow"
app:tint="?android:textColorSecondary" />
</FrameLayout>
</FrameLayout>
</app.lawnchair.allapps.AllAppsSearchInput>
+1 -1
View File
@@ -35,7 +35,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@drawable/snackbar_button_wrapper">
android:background="@drawable/circle">
<TextView
android:id="@+id/action"
style="@style/TextTitle"
@@ -7,6 +7,7 @@ import android.text.SpannableStringBuilder
import android.text.method.TextKeyListener
import android.util.AttributeSet
import android.view.KeyEvent
import android.widget.FrameLayout
import android.widget.ImageButton
import android.widget.LinearLayout
import android.widget.TextView
@@ -56,6 +57,7 @@ class AllAppsSearchInput(context: Context, attrs: AttributeSet?) : LinearLayout(
actionButton.setOnClickListener {
input.reset()
}
findViewById<FrameLayout>(R.id.button_wrapper).clipToOutline = true
}
override fun onAttachedToWindow() {