FileDocCategorySizeDatePackage
BarTransitions.javaAPI DocAndroid 5.1 API9207Thu Mar 12 22:22:42 GMT 2015com.android.systemui.statusbar.phone

BarTransitions

public class BarTransitions extends Object

Fields Summary
private static final boolean
DEBUG
private static final boolean
DEBUG_COLORS
public static final boolean
HIGH_END
public static final int
MODE_OPAQUE
public static final int
MODE_SEMI_TRANSPARENT
public static final int
MODE_TRANSLUCENT
public static final int
MODE_LIGHTS_OUT
public static final int
MODE_TRANSPARENT
public static final int
MODE_WARNING
public static final int
MODE_LIGHTS_OUT_TRANSPARENT
public static final int
LIGHTS_IN_DURATION
public static final int
LIGHTS_OUT_DURATION
public static final int
BACKGROUND_DURATION
private final String
mTag
private final android.view.View
mView
private final BarBackgroundDrawable
mBarBackground
private int
mMode
Constructors Summary
public BarTransitions(android.view.View view, int gradientResourceId)


         
        mTag = "BarTransitions." + view.getClass().getSimpleName();
        mView = view;
        mBarBackground = new BarBackgroundDrawable(mView.getContext(), gradientResourceId);
        if (HIGH_END) {
            mView.setBackground(mBarBackground);
        }
    
Methods Summary
protected voidapplyModeBackground(int oldMode, int newMode, boolean animate)

        if (DEBUG) Log.d(mTag, String.format("applyModeBackground oldMode=%s newMode=%s animate=%s",
                modeToString(oldMode), modeToString(newMode), animate));
        mBarBackground.applyModeBackground(oldMode, newMode, animate);
    
public voidfinishAnimations()

        mBarBackground.finishAnimation();
    
public intgetMode()

        return mMode;
    
protected booleanisLightsOut(int mode)

        return mode == MODE_LIGHTS_OUT || mode == MODE_LIGHTS_OUT_TRANSPARENT;
    
public static java.lang.StringmodeToString(int mode)

        if (mode == MODE_OPAQUE) return "MODE_OPAQUE";
        if (mode == MODE_SEMI_TRANSPARENT) return "MODE_SEMI_TRANSPARENT";
        if (mode == MODE_TRANSLUCENT) return "MODE_TRANSLUCENT";
        if (mode == MODE_LIGHTS_OUT) return "MODE_LIGHTS_OUT";
        if (mode == MODE_TRANSPARENT) return "MODE_TRANSPARENT";
        if (mode == MODE_WARNING) return "MODE_WARNING";
        if (mode == MODE_LIGHTS_OUT_TRANSPARENT) return "MODE_LIGHTS_OUT_TRANSPARENT";
        throw new IllegalArgumentException("Unknown mode " + mode);
    
protected voidonTransition(int oldMode, int newMode, boolean animate)

        if (HIGH_END) {
            applyModeBackground(oldMode, newMode, animate);
        }
    
public voidtransitionTo(int mode, boolean animate)

        // low-end devices do not support translucent modes, fallback to opaque
        if (!HIGH_END && (mode == MODE_SEMI_TRANSPARENT || mode == MODE_TRANSLUCENT
                || mode == MODE_TRANSPARENT)) {
            mode = MODE_OPAQUE;
        }
        if (!HIGH_END && (mode == MODE_LIGHTS_OUT_TRANSPARENT)) {
            mode = MODE_LIGHTS_OUT;
        }
        if (mMode == mode) return;
        int oldMode = mMode;
        mMode = mode;
        if (DEBUG) Log.d(mTag, String.format("%s -> %s animate=%s",
                modeToString(oldMode), modeToString(mode),  animate));
        onTransition(oldMode, mMode, animate);