From b34b7deb1e5dacab2b3dd54dfd63918ce139083f Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Tue, 19 Jul 2016 15:14:13 -0700 Subject: [PATCH] Use a round rect background drawable for "clear all" Such that we can remove the outline clip, which is triggering a new shader compilation when "clear all" show up the first time. b/28795315 Change-Id: Ib3c4283e46c932090ec97233a5551da7b359c8c8 --- .../recents_stack_action_background.xml | 25 +++++++++++++++++++ .../layout/recents_stack_action_button.xml | 2 +- .../systemui/recents/views/RecentsView.java | 9 ------- 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 packages/SystemUI/res/drawable/recents_stack_action_background.xml diff --git a/packages/SystemUI/res/drawable/recents_stack_action_background.xml b/packages/SystemUI/res/drawable/recents_stack_action_background.xml new file mode 100644 index 0000000000000..2a40dd0ec6131 --- /dev/null +++ b/packages/SystemUI/res/drawable/recents_stack_action_background.xml @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/recents_stack_action_button.xml b/packages/SystemUI/res/layout/recents_stack_action_button.xml index 43b3de1a0244a..541000b78f8b6 100644 --- a/packages/SystemUI/res/layout/recents_stack_action_button.xml +++ b/packages/SystemUI/res/layout/recents_stack_action_button.xml @@ -31,6 +31,6 @@ android:shadowDy="2" android:shadowRadius="5" android:fontFamily="sans-serif-medium" - android:background="?android:selectableItemBackground" + android:background="@drawable/recents_stack_action_background" android:visibility="invisible" android:forceHasOverlappingRendering="false" /> diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index a8939100f66dc..43d0cf6db854b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -140,8 +140,6 @@ public class RecentsView extends FrameLayout { LayoutInflater inflater = LayoutInflater.from(context); if (RecentsDebugFlags.Static.EnableStackActionButton) { - float cornerRadius = context.getResources().getDimensionPixelSize( - R.dimen.recents_task_view_rounded_corners_radius); mStackActionButton = (TextView) inflater.inflate(R.layout.recents_stack_action_button, this, false); mStackActionButton.setOnClickListener(new View.OnClickListener() { @@ -151,13 +149,6 @@ public class RecentsView extends FrameLayout { } }); addView(mStackActionButton); - mStackActionButton.setClipToOutline(true); - mStackActionButton.setOutlineProvider(new ViewOutlineProvider() { - @Override - public void getOutline(View view, Outline outline) { - outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), cornerRadius); - } - }); } mEmptyView = (TextView) inflater.inflate(R.layout.recents_empty, this, false); addView(mEmptyView);