FileDocCategorySizeDatePackage
SpeedBumpView.javaAPI DocAndroid 5.1 API4242Thu Mar 12 22:22:42 GMT 2015com.android.systemui.statusbar

SpeedBumpView

public class SpeedBumpView extends ExpandableView
The view representing the separation between important and less important notifications

Fields Summary
private final int
mSpeedBumpHeight
private AlphaOptimizedView
mLine
private boolean
mIsVisible
private final android.view.animation.Interpolator
mFastOutSlowInInterpolator
Constructors Summary
public SpeedBumpView(android.content.Context context, android.util.AttributeSet attrs)


         
        super(context, attrs);
        mSpeedBumpHeight = getResources()
                .getDimensionPixelSize(R.dimen.speed_bump_height);
        mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(getContext(),
                android.R.interpolator.fast_out_slow_in);
    
Methods Summary
public voidanimateDivider(boolean nowVisible, long delay, java.lang.Runnable onFinishedRunnable)
Animate the divider to a new visibility.

param
nowVisible should it now be visible
param
delay the delay after the animation should start
param
onFinishedRunnable A runnable which should be run when the animation is finished.

        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 intgetInitialHeight()

        return mSpeedBumpHeight;
    
public intgetIntrinsicHeight()

        return mSpeedBumpHeight;
    
public booleanisTransparent()

        return true;
    
protected voidonFinishInflate()

        super.onFinishInflate();
        mLine = (AlphaOptimizedView) findViewById(R.id.speedbump_line);
    
protected voidonLayout(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 voidonMeasure(int widthMeasureSpec, int heightMeasureSpec)

        measureChildren(widthMeasureSpec, heightMeasureSpec);
        int height = mSpeedBumpHeight;
        setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), height);
    
public voidperformAddAnimation(long delay, long duration)

        // TODO: Use duration
        performVisibilityAnimation(true, delay);
    
public voidperformRemoveAnimation(long duration, float translationDirection, java.lang.Runnable onFinishedRunnable)

        // TODO: Use duration
        performVisibilityAnimation(false, 0 /* delay */);
    
public voidperformVisibilityAnimation(boolean nowVisible, long delay)

        animateDivider(nowVisible, delay, null /* onFinishedRunnable */);
    
public voidsetInvisible()

        mLine.setAlpha(0.0f);
        mLine.setScaleX(0.0f);
        mLine.setScaleY(0.0f);
        mIsVisible = false;