use of com.android.systemui.statusbar.ExpandableNotificationRow in project platform_frameworks_base by android.
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;
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project platform_frameworks_base by android.
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 platform_frameworks_base by android.
the class NotificationChildrenContainer method setChildrenExpanded.
public void setChildrenExpanded(boolean childrenExpanded) {
mChildrenExpanded = childrenExpanded;
updateExpansionStates();
if (mNotificationHeader != null) {
mNotificationHeader.setExpanded(childrenExpanded);
}
final int count = mChildren.size();
for (int childIdx = 0; childIdx < count; childIdx++) {
ExpandableNotificationRow child = mChildren.get(childIdx);
child.setChildrenExpanded(childrenExpanded, false);
}
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project platform_frameworks_base by android.
the class StackScrollAlgorithm method getNotificationChildrenStates.
private void getNotificationChildrenStates(StackScrollState resultState, StackScrollAlgorithmState algorithmState) {
int childCount = algorithmState.visibleChildren.size();
for (int i = 0; i < childCount; i++) {
ExpandableView v = algorithmState.visibleChildren.get(i);
if (v instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) v;
row.getChildrenStates(resultState);
}
}
}
use of com.android.systemui.statusbar.ExpandableNotificationRow in project platform_frameworks_base by android.
the class StackScrollAlgorithm method initAlgorithmState.
/**
* Initialize the algorithm state like updating the visible children.
*/
private void initAlgorithmState(StackScrollState resultState, StackScrollAlgorithmState state, AmbientState ambientState) {
state.itemsInBottomStack = 0.0f;
state.partialInBottom = 0.0f;
float bottomOverScroll = ambientState.getOverScrollAmount(false);
int scrollY = ambientState.getScrollY();
// Due to the overScroller, the stackscroller can have negative scroll state. This is
// already accounted for by the top padding and doesn't need an additional adaption
scrollY = Math.max(0, scrollY);
state.scrollY = (int) (scrollY + bottomOverScroll);
//now init the visible children and update paddings
ViewGroup hostView = resultState.getHostView();
int childCount = hostView.getChildCount();
state.visibleChildren.clear();
state.visibleChildren.ensureCapacity(childCount);
state.increasedPaddingMap.clear();
int notGoneIndex = 0;
ExpandableView lastView = null;
for (int i = 0; i < childCount; i++) {
ExpandableView v = (ExpandableView) hostView.getChildAt(i);
if (v.getVisibility() != View.GONE) {
notGoneIndex = updateNotGoneIndex(resultState, state, notGoneIndex, v);
float increasedPadding = v.getIncreasedPaddingAmount();
if (increasedPadding != 0.0f) {
state.increasedPaddingMap.put(v, increasedPadding);
if (lastView != null) {
Float prevValue = state.increasedPaddingMap.get(lastView);
float newValue = prevValue != null ? Math.max(prevValue, increasedPadding) : increasedPadding;
state.increasedPaddingMap.put(lastView, newValue);
}
}
if (v instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) v;
// handle the notgoneIndex for the children as well
List<ExpandableNotificationRow> children = row.getNotificationChildren();
if (row.isSummaryWithChildren() && children != null) {
for (ExpandableNotificationRow childRow : children) {
if (childRow.getVisibility() != View.GONE) {
StackViewState childState = resultState.getViewStateForView(childRow);
childState.notGoneIndex = notGoneIndex;
notGoneIndex++;
}
}
}
}
lastView = v;
}
}
}
Aggregations