Search in sources :

Example 21 with ExpandableNotificationRow

use of com.android.systemui.statusbar.ExpandableNotificationRow 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)

Example 22 with ExpandableNotificationRow

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

the class NotificationChildrenContainer method getVisibleChildrenExpandHeight.

private int getVisibleChildrenExpandHeight() {
    int intrinsicHeight = mNotificationHeaderMargin + mNotificatonTopPadding + mDividerHeight;
    int visibleChildren = 0;
    int childCount = mChildren.size();
    int maxAllowedVisibleChildren = getMaxAllowedVisibleChildren(true);
    for (int i = 0; i < childCount; i++) {
        if (visibleChildren >= maxAllowedVisibleChildren) {
            break;
        }
        ExpandableNotificationRow child = mChildren.get(i);
        float childHeight = child.isExpanded(true) ? child.getMaxExpandHeight() : child.getShowingLayout().getMinHeight(true);
        intrinsicHeight += childHeight;
        visibleChildren++;
    }
    return intrinsicHeight;
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 23 with ExpandableNotificationRow

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

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 24 with ExpandableNotificationRow

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

the class NotificationStackScrollLayout method updateChronometerForChild.

private void updateChronometerForChild(View child) {
    if (child instanceof ExpandableNotificationRow) {
        ExpandableNotificationRow row = (ExpandableNotificationRow) child;
        row.setChronometerRunning(mIsExpanded);
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 25 with ExpandableNotificationRow

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

the class NotificationStackScrollLayout method getMaxExpandHeight.

@Override
public int getMaxExpandHeight(ExpandableView view) {
    int maxContentHeight = view.getMaxContentHeight();
    if (view.isSummaryWithChildren() && view.getParent() == this) {
        // Faking a measure with the group expanded to simulate how the group would look if
        // it was. Doing a calculation here would be highly non-trivial because of the
        // algorithm
        mGroupExpandedForMeasure = true;
        ExpandableNotificationRow row = (ExpandableNotificationRow) view;
        mGroupManager.toggleGroupExpansion(row.getStatusBarNotification());
        row.setForceUnlocked(true);
        mAmbientState.setLayoutHeight(mMaxLayoutHeight);
        mStackScrollAlgorithm.getStackScrollState(mAmbientState, mCurrentStackScrollState);
        mAmbientState.setLayoutHeight(getLayoutHeight());
        mGroupManager.toggleGroupExpansion(row.getStatusBarNotification());
        mGroupExpandedForMeasure = false;
        row.setForceUnlocked(false);
        StackViewState viewState = mCurrentStackScrollState.getViewStateForView(view);
        if (viewState != null) {
            // The view could have been removed
            return Math.min(viewState.height, maxContentHeight);
        }
    }
    return maxContentHeight;
}
Also used : Paint(android.graphics.Paint) 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