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

Commit ceae0d92 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Check class type before creating animator" into tm-dev am: 0e76941f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17127404

Change-Id: I28aa9c612142103853efe2b57df6976aa4ee1d81
parents 66255850 0e76941f
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.VectorDrawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
@@ -37,8 +39,14 @@ public class NumPadButton extends AlphaOptimizedImageButton {
    public NumPadButton(Context context, AttributeSet attrs) {
        super(context, attrs);

        mAnimator = new NumPadAnimator(context, getBackground().mutate(),
        Drawable background = getBackground();
        if (background instanceof GradientDrawable) {
            mAnimator = new NumPadAnimator(context, background.mutate(),
                    attrs.getStyleAttribute());
        } else {
            mAnimator = null;
        }

    }

    @Override
+9 −2
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.keyguard;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.os.PowerManager;
import android.os.SystemClock;
import android.util.AttributeSet;
@@ -129,8 +131,13 @@ public class NumPadKey extends ViewGroup {

        setContentDescription(mDigitText.getText().toString());

        mAnimator = new NumPadAnimator(context, getBackground().mutate(),
        Drawable background = getBackground();
        if (background instanceof GradientDrawable) {
            mAnimator = new NumPadAnimator(context, background.mutate(),
                    R.style.NumPadKey, mDigitText);
        } else {
            mAnimator = null;
        }
    }

    @Override