Loading packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +4 −0 Original line number Diff line number Diff line Loading @@ -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 Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +8 −8 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -407,6 +399,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView showBlockingHelper(mEntry.userSentiment == NotificationListenerService.Ranking.USER_SENTIMENT_NEGATIVE); updateRippleAllowed(); } @VisibleForTesting Loading Loading @@ -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); } /** Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java +14 −8 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading Loading @@ -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 Loading Loading @@ -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) { Loading Loading @@ -258,4 +260,8 @@ public class NotificationBackgroundView extends View { } invalidate(); } public void setPressedAllowed(boolean allowed) { mIsPressedAllowed = allowed; } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +4 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +8 −8 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -407,6 +399,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView showBlockingHelper(mEntry.userSentiment == NotificationListenerService.Ranking.USER_SENTIMENT_NEGATIVE); updateRippleAllowed(); } @VisibleForTesting Loading Loading @@ -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); } /** Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java +14 −8 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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); Loading Loading @@ -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 Loading Loading @@ -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) { Loading Loading @@ -258,4 +260,8 @@ public class NotificationBackgroundView extends View { } invalidate(); } public void setPressedAllowed(boolean allowed) { mIsPressedAllowed = allowed; } }