Add OverviewScrim to show below overview but above workspace

- Refactor some basic scrim logic to Scrim class and have
  WorkspaceAndHotseatScrim and OverviewScrim extend it
- Draw OverviewScrim under recents unless predictions are disabled, in
  which case draw it under hotseat (since that is in recents)
- Remove sysui scrim (behind status bar and nav bar) when overview is
  peeking

Bug: 132455160
Change-Id: Ia5d6f54582a4c5a70e3b2d4a98281567edd68519
This commit is contained in:
Tony Wickham
2019-07-24 17:32:08 -07:00
parent 3bbb20262b
commit c088051c29
13 changed files with 252 additions and 79 deletions

View File

@@ -19,16 +19,20 @@ package com.android.launcher3.uioverrides;
import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCALE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_SCRIM_FADE;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_X;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATE_Y;
import static com.android.launcher3.anim.AnimatorSetBuilder.FLAG_DONT_ANIMATE_OVERVIEW;
import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS;
import android.util.FloatProperty;
import android.view.View;
import android.view.animation.Interpolator;
import androidx.annotation.NonNull;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherState.ScaleAndTranslation;
@@ -36,8 +40,7 @@ import com.android.launcher3.LauncherStateManager.AnimationConfig;
import com.android.launcher3.LauncherStateManager.StateHandler;
import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.PropertySetter;
import androidx.annotation.NonNull;
import com.android.launcher3.graphics.OverviewScrim;
/**
* State handler for recents view. Manages UI changes and animations for recents view based off the
@@ -67,6 +70,8 @@ public abstract class BaseRecentsViewStateController<T extends View>
mRecentsView.setTranslationX(translationX);
mRecentsView.setTranslationY(scaleAndTranslation.translationY);
getContentAlphaProperty().set(mRecentsView, state.overviewUi ? 1f : 0);
OverviewScrim scrim = mLauncher.getDragLayer().getOverviewScrim();
SCRIM_PROGRESS.set(scrim, state.getOverviewScrimAlpha(mLauncher));
}
@Override
@@ -110,6 +115,9 @@ public abstract class BaseRecentsViewStateController<T extends View>
translateYInterpolator);
setter.setFloat(mRecentsView, getContentAlphaProperty(), toState.overviewUi ? 1 : 0,
builder.getInterpolator(ANIM_OVERVIEW_FADE, AGGRESSIVE_EASE_IN_OUT));
OverviewScrim scrim = mLauncher.getDragLayer().getOverviewScrim();
setter.setFloat(scrim, SCRIM_PROGRESS, toState.getOverviewScrimAlpha(mLauncher),
builder.getInterpolator(ANIM_OVERVIEW_SCRIM_FADE, LINEAR));
}
/**