Search in sources :

Example 6 with ExpandableNotificationRow

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

the class HeadsUpManager method onComputeInternalInsets.

public void onComputeInternalInsets(ViewTreeObserver.InternalInsetsInfo info) {
    if (mIsExpanded || mBar.isBouncerShowing()) {
        // The touchable region is always the full area when expanded
        return;
    }
    if (mHasPinnedNotification) {
        ExpandableNotificationRow topEntry = getTopEntry().entry.row;
        if (topEntry.isChildInGroup()) {
            final ExpandableNotificationRow groupSummary = mGroupManager.getGroupSummary(topEntry.getStatusBarNotification());
            if (groupSummary != null) {
                topEntry = groupSummary;
            }
        }
        topEntry.getLocationOnScreen(mTmpTwoArray);
        int minX = mTmpTwoArray[0];
        int maxX = mTmpTwoArray[0] + topEntry.getWidth();
        int maxY = topEntry.getIntrinsicHeight();
        info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
        info.touchableRegion.set(minX, 0, maxX, maxY);
    } else if (mHeadsUpGoingAway || mWaitingOnCollapseWhenGoingAway) {
        info.setTouchableInsets(ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION);
        info.touchableRegion.set(0, 0, mStatusBarWindowView.getWidth(), mStatusBarHeight);
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 7 with ExpandableNotificationRow

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

the class HeadsUpManager method getTopHeadsUpPinnedHeight.

/**
     * @return the height of the top heads up notification when pinned. This is different from the
     *         intrinsic height, which also includes whether the notification is system expanded and
     *         is mainly used when dragging down from a heads up notification.
     */
public int getTopHeadsUpPinnedHeight() {
    HeadsUpEntry topEntry = getTopEntry();
    if (topEntry == null || topEntry.entry == null) {
        return 0;
    }
    ExpandableNotificationRow row = topEntry.entry.row;
    if (row.isChildInGroup()) {
        final ExpandableNotificationRow groupSummary = mGroupManager.getGroupSummary(row.getStatusBarNotification());
        if (groupSummary != null) {
            row = groupSummary;
        }
    }
    return row.getPinnedHeadsUpHeight(true);
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 8 with ExpandableNotificationRow

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

the class PhoneStatusBar method onDraggedDown.

// ---------------------- DragDownHelper.OnDragDownListener ------------------------------------
/* Only ever called as a consequence of a lockscreen expansion gesture. */
@Override
public boolean onDraggedDown(View startingChild, int dragLengthY) {
    if (hasActiveNotifications()) {
        EventLogTags.writeSysuiLockscreenGesture(EventLogConstants.SYSUI_LOCKSCREEN_GESTURE_SWIPE_DOWN_FULL_SHADE, (int) (dragLengthY / mDisplayMetrics.density), 0);
        // We have notifications, go to locked shade.
        goToLockedShade(startingChild);
        if (startingChild instanceof ExpandableNotificationRow) {
            ExpandableNotificationRow row = (ExpandableNotificationRow) startingChild;
            row.onExpandedByGesture(true);
        }
        return true;
    } else {
        // No notifications - abort gesture.
        return false;
    }
}
Also used : ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 9 with ExpandableNotificationRow

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

the class TransformState method setClippingDeactivated.

public static void setClippingDeactivated(final View transformedView, boolean deactivated) {
    if (!(transformedView.getParent() instanceof ViewGroup)) {
        return;
    }
    ViewGroup view = (ViewGroup) transformedView.getParent();
    while (true) {
        ArraySet<View> clipSet = (ArraySet<View>) view.getTag(CLIP_CLIPPING_SET);
        if (clipSet == null) {
            clipSet = new ArraySet<>();
            view.setTag(CLIP_CLIPPING_SET, clipSet);
        }
        Boolean clipChildren = (Boolean) view.getTag(CLIP_CHILDREN_TAG);
        if (clipChildren == null) {
            clipChildren = view.getClipChildren();
            view.setTag(CLIP_CHILDREN_TAG, clipChildren);
        }
        Boolean clipToPadding = (Boolean) view.getTag(CLIP_TO_PADDING);
        if (clipToPadding == null) {
            clipToPadding = view.getClipToPadding();
            view.setTag(CLIP_TO_PADDING, clipToPadding);
        }
        ExpandableNotificationRow row = view instanceof ExpandableNotificationRow ? (ExpandableNotificationRow) view : null;
        if (!deactivated) {
            clipSet.remove(transformedView);
            if (clipSet.isEmpty()) {
                view.setClipChildren(clipChildren);
                view.setClipToPadding(clipToPadding);
                view.setTag(CLIP_CLIPPING_SET, null);
                if (row != null) {
                    row.setClipToActualHeight(true);
                }
            }
        } else {
            clipSet.add(transformedView);
            view.setClipChildren(false);
            view.setClipToPadding(false);
            if (row != null && row.isChildInGroup()) {
                // We still want to clip to the parent's height
                row.setClipToActualHeight(false);
            }
        }
        if (row != null && !row.isChildInGroup()) {
            return;
        }
        final ViewParent parent = view.getParent();
        if (parent instanceof ViewGroup) {
            view = (ViewGroup) parent;
        } else {
            return;
        }
    }
}
Also used : ArraySet(android.util.ArraySet) ViewGroup(android.view.ViewGroup) ViewParent(android.view.ViewParent) ImageView(android.widget.ImageView) TransformableView(com.android.systemui.statusbar.TransformableView) TextView(android.widget.TextView) View(android.view.View) NotificationHeaderView(android.view.NotificationHeaderView) ExpandableNotificationRow(com.android.systemui.statusbar.ExpandableNotificationRow)

Example 10 with ExpandableNotificationRow

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

the class HeadsUpTouchHelper method onInterceptTouchEvent.

@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
    if (!mTouchingHeadsUpView && event.getActionMasked() != MotionEvent.ACTION_DOWN) {
        return false;
    }
    int pointerIndex = event.findPointerIndex(mTrackingPointer);
    if (pointerIndex < 0) {
        pointerIndex = 0;
        mTrackingPointer = event.getPointerId(pointerIndex);
    }
    final float x = event.getX(pointerIndex);
    final float y = event.getY(pointerIndex);
    switch(event.getActionMasked()) {
        case MotionEvent.ACTION_DOWN:
            mInitialTouchY = y;
            mInitialTouchX = x;
            setTrackingHeadsUp(false);
            ExpandableView child = mStackScroller.getChildAtRawPosition(x, y);
            mTouchingHeadsUpView = false;
            if (child instanceof ExpandableNotificationRow) {
                mPickedChild = (ExpandableNotificationRow) child;
                mTouchingHeadsUpView = !mStackScroller.isExpanded() && mPickedChild.isHeadsUp() && mPickedChild.isPinned();
            }
            break;
        case MotionEvent.ACTION_POINTER_UP:
            final int upPointer = event.getPointerId(event.getActionIndex());
            if (mTrackingPointer == upPointer) {
                // gesture is ongoing, find a new pointer to track
                final int newIndex = event.getPointerId(0) != upPointer ? 0 : 1;
                mTrackingPointer = event.getPointerId(newIndex);
                mInitialTouchX = event.getX(newIndex);
                mInitialTouchY = event.getY(newIndex);
            }
            break;
        case MotionEvent.ACTION_MOVE:
            final float h = y - mInitialTouchY;
            if (mTouchingHeadsUpView && Math.abs(h) > mTouchSlop && Math.abs(h) > Math.abs(x - mInitialTouchX)) {
                setTrackingHeadsUp(true);
                mCollapseSnoozes = h < 0;
                mInitialTouchX = x;
                mInitialTouchY = y;
                int expandedHeight = mPickedChild.getActualHeight();
                mPanel.setPanelScrimMinFraction((float) expandedHeight / mPanel.getMaxPanelHeight());
                mPanel.startExpandMotion(x, y, true, /* startTracking */
                expandedHeight);
                // This call needs to be after the expansion start otherwise we will get a
                // flicker of one frame as it's not expanded yet.
                mHeadsUpManager.unpinAll();
                mPanel.clearNotificationEffects();
                return true;
            }
            break;
        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            if (mPickedChild != null && mTouchingHeadsUpView) {
                // We may swallow this click if the heads up just came in.
                if (mHeadsUpManager.shouldSwallowClick(mPickedChild.getStatusBarNotification().getKey())) {
                    endMotion();
                    return true;
                }
            }
            endMotion();
            break;
    }
    return false;
}
Also used : ExpandableView(com.android.systemui.statusbar.ExpandableView) 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