use of com.android.systemui.statusbar.ExpandableView in project android_frameworks_base by AOSPA.
the class NotificationStackScrollLayout method scrollTo.
@Override
public boolean scrollTo(View v) {
ExpandableView expandableView = (ExpandableView) v;
int positionInLinearLayout = getPositionInLinearLayout(v);
int targetScroll = targetScrollForView(expandableView, positionInLinearLayout);
int outOfViewScroll = positionInLinearLayout + expandableView.getIntrinsicHeight();
// that it is not visible anymore.
if (mOwnScrollY < targetScroll || outOfViewScroll < mOwnScrollY) {
mScroller.startScroll(mScrollX, mOwnScrollY, 0, targetScroll - mOwnScrollY);
mDontReportNextOverScroll = true;
postInvalidateOnAnimation();
return true;
}
return false;
}
use of com.android.systemui.statusbar.ExpandableView in project android_frameworks_base by AOSPA.
the class NotificationStackScrollLayout method onExpansionStopped.
public void onExpansionStopped() {
mIsExpansionChanging = false;
if (!mIsExpanded) {
setOwnScrollY(0);
mPhoneStatusBar.resetUserExpandedStates();
// lets make sure nothing is in the overlay / transient anymore
clearTemporaryViews(this);
for (int i = 0; i < getChildCount(); i++) {
ExpandableView child = (ExpandableView) getChildAt(i);
if (child instanceof ExpandableNotificationRow) {
ExpandableNotificationRow row = (ExpandableNotificationRow) child;
clearTemporaryViews(row.getChildrenContainer());
}
}
}
}
use of com.android.systemui.statusbar.ExpandableView in project android_frameworks_base by AOSPA.
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 android_frameworks_base by AOSPA.
the class NotificationStackScrollLayout method updateViewShadows.
private void updateViewShadows() {
// Lefts first sort by Z difference
for (int i = 0; i < getChildCount(); i++) {
ExpandableView child = (ExpandableView) getChildAt(i);
if (child.getVisibility() != GONE) {
mTmpSortedChildren.add(child);
}
}
Collections.sort(mTmpSortedChildren, mViewPositionComparator);
// Now lets update the shadow for the views
ExpandableView previous = null;
for (int i = 0; i < mTmpSortedChildren.size(); i++) {
ExpandableView expandableView = mTmpSortedChildren.get(i);
float translationZ = expandableView.getTranslationZ();
float otherZ = previous == null ? translationZ : previous.getTranslationZ();
float diff = otherZ - translationZ;
if (diff <= 0.0f || diff >= FakeShadowView.SHADOW_SIBLING_TRESHOLD) {
// There is no fake shadow to be drawn
expandableView.setFakeShadowIntensity(0.0f, 0.0f, 0, 0);
} else {
float yLocation = previous.getTranslationY() + previous.getActualHeight() - expandableView.getTranslationY() - previous.getExtraBottomPadding();
expandableView.setFakeShadowIntensity(diff / FakeShadowView.SHADOW_SIBLING_TRESHOLD, previous.getOutlineAlpha(), (int) yLocation, previous.getOutlineTranslation());
}
previous = expandableView;
}
mTmpSortedChildren.clear();
}
use of com.android.systemui.statusbar.ExpandableView in project android_frameworks_base by AOSPA.
the class NotificationStackScrollLayout method onViewRemovedInternal.
private void onViewRemovedInternal(View child, ViewGroup container) {
if (mChangePositionInProgress) {
// This is only a position change, don't do anything special
return;
}
ExpandableView expandableView = (ExpandableView) child;
expandableView.setOnHeightChangedListener(null);
mCurrentStackScrollState.removeViewStateForView(child);
updateScrollStateForRemovedChild(expandableView);
boolean animationGenerated = generateRemoveAnimation(child);
if (animationGenerated) {
if (!mSwipedOutViews.contains(child)) {
container.getOverlay().add(child);
} else if (Math.abs(expandableView.getTranslation()) != expandableView.getWidth()) {
container.addTransientView(child, 0);
expandableView.setTransientContainer(container);
}
} else {
mSwipedOutViews.remove(child);
}
updateAnimationState(false, child);
// Make sure the clipRect we might have set is removed
expandableView.setClipTopAmount(0);
focusNextViewIfFocused(child);
}
Aggregations