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

Commit 0e5f8a45 authored by Chet Haase's avatar Chet Haase Committed by Android (Google) Code Review
Browse files

Merge "Add backgroundColor getter to View"

parents d82f9988 5058c38a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33645,6 +33645,7 @@ package android.view {
    method public android.view.animation.Animation getAnimation();
    method public android.os.IBinder getApplicationWindowToken();
    method public android.graphics.drawable.Drawable getBackground();
    method public int getBackgroundColor();
    method public android.content.res.ColorStateList getBackgroundTintList();
    method public android.graphics.PorterDuff.Mode getBackgroundTintMode();
    method public int getBaseline();
+13 −0
Original line number Diff line number Diff line
@@ -16234,6 +16234,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
    }
    /**
     * If the view has a ColorDrawable background, returns the color of that
     * drawable.
     *
     * @return The color of the ColorDrawable background, if set, otherwise 0.
     */
    public int getBackgroundColor() {
        if (mBackground instanceof ColorDrawable) {
            return ((ColorDrawable) mBackground).getColor();
        }
        return 0;
    }
    /**
     * Set the background to a given resource. The resource should refer to
     * a Drawable object or 0 to remove the background.
+3 −3
Original line number Diff line number Diff line
@@ -388,7 +388,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    }

    private void updateBackgroundTint() {
        int color = getBackgroundColor();
        int color = getBgColor();
        int rippleColor = getRippleColor();
        if (color == mNormalColor) {
            // We don't need to tint a normal notification
@@ -652,7 +652,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    }

    private void updateAppearAnimationAlpha() {
        int backgroundColor = getBackgroundColor();
        int backgroundColor = getBgColor();
        if (backgroundColor != -1) {
            float contentAlphaProgress = mAppearAnimationFraction;
            contentAlphaProgress = contentAlphaProgress / (1.0f - ALPHA_ANIMATION_END);
@@ -666,7 +666,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        }
    }

    private int getBackgroundColor() {
    private int getBgColor() {
        if (mBgTint != 0) {
            return mBgTint;
        } else if (mShowingLegacyBackground) {