Search in sources :

Example 86 with ExpandableView

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

the class NotificationPanelView method onHeightChanged.

@Override
public void onHeightChanged(ExpandableView view, boolean needsAnimation) {
    // (i.e. view == null).
    if (view == null && mQsExpanded) {
        return;
    }
    ExpandableView firstChildNotGone = mNotificationStackScroller.getFirstChildNotGone();
    ExpandableNotificationRow firstRow = firstChildNotGone instanceof ExpandableNotificationRow ? (ExpandableNotificationRow) firstChildNotGone : null;
    if (firstRow != null && (view == firstRow || (firstRow.getNotificationParent() == firstRow))) {
        requestScrollerTopPaddingUpdate(false);
    }
    requestPanelHeightUpdate();
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 87 with ExpandableView

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

the class StackStateAnimator method findLastNotAddedIndex.

private int findLastNotAddedIndex(StackScrollState finalState) {
    int childCount = mHostLayout.getChildCount();
    for (int i = childCount - 1; i >= 0; i--) {
        final ExpandableView child = (ExpandableView) mHostLayout.getChildAt(i);
        StackViewState viewState = finalState.getViewStateForView(child);
        if (viewState == null || child.getVisibility() == View.GONE) {
            continue;
        }
        if (!mNewAddChildren.contains(child)) {
            return viewState.notGoneIndex;
        }
    }
    return -1;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView)

Example 88 with ExpandableView

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

the class StackScrollAlgorithm method updateZValuesForState.

/**
     * Calculate the Z positions for all children based on the number of items in both stacks and
     * save it in the resultState
     *  @param resultState The result state to update the zTranslation values
     * @param algorithmState The state in which the current pass of the algorithm is currently in
     * @param ambientState The ambient state of the algorithm
     */
private void updateZValuesForState(StackScrollState resultState, StackScrollAlgorithmState algorithmState, AmbientState ambientState) {
    int childCount = algorithmState.visibleChildren.size();
    float childrenOnTop = 0.0f;
    for (int i = childCount - 1; i >= 0; i--) {
        ExpandableView child = algorithmState.visibleChildren.get(i);
        StackViewState childViewState = resultState.getViewStateForView(child);
        if (i > (childCount - 1 - algorithmState.itemsInBottomStack)) {
            // We are in the bottom stack
            float numItemsAbove = i - (childCount - 1 - algorithmState.itemsInBottomStack);
            float zSubtraction;
            if (numItemsAbove <= 1.0f) {
                float factor = 0.2f;
                // Lets fade in slower to the threshold to make the shadow fade in look nicer
                if (numItemsAbove <= factor) {
                    zSubtraction = FakeShadowView.SHADOW_SIBLING_TRESHOLD * numItemsAbove * (1.0f / factor);
                } else {
                    zSubtraction = FakeShadowView.SHADOW_SIBLING_TRESHOLD + (numItemsAbove - factor) * (1.0f / (1.0f - factor)) * (mZDistanceBetweenElements - FakeShadowView.SHADOW_SIBLING_TRESHOLD);
                }
            } else {
                zSubtraction = numItemsAbove * mZDistanceBetweenElements;
            }
            childViewState.zTranslation = mZBasicHeight - zSubtraction;
        } else if (child.mustStayOnScreen() && childViewState.yTranslation < ambientState.getTopPadding() + ambientState.getStackTranslation()) {
            if (childrenOnTop != 0.0f) {
                childrenOnTop++;
            } else {
                float overlap = ambientState.getTopPadding() + ambientState.getStackTranslation() - childViewState.yTranslation;
                childrenOnTop += Math.min(1.0f, overlap / childViewState.height);
            }
            childViewState.zTranslation = mZBasicHeight + childrenOnTop * mZDistanceBetweenElements;
        } else {
            childViewState.zTranslation = mZBasicHeight;
        }
    }
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView)

Example 89 with ExpandableView

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

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)

Example 90 with ExpandableView

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

the class StackScrollState method apply.

/**
     * Apply the properties saved in {@link #mStateMap} to the children of the {@link #mHostView}.
     * The properties are only applied if they effectively changed.
     */
public void apply() {
    int numChildren = mHostView.getChildCount();
    for (int i = 0; i < numChildren; i++) {
        ExpandableView child = (ExpandableView) mHostView.getChildAt(i);
        StackViewState state = mStateMap.get(child);
        if (!applyState(child, state)) {
            continue;
        }
        if (child instanceof DismissView) {
            DismissView dismissView = (DismissView) child;
            boolean visible = state.clipTopAmount < mClearAllTopPadding;
            dismissView.performVisibilityAnimation(visible && !dismissView.willBeGone());
        } else if (child instanceof EmptyShadeView) {
            EmptyShadeView emptyShadeView = (EmptyShadeView) child;
            boolean visible = state.clipTopAmount <= 0;
            emptyShadeView.performVisibilityAnimation(visible && !emptyShadeView.willBeGone());
        }
    }
}
Also used : EmptyShadeView(com.android.systemui.statusbar.EmptyShadeView) DismissView(com.android.systemui.statusbar.DismissView) ExpandableView(com.android.systemui.statusbar.ExpandableView)

Aggregations

ExpandableView (com.android.systemui.statusbar.ExpandableView)172 Paint (android.graphics.Paint)92 ExpandableNotificationRow (com.android.systemui.statusbar.ExpandableNotificationRow)55 StackScrollerDecorView (com.android.systemui.statusbar.StackScrollerDecorView)15 DismissView (com.android.systemui.statusbar.DismissView)10 EmptyShadeView (com.android.systemui.statusbar.EmptyShadeView)10 View (android.view.View)5 ViewGroup (android.view.ViewGroup)5 ViewParent (android.view.ViewParent)5 ScrollView (android.widget.ScrollView)5 ActivatableNotificationView (com.android.systemui.statusbar.ActivatableNotificationView)5 FakeShadowView (com.android.systemui.statusbar.notification.FakeShadowView)5 ScrollContainer (com.android.systemui.statusbar.stack.ScrollContainer)5