Methods Summary |
---|
public void | animateDivider(boolean nowVisible, long delay, java.lang.Runnable onFinishedRunnable)Animate the divider to a new visibility.
if (nowVisible != mIsVisible) {
// Animate dividers
float endValue = nowVisible ? 1.0f : 0.0f;
mLine.animate()
.alpha(endValue)
.setStartDelay(delay)
.scaleX(endValue)
.scaleY(endValue)
.setInterpolator(mFastOutSlowInInterpolator)
.withEndAction(onFinishedRunnable);
mIsVisible = nowVisible;
} else {
if (onFinishedRunnable != null) {
onFinishedRunnable.run();
}
}
|
protected int | getInitialHeight()
return mSpeedBumpHeight;
|
public int | getIntrinsicHeight()
return mSpeedBumpHeight;
|
public boolean | isTransparent()
return true;
|
protected void | onFinishInflate()
super.onFinishInflate();
mLine = (AlphaOptimizedView) findViewById(R.id.speedbump_line);
|
protected void | onLayout(boolean changed, int left, int top, int right, int bottom)
super.onLayout(changed, left, top, right, bottom);
mLine.setPivotX(mLine.getWidth() / 2);
mLine.setPivotY(mLine.getHeight() / 2);
setOutlineProvider(null);
|
protected void | onMeasure(int widthMeasureSpec, int heightMeasureSpec)
measureChildren(widthMeasureSpec, heightMeasureSpec);
int height = mSpeedBumpHeight;
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), height);
|
public void | performAddAnimation(long delay, long duration)
// TODO: Use duration
performVisibilityAnimation(true, delay);
|
public void | performRemoveAnimation(long duration, float translationDirection, java.lang.Runnable onFinishedRunnable)
// TODO: Use duration
performVisibilityAnimation(false, 0 /* delay */);
|
public void | performVisibilityAnimation(boolean nowVisible, long delay)
animateDivider(nowVisible, delay, null /* onFinishedRunnable */);
|
public void | setInvisible()
mLine.setAlpha(0.0f);
mLine.setScaleX(0.0f);
mLine.setScaleY(0.0f);
mIsVisible = false;
|