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

Commit 61bfdb3a authored by Lyn Han's avatar Lyn Han
Browse files

Use default attr instead of styleable

Test: manual => toggle dark theme, pointer changes color
Test: manual => expanded view radius as expected
Change-Id: I5df4f1a6e5295678a08b5cf43f55028d4259e6f2
parent 10672be4
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -154,12 +154,5 @@
    <declare-styleable name="CaptionsToggleImageButton">
        <attr name="optedOut" format="boolean" />
    </declare-styleable>

    <!-- Theme attributes used to style the appearance of expanded Bubbles -->
    <declare-styleable name="BubbleExpandedView">
        <attr name="android:colorBackgroundFloating" />
        <attr name="android:dialogCornerRadius" />
    </declare-styleable>

</resources>
+6 −8
Original line number Diff line number Diff line
@@ -278,17 +278,15 @@ public class BubbleExpandedView extends LinearLayout implements View.OnClickList
    }

    void applyThemeAttrs() {
        TypedArray ta = getContext().obtainStyledAttributes(R.styleable.BubbleExpandedView);
        int bgColor = ta.getColor(
                R.styleable.BubbleExpandedView_android_colorBackgroundFloating, Color.WHITE);
        float cornerRadius = ta.getDimension(
                R.styleable.BubbleExpandedView_android_dialogCornerRadius, 0);
        final TypedArray ta = mContext.obtainStyledAttributes(
                new int[] {
                        android.R.attr.colorBackgroundFloating,
                        android.R.attr.dialogCornerRadius});
        int bgColor = ta.getColor(0, Color.WHITE);
        float cornerRadius = ta.getDimensionPixelSize(1, 0);
        ta.recycle();

        // Update triangle color.
        mPointerDrawable.setTint(bgColor);

        // Update ActivityView cornerRadius
        if (ScreenDecorationsUtils.supportsRoundedCornersOnWindows(mContext.getResources())) {
            mActivityView.setCornerRadius(cornerRadius);
        }