Search in sources :

Example 46 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method getPositionInLinearLayout.

public int getPositionInLinearLayout(View childInGroup) {
    int position = mNotificationHeaderMargin + mNotificatonTopPadding;
    for (int i = 0; i < mChildren.size(); i++) {
        ExpandableNotificationRow child = mChildren.get(i);
        boolean notGone = child.getVisibility() != View.GONE;
        if (notGone) {
            position += mDividerHeight;
        }
        if (child == childInGroup) {
            return position;
        }
        if (notGone) {
            position += child.getIntrinsicHeight();
        }
    }
    return 0;
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 47 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method setUserLocked.

public void setUserLocked(boolean userLocked) {
    mUserLocked = userLocked;
    int childCount = mChildren.size();
    for (int i = 0; i < childCount; i++) {
        ExpandableNotificationRow child = mChildren.get(i);
        child.setUserLocked(userLocked);
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 48 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method startAnimationToState.

public void startAnimationToState(StackScrollState state, StackStateAnimator stateAnimator, long baseDelay, long duration) {
    int childCount = mChildren.size();
    ViewState tmpState = new ViewState();
    float expandFraction = getGroupExpandFraction();
    final boolean dividersVisible = mUserLocked || mNotificationParent.isGroupExpansionChanging();
    for (int i = childCount - 1; i >= 0; i--) {
        ExpandableNotificationRow child = mChildren.get(i);
        StackViewState viewState = state.getViewStateForView(child);
        stateAnimator.startStackAnimations(child, viewState, state, -1, baseDelay);
        // layout the divider
        View divider = mDividers.get(i);
        tmpState.initFrom(divider);
        tmpState.yTranslation = viewState.yTranslation - mDividerHeight;
        float alpha = mChildrenExpanded && viewState.alpha != 0 ? 0.5f : 0;
        if (mUserLocked && viewState.alpha != 0) {
            alpha = NotificationUtils.interpolate(0, 0.5f, Math.min(viewState.alpha, expandFraction));
        }
        tmpState.hidden = !dividersVisible;
        tmpState.alpha = alpha;
        stateAnimator.startViewAnimations(divider, tmpState, baseDelay, duration);
        // There is no fake shadow to be drawn on the children
        child.setFakeShadowIntensity(0.0f, 0.0f, 0, 0);
    }
    if (mOverflowNumber != null) {
        if (mNeverAppliedGroupState) {
            float alpha = mGroupOverFlowState.alpha;
            mGroupOverFlowState.alpha = 0;
            state.applyViewState(mOverflowNumber, mGroupOverFlowState);
            mGroupOverFlowState.alpha = alpha;
            mNeverAppliedGroupState = false;
        }
        stateAnimator.startViewAnimations(mOverflowNumber, mGroupOverFlowState, baseDelay, duration);
    }
    if (mNotificationHeader != null) {
        state.applyViewState(mNotificationHeader, mHeaderViewState);
    }
}
Also used : View(android.view.View) HybridNotificationView(com.android.systemui.statusbar.notification.HybridNotificationView) TextView(android.widget.TextView) NotificationPanelView(com.android.systemui.statusbar.phone.NotificationPanelView) NotificationHeaderView(android.view.NotificationHeaderView) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 49 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method onMeasure.

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int ownMaxHeight = mMaxNotificationHeight;
    int heightMode = MeasureSpec.getMode(heightMeasureSpec);
    boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY;
    boolean isHeightLimited = heightMode == MeasureSpec.AT_MOST;
    int size = MeasureSpec.getSize(heightMeasureSpec);
    if (hasFixedHeight || isHeightLimited) {
        ownMaxHeight = Math.min(ownMaxHeight, size);
    }
    int newHeightSpec = MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.AT_MOST);
    int width = MeasureSpec.getSize(widthMeasureSpec);
    if (mOverflowNumber != null) {
        mOverflowNumber.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), newHeightSpec);
    }
    int dividerHeightSpec = MeasureSpec.makeMeasureSpec(mDividerHeight, MeasureSpec.EXACTLY);
    int height = mNotificationHeaderMargin + mNotificatonTopPadding;
    int childCount = Math.min(mChildren.size(), NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED);
    int collapsedChildren = getMaxAllowedVisibleChildren(true);
    int overflowIndex = childCount > collapsedChildren ? collapsedChildren - 1 : -1;
    for (int i = 0; i < childCount; i++) {
        ExpandableNotificationRow child = mChildren.get(i);
        // We need to measure all children even the GONE ones, such that the heights are
        // calculated correctly as they are used to calculate how many we can fit on the screen.
        boolean isOverflow = i == overflowIndex;
        child.setSingleLineWidthIndention(isOverflow && mOverflowNumber != null ? mOverflowNumber.getMeasuredWidth() : 0);
        child.measure(widthMeasureSpec, newHeightSpec);
        // layout the divider
        View divider = mDividers.get(i);
        divider.measure(widthMeasureSpec, dividerHeightSpec);
        if (child.getVisibility() != GONE) {
            height += child.getMeasuredHeight() + mDividerHeight;
        }
    }
    mRealHeight = height;
    if (heightMode != MeasureSpec.UNSPECIFIED) {
        height = Math.min(height, size);
    }
    if (mNotificationHeader != null) {
        int headerHeightSpec = MeasureSpec.makeMeasureSpec(mHeaderHeight, MeasureSpec.EXACTLY);
        mNotificationHeader.measure(widthMeasureSpec, headerHeightSpec);
    }
    setMeasuredDimension(width, height);
}
Also used : View(android.view.View) HybridNotificationView(com.android.systemui.statusbar.notification.HybridNotificationView) TextView(android.widget.TextView) NotificationPanelView(com.android.systemui.statusbar.phone.NotificationPanelView) NotificationHeaderView(android.view.NotificationHeaderView) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 50 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method getViewAtPosition.

