FileDocCategorySizeDatePackage
BrightnessMirrorController.javaAPI DocAndroid 5.1 API3937Thu Mar 12 22:22:42 GMT 2015com.android.systemui.statusbar.policy

BrightnessMirrorController

public class BrightnessMirrorController extends Object
Controls showing and hiding of the brightness mirror.

Fields Summary
public long
TRANSITION_DURATION_OUT
public long
TRANSITION_DURATION_IN
private final com.android.systemui.statusbar.ScrimView
mScrimBehind
private final android.view.View
mBrightnessMirror
private final android.view.View
mPanelHolder
private final int[]
mInt2Cache
Constructors Summary
public BrightnessMirrorController(com.android.systemui.statusbar.phone.StatusBarWindowView statusBarWindow)


       
        mScrimBehind = (ScrimView) statusBarWindow.findViewById(R.id.scrim_behind);
        mBrightnessMirror = statusBarWindow.findViewById(R.id.brightness_mirror);
        mPanelHolder = statusBarWindow.findViewById(R.id.panel_holder);
    
Methods Summary
public android.view.ViewgetMirror()

        return mBrightnessMirror;
    
public voidhideMirror()

        mScrimBehind.animateViewAlpha(1.0f, TRANSITION_DURATION_IN, PhoneStatusBar.ALPHA_IN);
        inAnimation(mPanelHolder.animate())
                .withLayer()
                .withEndAction(new Runnable() {
            @Override
            public void run() {
                mBrightnessMirror.setVisibility(View.GONE);
            }
        });
    
private android.view.ViewPropertyAnimatorinAnimation(android.view.ViewPropertyAnimator a)

        return a.alpha(1.0f)
                .setDuration(TRANSITION_DURATION_IN)
                .setInterpolator(PhoneStatusBar.ALPHA_IN);
    
private android.view.ViewPropertyAnimatoroutAnimation(android.view.ViewPropertyAnimator a)

        return a.alpha(0.0f)
                .setDuration(TRANSITION_DURATION_OUT)
                .setInterpolator(PhoneStatusBar.ALPHA_OUT);
    
public voidsetLocation(android.view.View original)

        original.getLocationInWindow(mInt2Cache);
        int originalY = mInt2Cache[1];
        mBrightnessMirror.getLocationInWindow(mInt2Cache);
        int mirrorY = mInt2Cache[1];

        mBrightnessMirror.setTranslationY(mBrightnessMirror.getTranslationY()
                + originalY - mirrorY);
    
public voidshowMirror()

        mBrightnessMirror.setVisibility(View.VISIBLE);
        mScrimBehind.animateViewAlpha(0.0f, TRANSITION_DURATION_OUT, PhoneStatusBar.ALPHA_OUT);
        outAnimation(mPanelHolder.animate())
                .withLayer();
    
public voidupdateResources()

        FrameLayout.LayoutParams lp =
                (FrameLayout.LayoutParams) mBrightnessMirror.getLayoutParams();
        lp.width = mBrightnessMirror.getResources().getDimensionPixelSize(
                R.dimen.notification_panel_width);
        lp.gravity = mBrightnessMirror.getResources().getInteger(
                R.integer.notification_panel_layout_gravity);
        mBrightnessMirror.setLayoutParams(lp);

        int padding = mBrightnessMirror.getResources().getDimensionPixelSize(
                R.dimen.notification_side_padding);
        mBrightnessMirror.setPadding(padding, mBrightnessMirror.getPaddingTop(),
                padding, mBrightnessMirror.getPaddingBottom());