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

StackScrollerDecorView

public abstract class StackScrollerDecorView extends ExpandableView
A common base class for all views in the notification stack scroller which don't have a background.

Fields Summary
protected android.view.View
mContent
private boolean
mIsVisible
private boolean
mAnimating
private boolean
mWillBeGone
Constructors Summary
public StackScrollerDecorView(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
private voidanimateText(boolean nowVisible, java.lang.Runnable onFinishedRunnable)
Animate the text to a new visibility.

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

        if (nowVisible != mIsVisible) {
            // Animate text
            float endValue = nowVisible ? 1.0f : 0.0f;
            Interpolator interpolator;
            if (nowVisible) {
                interpolator = PhoneStatusBar.ALPHA_IN;
            } else {
                interpolator = PhoneStatusBar.ALPHA_OUT;
            }
            mAnimating = true;
            mContent.animate()
                    .alpha(endValue)
                    .setInterpolator(interpolator)
                    .setDuration(260)
                    .withEndAction(new Runnable() {
                        @Override
                        public void run() {
                            mAnimating = false;
                            if (onFinishedRunnable != null) {
                                onFinishedRunnable.run();
                            }
                        }
                    });
            mIsVisible = nowVisible;
        } else {
            if (onFinishedRunnable != null) {
                onFinishedRunnable.run();
            }
        }
    
public voidcancelAnimation()

        mContent.animate().cancel();
    
protected abstract android.view.ViewfindContentView()

public booleanhasOverlappingRendering()

        return false;
    
public booleanisTransparent()

        return true;
    
public booleanisVisible()

        return mIsVisible || mAnimating;
    
protected voidonFinishInflate()

        super.onFinishInflate();
        mContent = findContentView();
        setInvisible();
    
protected voidonLayout(boolean changed, int left, int top, int right, int bottom)

        super.onLayout(changed, left, top, right, bottom);
        setOutlineProvider(null);
    
public voidperformAddAnimation(long delay, long duration)

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

        // TODO: Use duration
        performVisibilityAnimation(false);
    
public voidperformVisibilityAnimation(boolean nowVisible)

        animateText(nowVisible, null /* onFinishedRunnable */);
    
public voidperformVisibilityAnimation(boolean nowVisible, java.lang.Runnable onFinishedRunnable)

        animateText(nowVisible, onFinishedRunnable);
    
public voidsetInvisible()

        mContent.setAlpha(0.0f);
        mIsVisible = false;
    
public voidsetWillBeGone(boolean willBeGone)

        mWillBeGone = willBeGone;
    
public booleanwillBeGone()

        return mWillBeGone;