Search in sources :

Example 1 with ActivatableNotificationView

use of com.android.systemui.statusbar.ActivatableNotificationView in project platform_frameworks_base by android.

the class PhoneStatusBar method onActivated.

@Override
public void onActivated(ActivatableNotificationView view) {
    EventLogTags.writeSysuiLockscreenGesture(EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_TAP_NOTIFICATION_ACTIVATE, 0, /* lengthDp - N/A */
    0);
    mKeyguardIndicationController.showTransientIndication(R.string.notification_tap_again);
    ActivatableNotificationView previousView = mStackScroller.getActivatedChild();
    if (previousView != null) {
        previousView.makeInactive(true);
    }
    mStackScroller.setActivatedChild(view);
}
Also used : ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView)

Example 2 with ActivatableNotificationView

use of com.android.systemui.statusbar.ActivatableNotificationView in project platform_frameworks_base by android.

the class PhoneStatusBar method updateStackScrollerState.

public void updateStackScrollerState(boolean goingToFullShade, boolean fromShadeLocked) {
    if (mStackScroller == null)
        return;
    boolean onKeyguard = mState == StatusBarState.KEYGUARD;
    mStackScroller.setHideSensitive(isLockscreenPublicMode(), goingToFullShade);
    mStackScroller.setDimmed(onKeyguard, fromShadeLocked);
    mStackScroller.setExpandingEnabled(!onKeyguard);
    ActivatableNotificationView activatedChild = mStackScroller.getActivatedChild();
    mStackScroller.setActivatedChild(null);
    if (activatedChild != null) {
        activatedChild.makeInactive(false);
    }
}
Also used : ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView)

Example 3 with ActivatableNotificationView

use of com.android.systemui.statusbar.ActivatableNotificationView in project platform_frameworks_base by android.

the class NotificationStackScrollLayout method updateFirstAndLastBackgroundViews.

private void updateFirstAndLastBackgroundViews() {
    ActivatableNotificationView firstChild = getFirstChildWithBackground();
    ActivatableNotificationView lastChild = getLastChildWithBackground();
    if (mAnimationsEnabled && mIsExpanded) {
        mAnimateNextBackgroundTop = firstChild != mFirstVisibleBackgroundChild;
        mAnimateNextBackgroundBottom = lastChild != mLastVisibleBackgroundChild;
    } else {
        mAnimateNextBackgroundTop = false;
        mAnimateNextBackgroundBottom = false;
    }
    mFirstVisibleBackgroundChild = firstChild;
    mLastVisibleBackgroundChild = lastChild;
}
Also used : ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView)

Example 4 with ActivatableNotificationView

use of com.android.systemui.statusbar.ActivatableNotificationView in project android_frameworks_base by DirtyUnicorns.

the class PhoneStatusBar method onActivated.

@Override
public void onActivated(ActivatableNotificationView view) {
    EventLogTags.writeSysuiLockscreenGesture(EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_TAP_NOTIFICATION_ACTIVATE, 0, /* lengthDp - N/A */
    0);
    mKeyguardIndicationController.showTransientIndication(R.string.notification_tap_again);
    ActivatableNotificationView previousView = mStackScroller.getActivatedChild();
    if (previousView != null) {
        previousView.makeInactive(true);
    }
    mStackScroller.setActivatedChild(view);
}
Also used : ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView)

Example 5 with ActivatableNotificationView

use of com.android.systemui.statusbar.ActivatableNotificationView in project android_frameworks_base by DirtyUnicorns.

the class NotificationStackScrollLayout method updateBackgroundBounds.

/**
     * Update the background bounds to the new desired bounds
     */
private void updateBackgroundBounds() {
    mBackgroundBounds.left = (int) getX();
    mBackgroundBounds.right = (int) (getX() + getWidth());
    if (!mIsExpanded) {
        mBackgroundBounds.top = 0;
        mBackgroundBounds.bottom = 0;
        return;
    }
    ActivatableNotificationView firstView = mFirstVisibleBackgroundChild;
    int top = 0;
    if (firstView != null) {
        int finalTranslationY = (int) StackStateAnimator.getFinalTranslationY(firstView);
        if (mAnimateNextBackgroundTop || mTopAnimator == null && mCurrentBounds.top == finalTranslationY || mTopAnimator != null && mEndAnimationRect.top == finalTranslationY) {
            // we're ending up at the same location as we are now, lets just skip the animation
            top = finalTranslationY;
        } else {
            top = (int) firstView.getTranslationY();
        }
    }
    ActivatableNotificationView lastView = mLastVisibleBackgroundChild;
    int bottom = 0;
    if (lastView != null) {
        int finalTranslationY = (int) StackStateAnimator.getFinalTranslationY(lastView);
        int finalHeight = StackStateAnimator.getFinalActualHeight(lastView);
        int finalBottom = finalTranslationY + finalHeight;
        finalBottom = Math.min(finalBottom, getHeight());
        if (mAnimateNextBackgroundBottom || mBottomAnimator == null && mCurrentBounds.bottom == finalBottom || mBottomAnimator != null && mEndAnimationRect.bottom == finalBottom) {
            // we're ending up at the same location as we are now, lets just skip the animation
            bottom = finalBottom;
        } else {
            bottom = (int) (lastView.getTranslationY() + lastView.getActualHeight());
            bottom = Math.min(bottom, getHeight());
        }
    } else {
        top = mTopPadding;
        bottom = top;
    }
    if (mPhoneStatusBar.getBarState() != StatusBarState.KEYGUARD) {
        top = (int) Math.max(mTopPadding + mStackTranslation, top);
    } else {
        // otherwise the animation from the shade to the keyguard will jump as it's maxed
        top = Math.max(0, top);
    }
    mBackgroundBounds.top = top;
    mBackgroundBounds.bottom = Math.min(getHeight(), Math.max(bottom, top));
}
Also used : ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView) Paint(android.graphics.Paint)

Aggregations

ActivatableNotificationView (com.android.systemui.statusbar.ActivatableNotificationView)20 Paint (android.graphics.Paint)5