Search in sources :

Example 91 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method setActualHeight.

public void setActualHeight(int actualHeight) {
    if (!mUserLocked) {
        return;
    }
    mActualHeight = actualHeight;
    float fraction = getGroupExpandFraction();
    int maxAllowedVisibleChildren = getMaxAllowedVisibleChildren(true);
    int childCount = mChildren.size();
    for (int i = 0; i < childCount; i++) {
        ExpandableNotificationRow child = mChildren.get(i);
        float childHeight = child.isExpanded(true) ? child.getMaxExpandHeight() : child.getShowingLayout().getMinHeight(true);
        if (i < maxAllowedVisibleChildren) {
            float singleLineHeight = child.getShowingLayout().getMinHeight(false);
            child.setActualHeight((int) NotificationUtils.interpolate(singleLineHeight, childHeight, fraction), false);
        } else {
            child.setActualHeight((int) childHeight, false);
        }
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 92 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method applyState.

public void applyState(StackScrollState state) {
    int childCount = mChildren.size();
    ViewState tmpState = new ViewState();
    float expandFraction = 0.0f;
    if (mUserLocked) {
        expandFraction = getGroupExpandFraction();
    }
    final boolean dividersVisible = mUserLocked || mNotificationParent.isGroupExpansionChanging();
    for (int i = 0; i < childCount; i++) {
        ExpandableNotificationRow child = mChildren.get(i);
        StackViewState viewState = state.getViewStateForView(child);
        state.applyState(child, viewState);
        // layout the divider
        View divider = mDividers.get(i);
        tmpState.initFrom(divider);
        tmpState.yTranslation = viewState.yTranslation - mDividerHeight;
        float alpha = mChildrenExpanded && viewState.alpha != 0 ? 0.5f : 0;
        if (mUserLocked && viewState.alpha != 0) {
            alpha = NotificationUtils.interpolate(0, 0.5f, Math.min(viewState.alpha, expandFraction));
        }
        tmpState.hidden = !dividersVisible;
        tmpState.alpha = alpha;
        state.applyViewState(divider, tmpState);
        // There is no fake shadow to be drawn on the children
        child.setFakeShadowIntensity(0.0f, 0.0f, 0, 0);
    }
    if (mOverflowNumber != null) {
        state.applyViewState(mOverflowNumber, mGroupOverFlowState);
        mNeverAppliedGroupState = false;
    }
    if (mNotificationHeader != null) {
        state.applyViewState(mNotificationHeader, mHeaderViewState);
    }
}
Also used : View(android.view.View) HybridNotificationView(com.android.systemui.statusbar.notification.HybridNotificationView) TextView(android.widget.TextView) NotificationPanelView(com.android.systemui.statusbar.phone.NotificationPanelView) NotificationHeaderView(android.view.NotificationHeaderView) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 93 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method updateExpansionStates.

private void updateExpansionStates() {
    if (mChildrenExpanded || mUserLocked) {
        // we don't modify it the group is expanded or if we are expanding it
        return;
    }
    int size = mChildren.size();
    for (int i = 0; i < size; i++) {
        ExpandableNotificationRow child = mChildren.get(i);
        child.setSystemChildExpanded(i == 0 && size == 1);
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 94 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method getVisibleChildrenExpandHeight.

private int getVisibleChildrenExpandHeight() {
    int intrinsicHeight = mNotificationHeaderMargin + mNotificatonTopPadding + mDividerHeight;
    int visibleChildren = 0;
    int childCount = mChildren.size();
    int maxAllowedVisibleChildren = getMaxAllowedVisibleChildren(true);
    for (int i = 0; i < childCount; i++) {
        if (visibleChildren >= maxAllowedVisibleChildren) {
            break;
        }
        ExpandableNotificationRow child = mChildren.get(i);
        float childHeight = child.isExpanded(true) ? child.getMaxExpandHeight() : child.getShowingLayout().getMinHeight(true);
        intrinsicHeight += childHeight;
        visibleChildren++;
    }
    return intrinsicHeight;
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 95 with ExpandableNotificationRow

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

the class PhoneStatusBar method removeNotificationChildren.

private void removeNotificationChildren() {
    // First let's remove all children which don't belong in the parents
    ArrayList<ExpandableNotificationRow> toRemove = new ArrayList<>();
    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);
        if (children != null) {
            toRemove.clear();
            for (ExpandableNotificationRow childRow : children) {
                if ((orderedChildren == null || !orderedChildren.contains(childRow)) && !childRow.keepInParent()) {
                    toRemove.add(childRow);
                }
            }
            for (ExpandableNotificationRow remove : toRemove) {
                parent.removeChildNotification(remove);
                if (mNotificationData.get(remove.getStatusBarNotification().getKey()) == null) {
                    // We only want to add an animation if the view is completely removed
                    // otherwise it's just a transfer
                    mStackScroller.notifyGroupChildRemoved(remove, parent.getChildrenContainer());
                }
            }
        }
    }
}
Also used : ArrayList(java.util.ArrayList) ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView) BatteryMeterView(com.android.systemui.BatteryMeterView) DismissView(com.android.systemui.statusbar.DismissView) SignalClusterView(com.android.systemui.statusbar.SignalClusterView) ImageView(android.widget.ImageView) BatteryLevelTextView(com.android.systemui.BatteryLevelTextView) BackDropView(com.android.systemui.statusbar.BackDropView) KeyButtonView(com.android.systemui.statusbar.policy.KeyButtonView) EmptyShadeView(com.android.systemui.statusbar.EmptyShadeView) View(android.view.View) TextView(android.widget.TextView) ScrimView(com.android.systemui.statusbar.ScrimView) Point(android.graphics.Point) 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