use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.
the class NotificationChildrenContainer method getPositionInLinearLayout.
public int getPositionInLinearLayout(View childInGroup) {
int position = mNotificationHeaderMargin + mNotificatonTopPadding;
for (int i = 0; i < mChildren.size(); i++) {
ExpandableNotificationRow child = mChildren.get(i);
boolean notGone = child.getVisibility() != View.GONE;
if (notGone) {
position += mDividerHeight;
}
if (child == childInGroup) {
return position;
}
if (notGone) {
position += child.getIntrinsicHeight();
}
}
return 0;
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.
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 android_frameworks_base by ResurrectionRemix.
the class NotificationChildrenContainer method startAnimationToState.
public void startAnimationToState(StackScrollState state, StackStateAnimator stateAnimator, long baseDelay, long duration) {
int childCount = mChildren.size();
ViewState tmpState = new ViewState();
float expandFraction = getGroupExpandFraction();
final boolean dividersVisible = mUserLocked || mNotificationParent.isGroupExpansionChanging();
for (int i = childCount - 1; i >= 0; i--) {
ExpandableNotificationRow child = mChildren.get(i);
StackViewState viewState = state.getViewStateForView(child);
stateAnimator.startStackAnimations(child, viewState, state, -1, baseDelay);
// 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;
stateAnimator.startViewAnimations(divider, tmpState, baseDelay, duration);
// There is no fake shadow to be drawn on the children
child.setFakeShadowIntensity(0.0f, 0.0f, 0, 0);
}
if (mOverflowNumber != null) {
if (mNeverAppliedGroupState) {
float alpha = mGroupOverFlowState.alpha;
mGroupOverFlowState.alpha = 0;
state.applyViewState(mOverflowNumber, mGroupOverFlowState);
mGroupOverFlowState.alpha = alpha;
mNeverAppliedGroupState = false;
}
stateAnimator.startViewAnimations(mOverflowNumber, mGroupOverFlowState, baseDelay, duration);
}
if (mNotificationHeader != null) {
state.applyViewState(mNotificationHeader, mHeaderViewState);
}
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.
the class NotificationChildrenContainer method onMeasure.
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int ownMaxHeight = mMaxNotificationHeight;
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY;
boolean isHeightLimited = heightMode == MeasureSpec.AT_MOST;
int size = MeasureSpec.getSize(heightMeasureSpec);
if (hasFixedHeight || isHeightLimited) {
ownMaxHeight = Math.min(ownMaxHeight, size);
}
int newHeightSpec = MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.AT_MOST);
int width = MeasureSpec.getSize(widthMeasureSpec);
if (mOverflowNumber != null) {
mOverflowNumber.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), newHeightSpec);
}
int dividerHeightSpec = MeasureSpec.makeMeasureSpec(mDividerHeight, MeasureSpec.EXACTLY);
int height = mNotificationHeaderMargin + mNotificatonTopPadding;
int childCount = Math.min(mChildren.size(), NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED);
int collapsedChildren = getMaxAllowedVisibleChildren(true);
int overflowIndex = childCount > collapsedChildren ? collapsedChildren - 1 : -1;
for (int i = 0; i < childCount; i++) {
ExpandableNotificationRow child = mChildren.get(i);
// We need to measure all children even the GONE ones, such that the heights are
// calculated correctly as they are used to calculate how many we can fit on the screen.
boolean isOverflow = i == overflowIndex;
child.setSingleLineWidthIndention(isOverflow && mOverflowNumber != null ? mOverflowNumber.getMeasuredWidth() : 0);
child.measure(widthMeasureSpec, newHeightSpec);
// layout the divider
View divider = mDividers.get(i);
divider.measure(widthMeasureSpec, dividerHeightSpec);
if (child.getVisibility() != GONE) {
height += child.getMeasuredHeight() + mDividerHeight;
}
}
mRealHeight = height;
if (heightMode != MeasureSpec.UNSPECIFIED) {
height = Math.min(height, size);
}
if (mNotificationHeader != null) {
int headerHeightSpec = MeasureSpec.makeMeasureSpec(mHeaderHeight, MeasureSpec.EXACTLY);
mNotificationHeader.measure(widthMeasureSpec, headerHeightSpec);
}
setMeasuredDimension(width, height);
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project android_frameworks_base by ResurrectionRemix.
the class NotificationChildrenContainer method getViewAtPosition.
public ExpandableNotificationRow getViewAtPosition(float y) {
// find the view under the pointer, accounting for GONE views
final int count = mChildren.size();
for (int childIdx = 0; childIdx < count; childIdx++) {
ExpandableNotificationRow slidingChild = mChildren.get(childIdx);
float childTop = slidingChild.getTranslationY();
float top = childTop + slidingChild.getClipTopAmount();
float bottom = childTop + slidingChild.getActualHeight();
if (y >= top && y <= bottom) {
return slidingChild;
}
}
return null;
}
Aggregations