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

Commit e2b2edcd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed an issue where the notification wasn't clickable"

parents a896c7a4 fe24fb71
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -308,6 +308,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        }
    }

    public void setRippleAllowed(boolean allowed) {
        mBackgroundNormal.setPressedAllowed(allowed);
    }

    private boolean handleTouchEventDimmed(MotionEvent event) {
        if (mNeedsDimming && !mDimmed) {
            // We're actually dimmed, but our content isn't dimmable, let's ensure we have a ripple
+8 −8
Original line number Diff line number Diff line
@@ -370,14 +370,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        mNotificationInflater.inflateNotificationViews();
    }

    @Override
    public void setPressed(boolean pressed) {
        if (isOnKeyguard() || mEntry.notification.getNotification().contentIntent == null) {
            // We're dropping the ripple if we have a collapse / launch animation
            super.setPressed(pressed);
        }
    }

    public void onNotificationUpdated() {
        for (NotificationContentView l : mLayouts) {
            l.onNotificationUpdated(mEntry);
@@ -407,6 +399,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView

        showBlockingHelper(mEntry.userSentiment ==
                NotificationListenerService.Ranking.USER_SENTIMENT_NEGATIVE);
        updateRippleAllowed();
    }

    @VisibleForTesting
@@ -1805,6 +1798,13 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                mAboveShelfChangedListener.onAboveShelfStateChanged(!wasAboveShelf);
            }
        }
        updateRippleAllowed();
    }

    private void updateRippleAllowed() {
        boolean allowed = isOnKeyguard()
                || mEntry.notification.getNotification().contentIntent == null;
        setRippleAllowed(allowed);
    }

    /**
+14 −8
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.graphics.drawable.RippleDrawable;
import android.util.AttributeSet;
import android.view.View;

import com.android.internal.util.ArrayUtils;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.statusbar.notification.ActivityLaunchAnimator;
@@ -50,6 +51,7 @@ public class NotificationBackgroundView extends View {
    private boolean mExpandAnimationRunning;
    private float mActualWidth;
    private int mDrawableAlpha = 255;
    private boolean mIsPressedAllowed;

    public NotificationBackgroundView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -94,13 +96,7 @@ public class NotificationBackgroundView extends View {

    @Override
    protected void drawableStateChanged() {
        drawableStateChanged(mBackground);
    }

    private void drawableStateChanged(Drawable d) {
        if (d != null && d.isStateful()) {
            d.setState(getDrawableState());
        }
        setState(getDrawableState());
    }

    @Override
@@ -177,8 +173,14 @@ public class NotificationBackgroundView extends View {
    }

    public void setState(int[] drawableState) {
        if (mBackground != null && mBackground.isStateful()) {
            if (!mIsPressedAllowed) {
                drawableState = ArrayUtils.removeInt(drawableState,
                        com.android.internal.R.attr.state_pressed);
            }
            mBackground.setState(drawableState);
        }
    }

    public void setRippleColor(int color) {
        if (mBackground instanceof RippleDrawable) {
@@ -258,4 +260,8 @@ public class NotificationBackgroundView extends View {
        }
        invalidate();
    }

    public void setPressedAllowed(boolean allowed) {
        mIsPressedAllowed = allowed;
    }
}