diff options
Diffstat (limited to 'packages/SystemUI/src')
11 files changed, 208 insertions, 43 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java index 0369ab5..5d74604 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java @@ -74,7 +74,11 @@ public class FlashlightTile extends QSTile<QSTile.BooleanState> implements state.visible = mFlashlightController.isAvailable(); state.label = mHost.getContext().getString(R.string.quick_settings_flashlight_label); if (arg instanceof UserBoolean) { - state.value = ((UserBoolean) arg).value; + boolean value = ((UserBoolean) arg).value; + if (value == state.value) { + return; + } + state.value = value; } final AnimationIcon icon = state.value ? mEnable : mDisable; icon.setAllowAnimation(arg instanceof UserBoolean && ((UserBoolean) arg).userInitiated); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java index c27e3a8..b0247cb 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java @@ -22,6 +22,7 @@ import android.animation.ValueAnimator; import android.content.Context; import android.graphics.*; import android.util.AttributeSet; +import android.view.accessibility.AccessibilityManager; import android.view.View; import android.view.ViewOutlineProvider; import android.view.animation.AccelerateInterpolator; @@ -676,7 +677,11 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, mThumbnailView.rebindToTask(mTask); mHeaderView.rebindToTask(mTask); // Rebind any listeners - mHeaderView.mApplicationIcon.setOnClickListener(this); + AccessibilityManager am = (AccessibilityManager) getContext(). + getSystemService(Context.ACCESSIBILITY_SERVICE); + if (Constants.DebugFlags.App.EnableTaskFiltering || (am != null && am.isEnabled())) { + mHeaderView.mApplicationIcon.setOnClickListener(this); + } mHeaderView.mDismissButton.setOnClickListener(this); if (mConfig.multiStackEnabled) { mHeaderView.mMoveTaskButton.setOnClickListener(this); @@ -722,9 +727,19 @@ public class TaskView extends FrameLayout implements Task.TaskCallbacks, postDelayed(new Runnable() { @Override public void run() { - if (Constants.DebugFlags.App.EnableTaskFiltering && v == mHeaderView.mApplicationIcon) { - if (mCb != null) { - mCb.onTaskViewAppIconClicked(tv); + if (v == mHeaderView.mApplicationIcon) { + if (Constants.DebugFlags.App.EnableTaskFiltering) { + if (mCb != null) { + mCb.onTaskViewAppIconClicked(tv); + } + } else { + AccessibilityManager am = (AccessibilityManager) getContext(). + getSystemService(Context.ACCESSIBILITY_SERVICE); + if (am != null && am.isEnabled()) { + if (mCb != null) { + mCb.onTaskViewAppInfoClicked(tv); + } + } } } else if (v == mHeaderView.mDismissButton) { dismissTask(); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java index 09e9839..1a22cae 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java @@ -194,7 +194,6 @@ public class TaskViewHeader extends FrameLayout { } else if (t.applicationIcon != null) { mApplicationIcon.setImageDrawable(t.applicationIcon); } - mApplicationIcon.setContentDescription(t.contentDescription); if (!mActivityDescription.getText().toString().equals(t.activityLabel)) { mActivityDescription.setText(t.activityLabel); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java index 9ccff72..374d970 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardAffordanceView.java @@ -23,11 +23,14 @@ import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; +import android.graphics.CanvasProperty; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.util.AttributeSet; +import android.view.DisplayListCanvas; +import android.view.RenderNodeAnimator; import android.view.View; import android.view.ViewAnimationUtils; import android.view.animation.AnimationUtils; @@ -35,6 +38,7 @@ import android.view.animation.Interpolator; import android.widget.ImageView; import com.android.systemui.R; import com.android.systemui.statusbar.phone.KeyguardAffordanceHelper; +import com.android.systemui.statusbar.phone.PhoneStatusBar; /** * An ImageView which does not have overlapping renderings commands and therefore does not need a @@ -77,6 +81,14 @@ public class KeyguardAffordanceView extends ImageView { private float mMaxCircleSize; private Animator mPreviewClipper; private float mRestingAlpha = KeyguardAffordanceHelper.SWIPE_RESTING_ALPHA_AMOUNT; + private boolean mSupportHardware; + private boolean mFinishing; + + private CanvasProperty<Float> mHwCircleRadius; + private CanvasProperty<Float> mHwCenterX; + private CanvasProperty<Float> mHwCenterY; + private CanvasProperty<Paint> mHwCirclePaint; + private AnimatorListenerAdapter mClipEndListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { @@ -155,6 +167,7 @@ public class KeyguardAffordanceView extends ImageView { @Override protected void onDraw(Canvas canvas) { + mSupportHardware = canvas.isHardwareAccelerated(); drawBackgroundCircle(canvas); drawArrow(canvas); canvas.save(); @@ -196,8 +209,14 @@ public class KeyguardAffordanceView extends ImageView { private void drawBackgroundCircle(Canvas canvas) { if (mCircleRadius > 0) { - updateCircleColor(); - canvas.drawCircle(mCenterX, mCenterY, mCircleRadius, mCirclePaint); + if (mFinishing && mSupportHardware) { + DisplayListCanvas displayListCanvas = (DisplayListCanvas) canvas; + displayListCanvas.drawCircle(mHwCenterX, mHwCenterY, mHwCircleRadius, + mHwCirclePaint); + } else { + updateCircleColor(); + canvas.drawCircle(mCenterX, mCenterY, mCircleRadius, mCirclePaint); + } } } @@ -218,15 +237,23 @@ public class KeyguardAffordanceView extends ImageView { public void finishAnimation(float velocity, final Runnable mAnimationEndRunnable) { cancelAnimator(mCircleAnimator); cancelAnimator(mPreviewClipper); + mFinishing = true; mCircleStartRadius = mCircleRadius; float maxCircleSize = getMaxCircleSize(); - ValueAnimator animatorToRadius = getAnimatorToRadius(maxCircleSize); + Animator animatorToRadius; + if (mSupportHardware) { + initHwProperties(); + animatorToRadius = getRtAnimatorToRadius(maxCircleSize); + } else { + animatorToRadius = getAnimatorToRadius(maxCircleSize); + } mFlingAnimationUtils.applyDismissing(animatorToRadius, mCircleRadius, maxCircleSize, velocity, maxCircleSize); animatorToRadius.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mAnimationEndRunnable.run(); + mFinishing = false; } }); animatorToRadius.start(); @@ -240,9 +267,34 @@ public class KeyguardAffordanceView extends ImageView { velocity, maxCircleSize); mPreviewClipper.addListener(mClipEndListener); mPreviewClipper.start(); + if (mSupportHardware) { + startRtCircleFadeOut(animatorToRadius.getDuration()); + } } } + private void startRtCircleFadeOut(long duration) { + RenderNodeAnimator animator = new RenderNodeAnimator(mHwCirclePaint, + RenderNodeAnimator.PAINT_ALPHA, 0); + animator.setDuration(duration); + animator.setInterpolator(PhoneStatusBar.ALPHA_OUT); + animator.setTarget(this); + animator.start(); + } + + private Animator getRtAnimatorToRadius(float circleRadius) { + RenderNodeAnimator animator = new RenderNodeAnimator(mHwCircleRadius, circleRadius); + animator.setTarget(this); + return animator; + } + + private void initHwProperties() { + mHwCenterX = CanvasProperty.createFloat(mCenterX); + mHwCenterY = CanvasProperty.createFloat(mCenterY); + mHwCirclePaint = CanvasProperty.createPaint(mCirclePaint); + mHwCircleRadius = CanvasProperty.createFloat(mCircleRadius); + } + private float getMaxCircleSize() { getLocationInWindow(mTempPoint); float rootWidth = getRootView().getWidth(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 2fe98bb..4bc317a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -196,6 +196,7 @@ public class NotificationPanelView extends PanelView implements private boolean mCollapsedOnDown; private int mPositionMinSideMargin; private int mLastOrientation = -1; + private boolean mClosingWithAlphaFadeOut; private Runnable mHeadsUpExistenceChangedRunnable = new Runnable() { @Override @@ -527,6 +528,7 @@ public class NotificationPanelView extends PanelView implements protected void flingToHeight(float vel, boolean expand, float target, float collapseSpeedUpFactor, boolean expandBecauseOfFalsing) { mHeadsUpTouchHelper.notifyFling(!expand); + setClosingWithAlphaFadeout(!expand && getFadeoutAlpha() == 1.0f); super.flingToHeight(vel, expand, target, collapseSpeedUpFactor, expandBecauseOfFalsing); } @@ -638,10 +640,9 @@ public class NotificationPanelView extends PanelView implements @Override protected boolean isInContentBounds(float x, float y) { - float yTransformed = y - mNotificationStackScroller.getY(); float stackScrollerX = mNotificationStackScroller.getX(); - return mNotificationStackScroller.isInContentBounds(yTransformed) && stackScrollerX < x - && x < stackScrollerX + mNotificationStackScroller.getWidth(); + return !mNotificationStackScroller.isBelowLastNotification(x - stackScrollerX, y) + && stackScrollerX < x && x < stackScrollerX + mNotificationStackScroller.getWidth(); } private void initDownStates(MotionEvent event) { @@ -1074,8 +1075,12 @@ public class NotificationPanelView extends PanelView implements }; private void animateHeaderSlidingIn() { - mHeaderAnimating = true; - getViewTreeObserver().addOnPreDrawListener(mStartHeaderSlidingIn); + // If the QS is already expanded we don't need to slide in the header as it's already + // visible. + if (!mQsExpanded) { + mHeaderAnimating = true; + getViewTreeObserver().addOnPreDrawListener(mStartHeaderSlidingIn); + } } private void animateHeaderSlidingOut() { @@ -1585,26 +1590,22 @@ public class NotificationPanelView extends PanelView implements } } private void updateNotificationTranslucency() { - float alpha; - if (mExpandingFromHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) { - alpha = 1f; - } else { - alpha = (getNotificationsTopY() + mNotificationStackScroller.getItemHeight()) - / (mQsMinExpansionHeight + mNotificationStackScroller.getBottomStackPeekSize() - - mNotificationStackScroller.getCollapseSecondCardPadding()); - alpha = Math.max(0, Math.min(alpha, 1)); - alpha = (float) Math.pow(alpha, 0.75); - } - - if (alpha != 1f && mNotificationStackScroller.getLayerType() != LAYER_TYPE_HARDWARE) { - mNotificationStackScroller.setLayerType(LAYER_TYPE_HARDWARE, null); - } else if (alpha == 1f - && mNotificationStackScroller.getLayerType() == LAYER_TYPE_HARDWARE) { - mNotificationStackScroller.setLayerType(LAYER_TYPE_NONE, null); + float alpha = 1f; + if (mClosingWithAlphaFadeOut && !mExpandingFromHeadsUp && !mHeadsUpManager.hasPinnedHeadsUp()) { + alpha = getFadeoutAlpha(); } mNotificationStackScroller.setAlpha(alpha); } + private float getFadeoutAlpha() { + float alpha = (getNotificationsTopY() + mNotificationStackScroller.getItemHeight()) + / (mQsMinExpansionHeight + mNotificationStackScroller.getBottomStackPeekSize() + - mNotificationStackScroller.getCollapseSecondCardPadding()); + alpha = Math.max(0, Math.min(alpha, 1)); + alpha = (float) Math.pow(alpha, 0.75); + return alpha; + } + @Override protected float getOverExpansionAmount() { return mNotificationStackScroller.getCurrentOverScrollAmount(true /* top */); @@ -2261,6 +2262,12 @@ public class NotificationPanelView extends PanelView implements protected void onClosingFinished() { super.onClosingFinished(); resetVerticalPanelPosition(); + setClosingWithAlphaFadeout(false); + } + + private void setClosingWithAlphaFadeout(boolean closing) { + mClosingWithAlphaFadeOut = closing; + mNotificationStackScroller.forceNoOverlappingRendering(closing); } /** diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 6d35ff0..9d4997c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -777,6 +777,15 @@ public abstract class PanelView extends FrameLayout { public void setExpandedFraction(float frac) { setExpandedHeight(getMaxPanelHeight() * frac); + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD + && mStatusBar.getBarState() == StatusBarState.KEYGUARD) { + if (frac == 0.0f) { + Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + + Log.getStackTraceString(new Throwable())); + } else if (frac == 1.0f) { + mStatusBar.endWindowManagerLogging(); + } + } } public float getExpandedHeight() { @@ -808,6 +817,11 @@ public abstract class PanelView extends FrameLayout { } public void collapse(boolean delayed, float speedUpFactor) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD + && mStatusBar.getBarState() == StatusBarState.KEYGUARD) { + Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + + Log.getStackTraceString(new Throwable())); + } if (DEBUG) logf("collapse: " + this); if (mPeekPending || mPeekAnimator != null) { mCollapseAfterPeek = true; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index def95aa..7c7bec9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -185,6 +185,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, HeadsUpManager.OnHeadsUpChangedListener { static final String TAG = "PhoneStatusBar"; public static final boolean DEBUG = BaseStatusBar.DEBUG; + public static final boolean DEBUG_EMPTY_KEYGUARD = true; public static final boolean SPEW = false; public static final boolean DUMPTRUCK = true; // extra dumpsys info public static final boolean DEBUG_GESTURES = false; @@ -2003,6 +2004,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mStatusBarWindowManager.setPanelExpanded(isExpanded); } + public void endWindowManagerLogging() { + mStatusBarWindowManager.setLogState(false); + } + /** * All changes to the status bar and notifications funnel through here and are batched. */ @@ -3547,6 +3552,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, // Make our window larger and the panel expanded. makeExpandedVisible(true); mNotificationPanel.instantExpand(); + if (DEBUG_EMPTY_KEYGUARD) { + mStatusBarWindowManager.setLogState(true); + } } private void instantCollapseNotificationPanel() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index aa499ad..b7e675d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -20,12 +20,14 @@ import android.content.Context; import android.content.res.Resources; import android.util.AttributeSet; import android.util.EventLog; +import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.accessibility.AccessibilityEvent; import com.android.systemui.EventLogTags; import com.android.systemui.R; +import com.android.systemui.statusbar.StatusBarState; public class PhoneStatusBarView extends PanelBar { private static final String TAG = "PhoneStatusBarView"; @@ -108,7 +110,11 @@ public class PhoneStatusBarView extends PanelBar { @Override public void onAllPanelsCollapsed() { super.onAllPanelsCollapsed(); - + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD + && mBar.getBarState() == StatusBarState.KEYGUARD) { + Log.i(PhoneStatusBar.TAG, "Panel collapsed! Stacktrace: " + + Log.getStackTraceString(new Throwable())); + } // Close the status bar in the next frame so we can show the end of the animation. postOnAnimation(new Runnable() { @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java index de42643..58017d0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java @@ -21,6 +21,7 @@ import android.content.pm.ActivityInfo; import android.content.res.Resources; import android.graphics.PixelFormat; import android.os.SystemProperties; +import android.util.Log; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; @@ -31,6 +32,8 @@ import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.StatusBarState; +import java.lang.reflect.Field; + /** * Encapsulates all logic for the status bar window state management. */ @@ -45,6 +48,7 @@ public class StatusBarWindowManager { private final boolean mKeyguardScreenRotation; private final State mCurrentState = new State(); + private boolean mLogState; public StatusBarWindowManager(Context context) { mContext = context; @@ -129,9 +133,7 @@ public class StatusBarWindowManager { } private void applyHeight(State state) { - boolean expanded = !state.forceCollapsed && (state.isKeyguardShowingAndNotOccluded() - || state.panelVisible || state.keyguardFadingAway || state.bouncerShowing - || state.headsUpShowing); + boolean expanded = isExpanded(state); if (expanded) { mLpChanged.height = ViewGroup.LayoutParams.MATCH_PARENT; } else { @@ -139,6 +141,12 @@ public class StatusBarWindowManager { } } + private boolean isExpanded(State state) { + return !state.forceCollapsed && (state.isKeyguardShowingAndNotOccluded() + || state.panelVisible || state.keyguardFadingAway || state.bouncerShowing + || state.headsUpShowing); + } + private void applyFitsSystemWindows(State state) { mStatusBarView.setFitsSystemWindows(!state.isKeyguardShowingAndNotOccluded()); } @@ -176,6 +184,9 @@ public class StatusBarWindowManager { applyFitsSystemWindows(state); applyModalFlag(state); if (mLp.copyFrom(mLpChanged) != 0) { + if (PhoneStatusBar.DEBUG_EMPTY_KEYGUARD && mLogState) { + logCurrentState(); + } mWindowManager.updateViewLayout(mStatusBarView, mLp); } } @@ -272,6 +283,21 @@ public class StatusBarWindowManager { apply(mCurrentState); } + public void setLogState(boolean logState) { + mLogState = logState; + if (logState) { + Log.w(PhoneStatusBar.TAG, "===== Started logging WM state changes ====="); + logCurrentState(); + } else { + Log.w(PhoneStatusBar.TAG, "===== Finished logging WM state changes ====="); + } + } + + private void logCurrentState() { + Log.i(PhoneStatusBar.TAG, mCurrentState.toString() + + "\n Expanded: " + isExpanded(mCurrentState)); + } + private static class State { boolean keyguardShowing; boolean keyguardOccluded; @@ -294,5 +320,31 @@ public class StatusBarWindowManager { private boolean isKeyguardShowingAndNotOccluded() { return keyguardShowing && !keyguardOccluded; } + + @Override + public String toString() { + StringBuilder result = new StringBuilder(); + String newLine = "\n"; + result.append("Window State {"); + result.append(newLine); + + Field[] fields = this.getClass().getDeclaredFields(); + + // Print field names paired with their values + for (Field field : fields) { + result.append(" "); + try { + result.append(field.getName()); + result.append(": "); + //requires access to private field: + result.append(field.get(this)); + } catch (IllegalAccessException ex) { + } + result.append(newLine); + } + result.append("}"); + + return result.toString(); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index 3b91751..6a8f8ee 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -171,7 +171,6 @@ public class StatusBarWindowView extends FrameLayout { if (mNotificationPanel.isFullyExpanded() && mStackScrollLayout.getVisibility() == View.VISIBLE && mService.getBarState() == StatusBarState.KEYGUARD - && !mService.isQsExpanded() && !mService.isBouncerShowing()) { intercept = mDragDownHelper.onInterceptTouchEvent(ev); // wake up on a touch down event, if dozing @@ -195,7 +194,7 @@ public class StatusBarWindowView extends FrameLayout { @Override public boolean onTouchEvent(MotionEvent ev) { boolean handled = false; - if (mService.getBarState() == StatusBarState.KEYGUARD && !mService.isQsExpanded()) { + if (mService.getBarState() == StatusBarState.KEYGUARD) { handled = mDragDownHelper.onTouchEvent(ev); } if (!handled) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 4ae800f..d8f6bcd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -225,6 +225,7 @@ public class NotificationStackScrollLayout extends ViewGroup private HeadsUpManager mHeadsUpManager; private boolean mTrackingHeadsUp; private ScrimController mScrimController; + private boolean mForceNoOverlappingRendering; public NotificationStackScrollLayout(Context context) { this(context, null); @@ -811,8 +812,7 @@ public class NotificationStackScrollLayout extends ViewGroup } handleEmptySpaceClick(ev); boolean expandWantsIt = false; - if (mIsExpanded && !mSwipingInProgress && !mOnlyScrollingInThisMotion - && isScrollingEnabled()) { + if (mIsExpanded && !mSwipingInProgress && !mOnlyScrollingInThisMotion) { if (isCancelOrUp) { mExpandHelper.onlyObserveMovements(false); } @@ -1566,7 +1566,7 @@ public class NotificationStackScrollLayout extends ViewGroup initDownStates(ev); handleEmptySpaceClick(ev); boolean expandWantsIt = false; - if (!mSwipingInProgress && !mOnlyScrollingInThisMotion && isScrollingEnabled()) { + if (!mSwipingInProgress && !mOnlyScrollingInThisMotion) { expandWantsIt = mExpandHelper.onInterceptTouchEvent(ev); } boolean scrollWantsIt = false; @@ -2267,11 +2267,11 @@ public class NotificationStackScrollLayout extends ViewGroup private void updateScrollPositionOnExpandInBottom(ExpandableView view) { if (view instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) view; - if (row.isUserLocked()) { + if (row.isUserLocked() && row != getFirstChildNotGone()) { // We are actually expanding this view float endPosition = row.getTranslationY() + row.getActualHeight(); int stackEnd = mMaxLayoutHeight - mBottomStackPeekSize - - mBottomStackSlowDownHeight; + mBottomStackSlowDownHeight + (int) mStackTranslation; if (endPosition > stackEnd) { mOwnScrollY += endPosition - stackEnd; mDisallowScrollingInThisMotion = true; @@ -2614,7 +2614,7 @@ public class NotificationStackScrollLayout extends ViewGroup } } - private boolean isBelowLastNotification(float touchX, float touchY) { + public boolean isBelowLastNotification(float touchX, float touchY) { int childCount = getChildCount(); for (int i = childCount - 1; i >= 0; i--) { ExpandableView child = (ExpandableView) getChildAt(i); @@ -2640,7 +2640,7 @@ public class NotificationStackScrollLayout extends ViewGroup } } } - return touchY > mIntrinsicPadding; + return touchY > mTopPadding + mStackTranslation; } private void updateExpandButtons() { @@ -2732,6 +2732,15 @@ public class NotificationStackScrollLayout extends ViewGroup mScrimController = scrimController; } + public void forceNoOverlappingRendering(boolean force) { + mForceNoOverlappingRendering = force; + } + + @Override + public boolean hasOverlappingRendering() { + return !mForceNoOverlappingRendering && super.hasOverlappingRendering(); + } + /** * A listener that is notified when some child locations might have changed. */ |
