Search in sources :

Example 31 with ExpandableNotificationRow

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

the class PhoneStatusBar method goToLockedShade.

/**
     * If secure with redaction: Show bouncer, go to unlocked shade.
     *
     * <p>If secure without redaction or no security: Go to {@link StatusBarState#SHADE_LOCKED}.</p>
     *
     * @param expandView The view to expand after going to the shade.
     */
public void goToLockedShade(View expandView) {
    ExpandableNotificationRow row = null;
    if (expandView instanceof ExpandableNotificationRow) {
        row = (ExpandableNotificationRow) expandView;
        row.setUserExpanded(true, /* userExpanded */
        true);
        // Indicate that the group expansion is changing at this time -- this way the group
        // and children backgrounds / divider animations will look correct.
        row.setGroupExpansionChanging(true);
    }
    boolean fullShadeNeedsBouncer = !userAllowsPrivateNotificationsInPublic(mCurrentUserId) || !mShowLockscreenNotifications || mFalsingManager.shouldEnforceBouncer();
    if (isLockscreenPublicMode() && fullShadeNeedsBouncer) {
        mLeaveOpenOnKeyguardHide = true;
        showBouncer();
        mDraggedDownRow = row;
        mPendingRemoteInputView = null;
    } else {
        mNotificationPanel.animateToFullShade(0);
        setBarState(StatusBarState.SHADE_LOCKED);
        updateKeyguardState(false, /* goingToFullShade */
        false);
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 32 with ExpandableNotificationRow

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

the class PhoneStatusBar method addNotificationChildrenAndSort.

private void addNotificationChildrenAndSort() {
    // Let's now add all notification children which are missing
    boolean orderChanged = false;
    for (int i = 0; i < mStackScroller.getChildCount(); i++) {
        View view = mStackScroller.getChildAt(i);
        if (!(view instanceof ExpandableNotificationRow)) {
            // We don't care about non-notification views.
            continue;
        }
        ExpandableNotificationRow parent = (ExpandableNotificationRow) view;
        List<ExpandableNotificationRow> children = parent.getNotificationChildren();
        List<ExpandableNotificationRow> orderedChildren = mTmpChildOrderMap.get(parent);
        for (int childIndex = 0; orderedChildren != null && childIndex < orderedChildren.size(); childIndex++) {
            ExpandableNotificationRow childView = orderedChildren.get(childIndex);
            if (children == null || !children.contains(childView)) {
                parent.addChildNotification(childView, childIndex);
                mStackScroller.notifyGroupChildAdded(childView);
            }
        }
        // Finally after removing and adding has been beformed we can apply the order.
        orderChanged |= parent.applyChildOrder(orderedChildren);
    }
    if (orderChanged) {
        mStackScroller.generateChildOrderChangedEvent();
    }
}
Also used : ImageView(android.widget.ImageView) ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView) BatteryMeterView(com.android.systemui.BatteryMeterView) BackDropView(com.android.systemui.statusbar.BackDropView) DismissView(com.android.systemui.statusbar.DismissView) EmptyShadeView(com.android.systemui.statusbar.EmptyShadeView) View(android.view.View) TextView(android.widget.TextView) ScrimView(com.android.systemui.statusbar.ScrimView) SignalClusterView(com.android.systemui.statusbar.SignalClusterView) Point(android.graphics.Point) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 33 with ExpandableNotificationRow

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

the class HeadsUpManager method onComputeInternalInsets.

public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info) {
    if (mIsExpanded || mBar.isBouncerShowing()) {
        // The touchable region is always the full area when expanded
        return;
    }
    if (mHasPinnedNotification) {
        ExpandableNotificationRow topEntry = getTopEntry().entry.row;
        if (topEntry.isChildInGroup()) {
            final ExpandableNotificationRow groupSummary = mGroupManager.getGroupSummary(topEntry.getStatusBarNotification());
            if (groupSummary != null) {
                topEntry = groupSummary;
            }
        }
        topEntry.getLocationOnScreen(mTmpTwoArray);
        int minX = mTmpTwoArray[0];
        int maxX = mTmpTwoArray[0] + topEntry.getWidth();
        int maxY = topEntry.getIntrinsicHeight();
        info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
        info.touchableRegion.set(minX, 0, maxX, maxY);
    } else if (mHeadsUpGoingAway || mWaitingOnCollapseWhenGoingAway) {
        info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
        info.touchableRegion.set(0, 0, mStatusBarWindowView.getWidth(), mStatusBarHeight);
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 34 with ExpandableNotificationRow

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

the class HeadsUpManager method getTopHeadsUpPinnedHeight.

/**
     * @return the height of the top heads up notification when pinned. This is different from the
     *         intrinsic height, which also includes whether the notification is system expanded and
     *         is mainly used when dragging down from a heads up notification.
     */
public int getTopHeadsUpPinnedHeight() {
    HeadsUpEntry topEntry = getTopEntry();
    if (topEntry == null || topEntry.entry == null) {
        return 0;
    }
    ExpandableNotificationRow row = topEntry.entry.row;
    if (row.isChildInGroup()) {
        final ExpandableNotificationRow groupSummary = mGroupManager.getGroupSummary(row.getStatusBarNotification());
        if (groupSummary != null) {
            row = groupSummary;
        }
    }
    return row.getPinnedHeadsUpHeight(true);
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 35 with ExpandableNotificationRow

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

the class PhoneStatusBar method onDraggedDown.

// ---------------------- DragDownHelper.OnDragDownListener ------------------------------------
/* Only ever called as a consequence of a lockscreen expansion gesture. */
@Override
public boolean onDraggedDown(View startingChild, int dragLengthY) {
    if (hasActiveNotifications()) {
        EventLogTags.writeSysuiLockscreenGesture(EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_FULL_SHADE, (int) (dragLengthY / mDisplayMetrics.density), 0);
        // We have notifications, go to locked shade.
        goToLockedShade(startingChild);
        if (startingChild instanceof ExpandableNotificationRow) {
            ExpandableNotificationRow row = (ExpandableNotificationRow) startingChild;
            row.onExpandedByGesture(true);
        }
        return true;
    } else {
        // No notifications - abort gesture.
        return false;
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Aggregations

ExpandableNotificationRow (com.android.systemui.statusbar.ExpandableNotificationRow)290 View (android.view.View)75 ExpandableView (com.android.systemui.statusbar.ExpandableView)75 TextView (android.widget.TextView)55 ActivatableNotificationView (com.android.systemui.statusbar.ActivatableNotificationView)45 DismissView (com.android.systemui.statusbar.DismissView)45 EmptyShadeView (com.android.systemui.statusbar.EmptyShadeView)45 Paint (android.graphics.Paint)40 ImageView (android.widget.ImageView)35 Point (android.graphics.Point)30 BatteryMeterView (com.android.systemui.BatteryMeterView)30 BackDropView (com.android.systemui.statusbar.BackDropView)30 ScrimView (com.android.systemui.statusbar.ScrimView)30 SignalClusterView (com.android.systemui.statusbar.SignalClusterView)30 NotificationHeaderView (android.view.NotificationHeaderView)25 BatteryLevelTextView (com.android.systemui.BatteryLevelTextView)24 KeyButtonView (com.android.systemui.statusbar.policy.KeyButtonView)24 StackScrollerDecorView (com.android.systemui.statusbar.StackScrollerDecorView)20 FakeShadowView (com.android.systemui.statusbar.notification.FakeShadowView)20 HybridNotificationView (com.android.systemui.statusbar.notification.HybridNotificationView)20