Search in sources :

Example 61 with ExpandableView

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

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

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

the class NotificationStackScrollLayout method onExpansionStopped.

public void onExpansionStopped() {
    mIsExpansionChanging = false;
    if (!mIsExpanded) {
        setOwnScrollY(0);
        mPhoneStatusBar.resetUserExpandedStates();
        // lets make sure nothing is in the overlay / transient anymore
        clearTemporaryViews(this);
        for (int i = 0; i < getChildCount(); i++) {
            ExpandableView child = (ExpandableView) getChildAt(i);
            if (child instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow row = (ExpandableNotificationRow) child;
                clearTemporaryViews(row.getChildrenContainer());
            }
        }
    }
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 63 with ExpandableView

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

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

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

the class NotificationStackScrollLayout method updateViewShadows.

private void updateViewShadows() {
    // Lefts first sort by Z difference
    for (int i = 0; i < getChildCount(); i++) {
        ExpandableView child = (ExpandableView) getChildAt(i);
        if (child.getVisibility() != GONE) {
            mTmpSortedChildren.add(child);
        }
    }
    Collections.sort(mTmpSortedChildren, mViewPositionComparator);
    // Now lets update the shadow for the views
    ExpandableView previous = null;
    for (int i = 0; i < mTmpSortedChildren.size(); i++) {
        ExpandableView expandableView = mTmpSortedChildren.get(i);
        float translationZ = expandableView.getTranslationZ();
        float otherZ = previous == null ? translationZ : previous.getTranslationZ();
        float diff = otherZ - translationZ;
        if (diff <= 0.0f || diff >= FakeShadowView.SHADOW_SIBLING_TRESHOLD) {
            // There is no fake shadow to be drawn
            expandableView.setFakeShadowIntensity(0.0f, 0.0f, 0, 0);
        } else {
            float yLocation = previous.getTranslationY() + previous.getActualHeight() - expandableView.getTranslationY() - previous.getExtraBottomPadding();
            expandableView.setFakeShadowIntensity(diff / FakeShadowView.SHADOW_SIBLING_TRESHOLD, previous.getOutlineAlpha(), (int) yLocation, previous.getOutlineTranslation());
        }
        previous = expandableView;
    }
    mTmpSortedChildren.clear();
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) Paint(android.graphics.Paint)

Example 65 with ExpandableView

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

the class NotificationStackScrollLayout method onViewRemovedInternal.

private void onViewRemovedInternal(View child, ViewGroup container) {
    if (mChangePositionInProgress) {
        // This is only a position change, don't do anything special
        return;
    }
    ExpandableView expandableView = (ExpandableView) child;
    expandableView.setOnHeightChangedListener(null);
    mCurrentStackScrollState.removeViewStateForView(child);
    updateScrollStateForRemovedChild(expandableView);
    boolean animationGenerated = generateRemoveAnimation(child);
    if (animationGenerated) {
        if (!mSwipedOutViews.contains(child)) {
            container.getOverlay().add(child);
        } else if (Math.abs(expandableView.getTranslation()) != expandableView.getWidth()) {
            container.addTransientView(child, 0);
            expandableView.setTransientContainer(container);
        }
    } else {
        mSwipedOutViews.remove(child);
    }
    updateAnimationState(false, child);
    // Make sure the clipRect we might have set is removed
    expandableView.setClipTopAmount(0);
    focusNextViewIfFocused(child);
}
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