Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05997f76 authored by mpodolian's avatar mpodolian
Browse files

Fixed bubble bar options menu background.

Set the menu items background color in code.

Fixes: 353655843
Fixes: 356931191
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Open bubble bar menu. Switch theme. Open bubble bar menu
again. Repeat 5 times. Observe menu items background is correct.
Press lower or upper menu item and wait while ripple animation reaches
the end. Observe it does not spread beyond the corners. Screenshot:
https://screenshot.googleplex.com/jg5p9jedUbXdJCs

Change-Id: I92a7a1a6acf8350cb74bca2029f5e6392c42237c
parent 2ef336ec
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,8 @@
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginTop="@dimen/bubble_bar_manage_menu_section_spacing"
        android:clipChildren="true"
        android:clipToOutline="true"
        android:background="@drawable/bubble_manage_menu_bg"
        android:elevation="@dimen/bubble_manage_menu_elevation" />

+9 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.wm.shell.bubbles.bar;

import android.annotation.ColorInt;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.Icon;
import android.util.AttributeSet;
@@ -64,6 +65,14 @@ public class BubbleBarMenuView extends LinearLayout {
        mActionsSectionView = findViewById(R.id.bubble_bar_manage_menu_actions_section);
        mBubbleIconView = findViewById(R.id.bubble_bar_manage_menu_bubble_icon);
        mBubbleTitleView = findViewById(R.id.bubble_bar_manage_menu_bubble_title);
        updateActionsBackgroundColor();
    }

    private void updateActionsBackgroundColor() {
        try (TypedArray ta = mContext.obtainStyledAttributes(new int[]{
                com.android.internal.R.attr.materialColorSurfaceBright})) {
            mActionsSectionView.getBackground().setTint(ta.getColor(0, Color.WHITE));
        }
    }

    /** Update menu details with bubble info */