public ExpandableNotificationRow getViewAtPosition(float y) {
    // find the view under the pointer, accounting for GONE views
    final int count = mChildren.size();
    for (int childIdx = 0; childIdx < count; childIdx++) {
        ExpandableNotificationRow slidingChild = mChildren.get(childIdx);
        float childTop = slidingChild.getTranslationY();
        float top = childTop + slidingChild.getClipTopAmount();
        float bottom = childTop + slidingChild.getActualHeight();
        if (y >= top && y <= bottom) {
            return slidingChild;
        }
    }
    return null;
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Aggregations

ExpandableNotificationRow (com.android.systemui.statusbar.ExpandableNotificationRow)290 View (android.view.View)75 ExpandableView (com.android.systemui.statusbar.ExpandableView)75 TextView (android.widget.TextView)55 ActivatableNotificationView (com.android.systemui.statusbar.ActivatableNotificationView)45 DismissView (com.android.systemui.statusbar.DismissView)45 EmptyShadeView (com.android.systemui.statusbar.EmptyShadeView)45 Paint (android.graphics.Paint)40 ImageView (android.widget.ImageView)35 Point (android.graphics.Point)30 BatteryMeterView (com.android.systemui.BatteryMeterView)30 BackDropView (com.android.systemui.statusbar.BackDropView)30 ScrimView (com.android.systemui.statusbar.ScrimView)30 SignalClusterView (com.android.systemui.statusbar.SignalClusterView)30 NotificationHeaderView (android.view.NotificationHeaderView)25 BatteryLevelTextView (com.android.systemui.BatteryLevelTextView)24 KeyButtonView (com.android.systemui.statusbar.policy.KeyButtonView)24 StackScrollerDecorView (com.android.systemui.statusbar.StackScrollerDecorView)20 FakeShadowView (com.android.systemui.statusbar.notification.FakeShadowView)20 HybridNotificationView (com.android.systemui.statusbar.notification.HybridNotificationView)20