Search in sources :

Example 16 with ExpandableView

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

the class NotificationStackScrollLayout method updateContentHeight.

private void updateContentHeight() {
    int height = 0;
    float previousIncreasedAmount = 0.0f;
    for (int i = 0; i < getChildCount(); i++) {
        ExpandableView expandableView = (ExpandableView) getChildAt(i);
        if (expandableView.getVisibility() != View.GONE) {
            float increasedPaddingAmount = expandableView.getIncreasedPaddingAmount();
            if (height != 0) {
                height += (int) NotificationUtils.interpolate(mPaddingBetweenElements, mIncreasedPaddingBetweenElements, Math.max(previousIncreasedAmount, increasedPaddingAmount));
            }
            previousIncreasedAmount = increasedPaddingAmount;
            height += expandableView.getIntrinsicHeight();
        }
    }
    mContentHeight = height + mTopPadding;
    updateScrollability();
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Example 17 with ExpandableView

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

the class NotificationStackScrollLayout method handleDismissAllClipping.

private void handleDismissAllClipping() {
    final int count = getChildCount();
    boolean previousChildWillBeDismissed = false;
    for (int i = 0; i < count; i++) {
        ExpandableView child = (ExpandableView) getChildAt(i);
        if (child.getVisibility() == GONE) {
            continue;
        }
        if (mDismissAllInProgress && previousChildWillBeDismissed) {
            child.setMinClipTopAmount(child.getClipTopAmount());
        } else {
            child.setMinClipTopAmount(0);
        }
        previousChildWillBeDismissed = canChildBeDismissed(child);
    }
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Example 18 with ExpandableView

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

the class NotificationStackScrollLayout method getNotGoneChildCount.

/**
     * @return the number of children which have visibility unequal to GONE
     */
public int getNotGoneChildCount() {
    int childCount = getChildCount();
    int count = 0;
    for (int i = 0; i < childCount; i++) {
        ExpandableView child = (ExpandableView) getChildAt(i);
        if (child.getVisibility() != View.GONE && !child.willBeGone()) {
            count++;
        }
    }
    return count;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Example 19 with ExpandableView

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

the class NotificationStackScrollLayout method isBelowLastNotification.

public boolean isBelowLastNotification(float touchX, float touchY) {
    int childCount = getChildCount();
    for (int i = childCount - 1; i >= 0; i--) {
        ExpandableView child = (ExpandableView) getChildAt(i);
        if (child.getVisibility() != View.GONE) {
            float childTop = child.getY();
            if (childTop > touchY) {
                // we are above a notification entirely let's abort
                return false;
            }
            boolean belowChild = touchY > childTop + child.getActualHeight();
            if (child == mDismissView) {
                if (!belowChild && !mDismissView.isOnEmptySpace(touchX - mDismissView.getX(), touchY - childTop)) {
                    // We clicked on the dismiss button
                    return false;
                }
            } else if (child == mEmptyShadeView) {
                // We arrived at the empty shade view, for which we accept all clicks
                return true;
            } else if (!belowChild) {
                // We are on a child
                return false;
            }
        }
    }
    return touchY > mTopPadding + mStackTranslation;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Example 20 with ExpandableView

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

the class NotificationStackScrollLayout method getPositionInLinearLayout.

private int getPositionInLinearLayout(View requestedView) {
    ExpandableNotificationRow childInGroup = null;
    ExpandableNotificationRow requestedRow = null;
    if (isChildInGroup(requestedView)) {
        // We're asking for a child in a group. Calculate the position of the parent first,
        // then within the parent.
        childInGroup = (ExpandableNotificationRow) requestedView;
        requestedView = requestedRow = childInGroup.getNotificationParent();
    }
    int position = 0;
    float previousIncreasedAmount = 0.0f;
    for (int i = 0; i < getChildCount(); i++) {
        ExpandableView child = (ExpandableView) getChildAt(i);
        boolean notGone = child.getVisibility() != View.GONE;
        if (notGone) {
            float increasedPaddingAmount = child.getIncreasedPaddingAmount();
            if (position != 0) {
                position += (int) NotificationUtils.interpolate(mPaddingBetweenElements, mIncreasedPaddingBetweenElements, Math.max(previousIncreasedAmount, increasedPaddingAmount));
            }
            previousIncreasedAmount = increasedPaddingAmount;
        }
        if (child == requestedView) {
            if (requestedRow != null) {
                position += requestedRow.getPositionOfChild(childInGroup);
            }
            return position;
        }
        if (notGone) {
            position += getIntrinsicHeight(child);
        }
    }
    return 0;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

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