Methods Summary |
---|
public boolean | dispatchTouchEvent(android.view.MotionEvent ev)
if (filterMotionEvent(ev)) {
return super.dispatchTouchEvent(ev);
}
return false;
|
protected boolean | filterMotionEvent(android.view.MotionEvent event)
return event.getActionMasked() != MotionEvent.ACTION_DOWN
|| event.getY() > mClipTopAmount && event.getY() < mActualHeight;
|
public int | getActualHeight()See {@link #setActualHeight}.
return mActualHeight;
|
public int | getClipTopAmount()
return mClipTopAmount;
|
public void | getDrawingRect(android.graphics.Rect outRect)This method returns the drawing rect for the view which is different from the regular
drawing rect, since we layout all children in the {@link NotificationStackScrollLayout} at
position 0 and usually the translation is neglected. Since we are manually clipping this
view,we also need to subtract the clipTopAmount from the top. This is needed in order to
ensure that accessibility and focusing work correctly.
super.getDrawingRect(outRect);
outRect.left += getTranslationX();
outRect.right += getTranslationX();
outRect.bottom = (int) (outRect.top + getTranslationY() + getActualHeight());
outRect.top += getTranslationY() + getClipTopAmount();
|
protected int | getInitialHeight()
return getHeight();
|
public int | getIntrinsicHeight()
return getHeight();
|
public int | getMaxHeight()
return getHeight();
|
public int | getMinHeight()
return getHeight();
|
public boolean | isContentExpandable()
return false;
|
public boolean | isDark()
return mDark;
|
public boolean | isTransparent()
return false;
|
public void | notifyHeightChanged()
if (mOnHeightChangedListener != null) {
mOnHeightChangedListener.onHeightChanged(this);
}
|
public void | onHeightReset()
if (mOnHeightChangedListener != null) {
mOnHeightChangedListener.onReset(this);
}
|
protected void | onLayout(boolean changed, int left, int top, int right, int bottom)
super.onLayout(changed, left, top, right, bottom);
if (!mActualHeightInitialized && mActualHeight == 0) {
int initialHeight = getInitialHeight();
if (initialHeight != 0) {
setActualHeight(initialHeight);
}
}
|
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;
if (hasFixedHeight || isHeightLimited) {
int size = MeasureSpec.getSize(heightMeasureSpec);
ownMaxHeight = Math.min(ownMaxHeight, size);
}
int newHeightSpec = MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.AT_MOST);
int maxChildHeight = 0;
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
int childHeightSpec = newHeightSpec;
ViewGroup.LayoutParams layoutParams = child.getLayoutParams();
if (layoutParams.height != ViewGroup.LayoutParams.MATCH_PARENT) {
if (layoutParams.height >= 0) {
// An actual height is set
childHeightSpec = layoutParams.height > ownMaxHeight
? MeasureSpec.makeMeasureSpec(ownMaxHeight, MeasureSpec.EXACTLY)
: MeasureSpec.makeMeasureSpec(layoutParams.height, MeasureSpec.EXACTLY);
}
child.measure(
getChildMeasureSpec(widthMeasureSpec, 0 /* padding */, layoutParams.width),
childHeightSpec);
int childHeight = child.getMeasuredHeight();
maxChildHeight = Math.max(maxChildHeight, childHeight);
} else {
mMatchParentViews.add(child);
}
}
int ownHeight = hasFixedHeight ? ownMaxHeight : maxChildHeight;
newHeightSpec = MeasureSpec.makeMeasureSpec(ownHeight, MeasureSpec.EXACTLY);
for (View child : mMatchParentViews) {
child.measure(getChildMeasureSpec(
widthMeasureSpec, 0 /* padding */, child.getLayoutParams().width),
newHeightSpec);
}
mMatchParentViews.clear();
int width = MeasureSpec.getSize(widthMeasureSpec);
setMeasuredDimension(width, ownHeight);
|
public abstract void | performAddAnimation(long delay, long duration)
|
public abstract void | performRemoveAnimation(long duration, float translationDirection, java.lang.Runnable onFinishedRunnable)Perform a remove animation on this view.
|
protected void | resetActualHeight()Resets the height of the view on the next layout pass
mActualHeight = 0;
mActualHeightInitialized = false;
requestLayout();
|
public void | setActualHeight(int actualHeight, boolean notifyListeners)Sets the actual height of this notification. This is different than the laid out
{@link View#getHeight()}, as we want to avoid layouting during scrolling and expanding.
mActualHeightInitialized = true;
mActualHeight = actualHeight;
if (notifyListeners) {
notifyHeightChanged();
}
|
public void | setActualHeight(int actualHeight)
setActualHeight(actualHeight, true);
|
public void | setBelowSpeedBump(boolean below)
|
public void | setClipTopAmount(int clipTopAmount)Sets the amount this view should be clipped from the top. This is used when an expanded
notification is scrolling in the top or bottom stack.
mClipTopAmount = clipTopAmount;
|
public void | setDark(boolean dark, boolean fade, long delay)Sets the notification as dark. The default implementation does nothing.
mDark = dark;
|
public void | setDimmed(boolean dimmed, boolean fade)Sets the notification as dimmed. The default implementation does nothing.
|
public void | setHideSensitive(boolean hideSensitive, boolean animated, long delay, long duration)Sets whether the notification should hide its private contents if it is sensitive.
|
public void | setHideSensitiveForIntrinsicHeight(boolean hideSensitive)See {@link #setHideSensitive}. This is a variant which notifies this view in advance about
the upcoming state of hiding sensitive notifications. It gets called at the very beginning
of a stack scroller update such that the updated intrinsic height (which is dependent on
whether private or public layout is showing) gets taken into account into all layout
calculations.
|
public void | setOnHeightChangedListener(com.android.systemui.statusbar.ExpandableView$OnHeightChangedListener listener)
mOnHeightChangedListener = listener;
|