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;
}
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;
}
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);
}
}
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);
}
}
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;
}
Aggregations