Search in sources :

Example 56 with ExpandableNotificationRow

use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.

the class NotificationPanelView method computeMaxKeyguardNotifications.

/**
     * @param maximum the maximum to return at most
     * @return the maximum keyguard notifications that can fit on the screen
     */
public int computeMaxKeyguardNotifications(int maximum) {
    float minPadding = mClockPositionAlgorithm.getMinStackScrollerPadding(getHeight(), mKeyguardStatusView.getHeight());
    int notificationPadding = Math.max(1, getResources().getDimensionPixelSize(R.dimen.notification_divider_height));
    final int overflowheight = getResources().getDimensionPixelSize(R.dimen.notification_summary_height);
    float bottomStackSize = mNotificationStackScroller.getKeyguardBottomStackSize();
    float availableSpace = mNotificationStackScroller.getHeight() - minPadding - overflowheight - bottomStackSize;
    int count = 0;
    for (int i = 0; i < mNotificationStackScroller.getChildCount(); i++) {
        ExpandableView child = (ExpandableView) mNotificationStackScroller.getChildAt(i);
        if (!(child instanceof ExpandableNotificationRow)) {
            continue;
        }
        ExpandableNotificationRow row = (ExpandableNotificationRow) child;
        boolean suppressedSummary = mGroupManager.isSummaryOfSuppressedGroup(row.getStatusBarNotification());
        if (suppressedSummary) {
            continue;
        }
        if (!mStatusBar.shouldShowOnKeyguard(row.getStatusBarNotification())) {
            continue;
        }
        if (row.isRemoved()) {
            continue;
        }
        availableSpace -= child.getMinHeight() + notificationPadding;
        if (availableSpace >= 0 && count < maximum) {
            count++;
        } else {
            return count;
        }
    }
    return count;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 57 with ExpandableNotificationRow

use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.

the class NotificationStackScrollLayout method onHeightChanged.

@Override
public void onHeightChanged(ExpandableView view, boolean needsAnimation) {
    updateContentHeight();
    updateScrollPositionOnExpandInBottom(view);
    clampScrollPosition();
    notifyHeightChangeListener(view);
    ExpandableNotificationRow row = view instanceof ExpandableNotificationRow ? (ExpandableNotificationRow) view : null;
    if (row != null && (row == mFirstVisibleBackgroundChild || row.getNotificationParent() == mFirstVisibleBackgroundChild)) {
        updateAlgorithmLayoutMinHeight();
    }
    if (needsAnimation) {
        requestAnimationOnViewResize(row);
    }
    requestChildrenUpdate();
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 58 with ExpandableNotificationRow

use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.

the class NotificationStackScrollLayout method updateChronometerForChild.

private void updateChronometerForChild(View child) {
    if (child instanceof ExpandableNotificationRow) {
        ExpandableNotificationRow row = (ExpandableNotificationRow) child;
        row.setChronometerRunning(mIsExpanded);
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 59 with ExpandableNotificationRow

use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.

the class StackScrollAlgorithm method updateClipping.

private void updateClipping(StackScrollState resultState, StackScrollAlgorithmState algorithmState, AmbientState ambientState) {
    float drawStart = ambientState.getTopPadding() + ambientState.getStackTranslation();
    float previousNotificationEnd = 0;
    float previousNotificationStart = 0;
    int childCount = algorithmState.visibleChildren.size();
    for (int i = 0; i < childCount; i++) {
        ExpandableView child = algorithmState.visibleChildren.get(i);
        StackViewState state = resultState.getViewStateForView(child);
        if (!child.mustStayOnScreen()) {
            previousNotificationEnd = Math.max(drawStart, previousNotificationEnd);
            previousNotificationStart = Math.max(drawStart, previousNotificationStart);
        }
        float newYTranslation = state.yTranslation;
        float newHeight = state.height;
        float newNotificationEnd = newYTranslation + newHeight;
        boolean isHeadsUp = (child instanceof ExpandableNotificationRow) && ((ExpandableNotificationRow) child).isPinned();
        if (newYTranslation < previousNotificationEnd && (!isHeadsUp || ambientState.isShadeExpanded())) {
            // The previous view is overlapping on top, clip!
            float overlapAmount = previousNotificationEnd - newYTranslation;
            state.clipTopAmount = (int) overlapAmount;
        } else {
            state.clipTopAmount = 0;
        }
        if (!child.isTransparent()) {
            // Only update the previous values if we are not transparent,
            // otherwise we would clip to a transparent view.
            previousNotificationEnd = newNotificationEnd;
            previousNotificationStart = newYTranslation;
        }
    }
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 60 with ExpandableNotificationRow

use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.

the class StackScrollState method resetViewStates.

public void resetViewStates() {
    int numChildren = mHostView.getChildCount();
    for (int i = 0; i < numChildren; i++) {
        ExpandableView child = (ExpandableView) mHostView.getChildAt(i);
        resetViewState(child);
        // handling reset for child notifications
        if (child instanceof ExpandableNotificationRow) {
            ExpandableNotificationRow row = (ExpandableNotificationRow) child;
            List<ExpandableNotificationRow> children = row.getNotificationChildren();
            if (row.isSummaryWithChildren() && children != null) {
                for (ExpandableNotificationRow childRow : children) {
                    resetViewState(childRow);
                }
            }
        }
    }
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) 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