Fixed the interactivness of the shelf on the keyguard
The shelf could still be double-tapped on the lock screen. Test: manual, tap on bottom part of last notification on lockscreen Change-Id: Ic5ceb729e28095b90e96da85acd3da3d65110ccf Fixes: 33766648
This commit is contained in:
@@ -251,7 +251,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
boolean result;
|
||||
if (mDimmed && !isTouchExplorationEnabled()) {
|
||||
if (mDimmed && !isTouchExplorationEnabled() && isInteractive()) {
|
||||
boolean wasActivated = mActivated;
|
||||
result = handleTouchEventDimmed(event);
|
||||
if (wasActivated && result && event.getAction() == MotionEvent.ACTION_UP) {
|
||||
@@ -263,6 +263,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether this view is interactive and can be double tapped
|
||||
*/
|
||||
protected boolean isInteractive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawableHotspotChanged(float x, float y) {
|
||||
if (!mDimmed){
|
||||
|
||||
@@ -67,6 +67,7 @@ public class NotificationShelf extends ActivatableNotificationView {
|
||||
private int mStatusBarState;
|
||||
private float mMaxShelfEnd;
|
||||
private int mRelativeOffset;
|
||||
private boolean mInteractive;
|
||||
|
||||
public NotificationShelf(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@@ -555,13 +556,18 @@ public class NotificationShelf extends ActivatableNotificationView {
|
||||
}
|
||||
|
||||
private void updateInteractiveness() {
|
||||
boolean interactive = mStatusBarState == StatusBarState.KEYGUARD && mHasItemsInStableShelf;
|
||||
setClickable(interactive);
|
||||
setFocusable(interactive);
|
||||
setImportantForAccessibility(interactive ? View.IMPORTANT_FOR_ACCESSIBILITY_YES
|
||||
mInteractive = mStatusBarState == StatusBarState.KEYGUARD && mHasItemsInStableShelf;
|
||||
setClickable(mInteractive);
|
||||
setFocusable(mInteractive);
|
||||
setImportantForAccessibility(mInteractive ? View.IMPORTANT_FOR_ACCESSIBILITY_YES
|
||||
: View.IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isInteractive() {
|
||||
return mInteractive;
|
||||
}
|
||||
|
||||
public void setMaxShelfEnd(float maxShelfEnd) {
|
||||
mMaxShelfEnd = maxShelfEnd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user