use of com.android.systemui.statusbar.ExpandableNotificationRow in project platform_frameworks_base by android.
the class PhoneStatusBar method goToLockedShade.
/**
* If secure with redaction: Show bouncer, go to unlocked shade.
*
* <p>If secure without redaction or no security: Go to {@link StatusBarState#SHADE_LOCKED}.</p>
*
* @param expandView The view to expand after going to the shade.
*/
public void goToLockedShade(View expandView) {
ExpandableNotificationRow row = null;
if (expandView instanceof ExpandableNotificationRow) {
row = (ExpandableNotificationRow) expandView;
row.setUserExpanded(true, /* userExpanded */
true);
// Indicate that the group expansion is changing at this time -- this way the group
// and children backgrounds / divider animations will look correct.
row.setGroupExpansionChanging(true);
}
boolean fullShadeNeedsBouncer = !userAllowsPrivateNotificationsInPublic(mCurrentUserId) || !mShowLockscreenNotifications || mFalsingManager.shouldEnforceBouncer();
if (isLockscreenPublicMode() && fullShadeNeedsBouncer) {
mLeaveOpenOnKeyguardHide = true;
showBouncer();
mDraggedDownRow = row;
mPendingRemoteInputView = null;
} else {
mNotificationPanel.animateToFullShade(0);
setBarState(StatusBarState.SHADE_LOCKED);
updateKeyguardState(false, /* goingToFullShade */
false);
}
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project platform_frameworks_base by android.
the class PhoneStatusBar method addNotificationChildrenAndSort.
private void addNotificationChildrenAndSort() {
// Let's now add all notification children which are missing
boolean orderChanged = false;
for (int i = 0; i < mStackScroller.getChildCount(); i++) {
View view = mStackScroller.getChildAt(i);
if (!(view instanceof ExpandableNotificationRow)) {
// We don't care about non-notification views.
continue;
}
ExpandableNotificationRow parent = (ExpandableNotificationRow) view;
List<ExpandableNotificationRow> children = parent.getNotificationChildren();
List<ExpandableNotificationRow> orderedChildren = mTmpChildOrderMap.get(parent);
for (int childIndex = 0; orderedChildren != null && childIndex < orderedChildren.size(); childIndex++) {
ExpandableNotificationRow childView = orderedChildren.get(childIndex);
if (children == null || !children.contains(childView)) {
parent.addChildNotification(childView, childIndex);
mStackScroller.notifyGroupChildAdded(childView);
}
}
// Finally after removing and adding has been beformed we can apply the order.
orderChanged |= parent.applyChildOrder(orderedChildren);
}
if (orderChanged) {
mStackScroller.generateChildOrderChangedEvent();
}
}
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);
}
}
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);
}
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;
}
}
Aggregations