use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class NotificationStackScrollLayout method updateContentHeight.
private void updateContentHeight() {
int height = 0;
float previousIncreasedAmount = 0.0f;
for (int i = 0; i < getChildCount(); i++) {
ExpandableView expandableView = (ExpandableView) getChildAt(i);
if (expandableView.getVisibility() != View.GONE) {
float increasedPaddingAmount = expandableView.getIncreasedPaddingAmount();
if (height != 0) {
height += (int) NotificationUtils.interpolate(mPaddingBetweenElements, mIncreasedPaddingBetweenElements, Math.max(previousIncreasedAmount, increasedPaddingAmount));
}
previousIncreasedAmount = increasedPaddingAmount;
height += expandableView.getIntrinsicHeight();
}
}
mContentHeight = height + mTopPadding;
updateScrollability();
}
use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class NotificationStackScrollLayout method handleDismissAllClipping.
private void handleDismissAllClipping() {
final int count = getChildCount();
boolean previousChildWillBeDismissed = false;
for (int i = 0; i < count; i++) {
ExpandableView child = (ExpandableView) getChildAt(i);
if (child.getVisibility() == GONE) {
continue;
}
if (mDismissAllInProgress && previousChildWillBeDismissed) {
child.setMinClipTopAmount(child.getClipTopAmount());
} else {
child.setMinClipTopAmount(0);
}
previousChildWillBeDismissed = canChildBeDismissed(child);
}
}
use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class NotificationStackScrollLayout method getNotGoneChildCount.
/**
* @return the number of children which have visibility unequal to GONE
*/
public int getNotGoneChildCount() {
int childCount = getChildCount();
int count = 0;
for (int i = 0; i < childCount; i++) {
ExpandableView child = (ExpandableView) getChildAt(i);
if (child.getVisibility() != View.GONE && !child.willBeGone()) {
count++;
}
}
return count;
}
use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class NotificationStackScrollLayout method isBelowLastNotification.
public boolean isBelowLastNotification(float touchX, float touchY) {
int childCount = getChildCount();
for (int i = childCount - 1; i >= 0; i--) {
ExpandableView child = (ExpandableView) getChildAt(i);
if (child.getVisibility() != View.GONE) {
float childTop = child.getY();
if (childTop > touchY) {
// we are above a notification entirely let's abort
return false;
}
boolean belowChild = touchY > childTop + child.getActualHeight();
if (child == mDismissView) {
if (!belowChild && !mDismissView.isOnEmptySpace(touchX - mDismissView.getX(), touchY - childTop)) {
// We clicked on the dismiss button
return false;
}
} else if (child == mEmptyShadeView) {
// We arrived at the empty shade view, for which we accept all clicks
return true;
} else if (!belowChild) {
// We are on a child
return false;
}
}
}
return touchY > mTopPadding + mStackTranslation;
}
use of com.android.systemui.statusbar.ExpandableView 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;
}
Aggregations