OSDN Git Service

Fix ripple effect for floating toolbar menu items
authorMihai Popa <popam@google.com>
Tue, 10 Apr 2018 15:10:16 +0000 (16:10 +0100)
committerMihai Popa <popam@google.com>
Tue, 10 Apr 2018 15:10:16 +0000 (16:10 +0100)
A corner radius was set for the floating toolbar in
Ifcf4cff1f38fd18b7dbb4c1802390e3beb92cd3c. This produced a bug, where
the ripple effect set on the floating toolbar menu items was expanding
outside the corners when these were pressed.

This CL sets the menu items container to clip to outline, such that the
ripple effect of the menu items will be clipped.

Bug: 77547543
Test: manual testing
Change-Id: Ib43a6c719aab1403273f47e559433c9856b4f8b4

core/java/com/android/internal/widget/FloatingToolbar.java

index 35aae15..2ce5a0b 100644 (file)
@@ -1706,6 +1706,7 @@ public final class FloatingToolbar {
         contentContainer.setLayoutParams(new ViewGroup.LayoutParams(
                 ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
         contentContainer.setTag(FLOATING_TOOLBAR_TAG);
+        contentContainer.setClipToOutline(true);
         return contentContainer;
     }