FileDocCategorySizeDatePackage
SystemBarScrimViews.javaAPI DocAndroid 5.1 API4942Thu Mar 12 22:22:42 GMT 2015com.android.systemui.recents.views

SystemBarScrimViews

public class SystemBarScrimViews extends Object
Manages the scrims for the various system bars.

Fields Summary
com.android.systemui.recents.RecentsConfiguration
mConfig
android.view.View
mStatusBarScrimView
android.view.View
mNavBarScrimView
boolean
mHasNavBarScrim
boolean
mShouldAnimateStatusBarScrim
boolean
mHasStatusBarScrim
boolean
mShouldAnimateNavBarScrim
Constructors Summary
public SystemBarScrimViews(android.app.Activity activity, com.android.systemui.recents.RecentsConfiguration config)

        mConfig = config;
        mStatusBarScrimView = activity.findViewById(R.id.status_bar_scrim);
        mNavBarScrimView = activity.findViewById(R.id.nav_bar_scrim);
    
Methods Summary
public voidprepareEnterRecentsAnimation()
Prepares the scrim views for animating when entering Recents. This will be called before the first draw.

        mHasNavBarScrim = mConfig.hasNavBarScrim();
        mShouldAnimateNavBarScrim = mConfig.shouldAnimateNavBarScrim();
        mHasStatusBarScrim = mConfig.hasStatusBarScrim();
        mShouldAnimateStatusBarScrim = mConfig.shouldAnimateStatusBarScrim();

        mNavBarScrimView.setVisibility(mHasNavBarScrim && !mShouldAnimateNavBarScrim ?
                View.VISIBLE : View.INVISIBLE);
        mStatusBarScrimView.setVisibility(mHasStatusBarScrim && !mShouldAnimateStatusBarScrim ?
                View.VISIBLE : View.INVISIBLE);
    
public voidstartEnterRecentsAnimation()
Starts animating the scrim views when entering Recents.

        if (mHasStatusBarScrim && mShouldAnimateStatusBarScrim) {
            mStatusBarScrimView.setTranslationY(-mStatusBarScrimView.getMeasuredHeight());
            mStatusBarScrimView.animate()
                    .translationY(0)
                    .setStartDelay(mConfig.launchedFromHome ?
                            mConfig.transitionEnterFromHomeDelay :
                            mConfig.transitionEnterFromAppDelay)
                    .setDuration(mConfig.navBarScrimEnterDuration)
                    .setInterpolator(mConfig.quintOutInterpolator)
                    .withStartAction(new Runnable() {
                        @Override
                        public void run() {
                            mStatusBarScrimView.setVisibility(View.VISIBLE);
                        }
                    })
                    .start();
        }
        if (mHasNavBarScrim && mShouldAnimateNavBarScrim) {
            mNavBarScrimView.setTranslationY(mNavBarScrimView.getMeasuredHeight());
            mNavBarScrimView.animate()
                    .translationY(0)
                    .setStartDelay(mConfig.launchedFromHome ?
                            mConfig.transitionEnterFromHomeDelay :
                            mConfig.transitionEnterFromAppDelay)
                    .setDuration(mConfig.navBarScrimEnterDuration)
                    .setInterpolator(mConfig.quintOutInterpolator)
                    .withStartAction(new Runnable() {
                        @Override
                        public void run() {
                            mNavBarScrimView.setVisibility(View.VISIBLE);
                        }
                    })
                    .start();
        }
    
public voidstartExitRecentsAnimation()
Starts animating the scrim views when leaving Recents (either via launching a task, or going home).

        if (mHasStatusBarScrim && mShouldAnimateStatusBarScrim) {
            mStatusBarScrimView.animate()
                    .translationY(-mStatusBarScrimView.getMeasuredHeight())
                    .setStartDelay(0)
                    .setDuration(mConfig.taskViewExitToAppDuration)
                    .setInterpolator(mConfig.fastOutSlowInInterpolator)
                    .start();
        }
        if (mHasNavBarScrim && mShouldAnimateNavBarScrim) {
            mNavBarScrimView.animate()
                    .translationY(mNavBarScrimView.getMeasuredHeight())
                    .setStartDelay(0)
                    .setDuration(mConfig.taskViewExitToAppDuration)
                    .setInterpolator(mConfig.fastOutSlowInInterpolator)
                    .start();
        }