use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class StackScrollState method apply.
/**
* Apply the properties saved in {@link #mStateMap} to the children of the {@link #mHostView}.
* The properties are only applied if they effectively changed.
*/
public void apply() {
int numChildren = mHostView.getChildCount();
for (int i = 0; i < numChildren; i++) {
ExpandableView child = (ExpandableView) mHostView.getChildAt(i);
StackViewState state = mStateMap.get(child);
if (!applyState(child, state)) {
continue;
}
if (child instanceof DismissView) {
DismissView dismissView = (DismissView) child;
boolean visible = state.clipTopAmount < mClearAllTopPadding;
dismissView.performVisibilityAnimation(visible && !dismissView.willBeGone());
} else if (child instanceof EmptyShadeView) {
EmptyShadeView emptyShadeView = (EmptyShadeView) child;
boolean visible = state.clipTopAmount <= 0;
emptyShadeView.performVisibilityAnimation(visible && !emptyShadeView.willBeGone());
}
}
}
use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class StackStateAnimator method findLastNotAddedIndex.
private int findLastNotAddedIndex(StackScrollState finalState) {
int childCount = mHostLayout.getChildCount();
for (int i = childCount - 1; i >= 0; i--) {
final ExpandableView child = (ExpandableView) mHostLayout.getChildAt(i);
StackViewState viewState = finalState.getViewStateForView(child);
if (viewState == null || child.getVisibility() == View.GONE) {
continue;
}
if (!mNewAddChildren.contains(child)) {
return viewState.notGoneIndex;
}
}
return -1;
}
use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class NotificationStackScrollLayout method getViewBeforeView.
/**
* @return the child before the given view which has visibility unequal to GONE
*/
public ExpandableView getViewBeforeView(ExpandableView view) {
ExpandableView previousView = null;
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
if (child == view) {
return previousView;
}
if (child.getVisibility() != View.GONE) {
previousView = (ExpandableView) child;
}
}
return null;
}
use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class NotificationStackScrollLayout method getChildAtPosition.
@Override
public ExpandableView getChildAtPosition(float touchX, float touchY) {
// find the view under the pointer, accounting for GONE views
final int count = getChildCount();
for (int childIdx = 0; childIdx < count; childIdx++) {
ExpandableView slidingChild = (ExpandableView) getChildAt(childIdx);
if (slidingChild.getVisibility() == GONE || slidingChild instanceof StackScrollerDecorView) {
continue;
}
float childTop = slidingChild.getTranslationY();
float top = childTop + slidingChild.getClipTopAmount();
float bottom = childTop + slidingChild.getActualHeight();
// Allow the full width of this view to prevent gesture conflict on Keyguard (phone and
// camera affordance).
int left = 0;
int right = getWidth();
if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
if (slidingChild instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) slidingChild;
if (!mIsExpanded && row.isHeadsUp() && row.isPinned() && mHeadsUpManager.getTopEntry().entry.row != row && mGroupManager.getGroupSummary(mHeadsUpManager.getTopEntry().entry.row.getStatusBarNotification()) != row) {
continue;
}
return row.getViewAtPosition(touchY - childTop);
}
return slidingChild;
}
}
return null;
}
use of com.android.systemui.statusbar.ExpandableView in project platform_frameworks_base by android.
the class NotificationStackScrollLayout method updateHideSensitiveForChild.
private void updateHideSensitiveForChild(View child) {
if (child instanceof ExpandableView) {
ExpandableView expandableView = (ExpandableView) child;
expandableView.setHideSensitiveForIntrinsicHeight(mAmbientState.isHideSensitive());
}
}
Aggregations