Search in sources :

Example 26 with ExpandableView

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

the class NotificationStackScrollLayout method scrollTo.

@Override
public boolean scrollTo(View v) {
    ExpandableView expandableView = (ExpandableView) v;
    int positionInLinearLayout = getPositionInLinearLayout(v);
    int targetScroll = targetScrollForView(expandableView, positionInLinearLayout);
    int outOfViewScroll = positionInLinearLayout + expandableView.getIntrinsicHeight();
    // that it is not visible anymore.
    if (mOwnScrollY < targetScroll || outOfViewScroll < mOwnScrollY) {
        mScroller.startScroll(mScrollX, mOwnScrollY, 0, targetScroll - mOwnScrollY);
        mDontReportNextOverScroll = true;
        postInvalidateOnAnimation();
        return true;
    }
    return false;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Example 27 with ExpandableView

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

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)

Example 28 with ExpandableView

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

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

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

the class NotificationPanelView method computeMaxKeyguardNotifications.

/**
     * @param maximum the maximum to return at most
     * @return the maximum keyguard notifications that can fit on the screen
     */
public int computeMaxKeyguardNotifications(int maximum) {
    float minPadding = mClockPositionAlgorithm.getMinStackScrollerPadding(getHeight(), mKeyguardStatusView.getHeight());
    int notificationPadding = Math.max(1, getResources().getDimensionPixelSize(R.dimen.notification_divider_height));
    final int overflowheight = getResources().getDimensionPixelSize(R.dimen.notification_summary_height);
    float bottomStackSize = mNotificationStackScroller.getKeyguardBottomStackSize();
    float availableSpace = mNotificationStackScroller.getHeight() - minPadding - overflowheight - bottomStackSize;
    int count = 0;
    for (int i = 0; i < mNotificationStackScroller.getChildCount(); i++) {
        ExpandableView child = (ExpandableView) mNotificationStackScroller.getChildAt(i);
        if (!(child instanceof ExpandableNotificationRow)) {
            continue;
        }
        ExpandableNotificationRow row = (ExpandableNotificationRow) child;
        boolean suppressedSummary = mGroupManager.isSummaryOfSuppressedGroup(row.getStatusBarNotification());
        if (suppressedSummary) {
            continue;
        }
        if (!mStatusBar.shouldShowOnKeyguard(row.getStatusBarNotification())) {
            continue;
        }
        if (row.isRemoved()) {
            continue;
        }
        availableSpace -= child.getMinHeight() + notificationPadding;
        if (availableSpace >= 0 && count < maximum) {
            count++;
        } else {
            return count;
        }
    }
    return count;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 30 with ExpandableView

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

the class StackStateAnimator method startAnimationForEvents.

public void startAnimationForEvents(ArrayList<NotificationStackScrollLayout.AnimationEvent> mAnimationEvents, StackScrollState finalState, long additionalDelay) {
    processAnimationEvents(mAnimationEvents, finalState);
    int childCount = mHostLayout.getChildCount();
    mAnimationFilter.applyCombination(mNewEvents);
    mCurrentAdditionalDelay = additionalDelay;
    mCurrentLength = NotificationStackScrollLayout.AnimationEvent.combineLength(mNewEvents);
    mCurrentLastNotAddedIndex = findLastNotAddedIndex(finalState);
    for (int i = 0; i < childCount; i++) {
        final ExpandableView child = (ExpandableView) mHostLayout.getChildAt(i);
        StackViewState viewState = finalState.getViewStateForView(child);
        if (viewState == null || child.getVisibility() == View.GONE || applyWithoutAnimation(child, viewState, finalState)) {
            continue;
        }
        startStackAnimations(child, viewState, finalState, i, -1);
    }
    if (!isRunning()) {
        // no child has preformed any animation, lets finish
        onAnimationFinished();
    }
    mHeadsUpAppearChildren.clear();
    mHeadsUpDisappearChildren.clear();
    mNewEvents.clear();
    mNewAddChildren.clear();
}
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