Search in sources :

Example 11 with ActivatableNotificationView

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

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 12 with ActivatableNotificationView

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

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 13 with ActivatableNotificationView

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

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 14 with ActivatableNotificationView

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

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)

Example 15 with ActivatableNotificationView

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

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