Search in sources :

Example 16 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method getViewAtPosition.

public ExpandableNotificationRow getViewAtPosition(float y) {
    // find the view under the pointer, accounting for GONE views
    final int count = mChildren.size();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableNotificationRow slidingChild = mChildren.get(childIdx);
        float childTop = slidingChild.getTranslationY();
        float top = childTop + slidingChild.getClipTopAmount();
        float bottom = childTop + slidingChild.getActualHeight();
        if (y >= top && y <= bottom) {
            return slidingChild;
        }
    }
    return null;
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 17 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method getPositionInLinearLayout.

public int getPositionInLinearLayout(View childInGroup) {
    int position = mNotificationHeaderMargin + mNotificatonTopPadding;
    for (int i = 0; i < mChildren.size(); i++) {
        ExpandableNotificationRow child = mChildren.get(i);
        boolean notGone = child.getVisibility() != View.GONE;
        if (notGone) {
            position += mDividerHeight;
        }
        if (child == childInGroup) {
            return position;
        }
        if (notGone) {
            position += child.getIntrinsicHeight();
        }
    }
    return 0;
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 18 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method setChildrenExpanded.

public void setChildrenExpanded(boolean childrenExpanded) {
    mChildrenExpanded = childrenExpanded;
    updateExpansionStates();
    if (mNotificationHeader != null) {
        mNotificationHeader.setExpanded(childrenExpanded);
    }
    final int count = mChildren.size();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableNotificationRow child = mChildren.get(childIdx);
        child.setChildrenExpanded(childrenExpanded, false);
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 19 with ExpandableNotificationRow

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

the class StackScrollAlgorithm method getNotificationChildrenStates.

private void getNotificationChildrenStates(StackScrollState resultState, StackScrollAlgorithmState algorithmState) {
    int childCount = algorithmState.visibleChildren.size();
    for (int i = 0; i < childCount; i++) {
        ExpandableView v = algorithmState.visibleChildren.get(i);
        if (v instanceof ExpandableNotificationRow) {
            ExpandableNotificationRow row = (ExpandableNotificationRow) v;
            row.getChildrenStates(resultState);
        }
    }
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 20 with ExpandableNotificationRow

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

the class StackScrollAlgorithm method initAlgorithmState.

/**
     * Initialize the algorithm state like updating the visible children.
     */
private void initAlgorithmState(StackScrollState resultState, StackScrollAlgorithmState state, AmbientState ambientState) {
    state.itemsInBottomStack = 0.0f;
    state.partialInBottom = 0.0f;
    float bottomOverScroll = ambientState.getOverScrollAmount(false);
    int scrollY = ambientState.getScrollY();
    // Due to the overScroller, the stackscroller can have negative scroll state. This is
    // already accounted for by the top padding and doesn't need an additional adaption
    scrollY = Math.max(0, scrollY);
    state.scrollY = (int) (scrollY + bottomOverScroll);
    //now init the visible children and update paddings
    ViewGroup hostView = resultState.getHostView();
    int childCount = hostView.getChildCount();
    state.visibleChildren.clear();
    state.visibleChildren.ensureCapacity(childCount);
    state.increasedPaddingMap.clear();
    int notGoneIndex = 0;
    ExpandableView lastView = null;
    for (int i = 0; i < childCount; i++) {
        ExpandableView v = (ExpandableView) hostView.getChildAt(i);
        if (v.getVisibility() != View.GONE) {
            notGoneIndex = updateNotGoneIndex(resultState, state, notGoneIndex, v);
            float increasedPadding = v.getIncreasedPaddingAmount();
            if (increasedPadding != 0.0f) {
                state.increasedPaddingMap.put(v, increasedPadding);
                if (lastView != null) {
                    Float prevValue = state.increasedPaddingMap.get(lastView);
                    float newValue = prevValue != null ? Math.max(prevValue, increasedPadding) : increasedPadding;
                    state.increasedPaddingMap.put(lastView, newValue);
                }
            }
            if (v instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow row = (ExpandableNotificationRow) v;
                // handle the notgoneIndex for the children as well
                List<ExpandableNotificationRow> children = row.getNotificationChildren();
                if (row.isSummaryWithChildren() && children != null) {
                    for (ExpandableNotificationRow childRow : children) {
                        if (childRow.getVisibility() != View.GONE) {
                            StackViewState childState = resultState.getViewStateForView(childRow);
                            childState.notGoneIndex = notGoneIndex;
                            notGoneIndex++;
                        }
                    }
                }
            }
            lastView = v;
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) 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