use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by DirtyUnicorns.
the class NotificationChildrenContainer method applyState.
public void applyState(StackScrollState state) {
int childCount = mChildren.size();
ViewState tmpState = new ViewState();
float expandFraction = 0.0f;
if (mUserLocked) {
expandFraction = getGroupExpandFraction();
}
final boolean dividersVisible = mUserLocked || mNotificationParent.isGroupExpansionChanging();
for (int i = 0; i < childCount; i++) {
ExpandableNotificationRow child = mChildren.get(i);
StackViewState viewState = state.getViewStateForView(child);
state.applyState(child, viewState);
// 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;
state.applyViewState(divider, tmpState);
// There is no fake shadow to be drawn on the children
child.setFakeShadowIntensity(0.0f, 0.0f, 0, 0);
}
if (mOverflowNumber != null) {
state.applyViewState(mOverflowNumber, mGroupOverFlowState);
mNeverAppliedGroupState = false;
}
if (mNotificationHeader != null) {
state.applyViewState(mNotificationHeader, mHeaderViewState);
}
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by DirtyUnicorns.
the class NotificationChildrenContainer method updateExpansionStates.
private void updateExpansionStates() {
if (mChildrenExpanded || mUserLocked) {
// we don't modify it the group is expanded or if we are expanding it
return;
}
int size = mChildren.size();
for (int i = 0; i < size; i++) {
ExpandableNotificationRow child = mChildren.get(i);
child.setSystemChildExpanded(i == 0 && size == 1);
}
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by DirtyUnicorns.
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;
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by AOSPA.
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 android_frameworks_base by AOSPA.
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);
}
Aggregations