Search in sources :

Example 11 with ExpandableView

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

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)

Example 12 with ExpandableView

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

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 13 with ExpandableView

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

the class NotificationStackScrollLayout method getViewBeforeView.

/**
     * @return the child before the given view which has visibility unequal to GONE
     */
public ExpandableView getViewBeforeView(ExpandableView view) {
    ExpandableView previousView = null;
    int childCount = getChildCount();
    for (int i = 0; i < childCount; i++) {
        View child = getChildAt(i);
        if (child == view) {
            return previousView;
        }
        if (child.getVisibility() != View.GONE) {
            previousView = (ExpandableView) child;
        }
    }
    return null;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) EmptyShadeView(com.android.systemui.statusbar.EmptyShadeView) ActivatableNotificationView(com.android.systemui.statusbar.ActivatableNotificationView) FakeShadowView(com.android.systemui.statusbar.notification.FakeShadowView) View(android.view.View) StackScrollerDecorView(com.android.systemui.statusbar.StackScrollerDecorView) ExpandableView(com.android.systemui.statusbar.ExpandableView) DismissView(com.android.systemui.statusbar.DismissView) ScrollView(android.widget.ScrollView) Paint(android.graphics.Paint)

Example 14 with ExpandableView

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

the class NotificationStackScrollLayout method getChildAtPosition.

@Override
public ExpandableView getChildAtPosition(float touchX, float touchY) {
    // find the view under the pointer, accounting for GONE views
    final int count = getChildCount();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
        if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView) {
            continue;
        }
        float childTop = slidingChild.getTranslationY();
        float top = childTop + slidingChild.getClipTopAmount();
        float bottom = childTop + slidingChild.getActualHeight();
        // Allow the full width of this view to prevent gesture conflict on Keyguard (phone and
        // camera affordance).
        int left = 0;
        int right = getWidth();
        if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
            if (slidingChild instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
                if (!mIsExpanded && row.isHeadsUp() && row.isPinned() && mHeadsUpManager.getTopEntry().entry.row != row && mGroupManager.getGroupSummary(mHeadsUpManager.getTopEntry().entry.row.getStatusBarNotification()) != row) {
                    continue;
                }
                return row.getViewAtPosition(touchY - childTop);
            }
            return slidingChild;
        }
    }
    return null;
}
Also used : StackScrollerDecorView(com.android.systemui.statusbar.StackScrollerDecorView) ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 15 with ExpandableView

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

the class NotificationStackScrollLayout method updateHideSensitiveForChild.

private void updateHideSensitiveForChild(View child) {
    if (child instanceof ExpandableView) {
        ExpandableView expandableView = (ExpandableView) child;
        expandableView.setHideSensitiveForIntrinsicHeight(mAmbientState.isHideSensitive());
    }
}
Also used : 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