Change overview animation to scale instead of translationX

As you swipe up to overview from home, workspace scales down and fades out as before,
and now recents scales down from 1.2f on top of it. The interpolators are set such
that the workspace animation is seen before the recents animation. Also, we don't
scale down all of recents, only the visible pages (current and adjacent).

Change-Id: I5f8bfe8cafeaa41d26873c63549735d7bdff2bce
This commit is contained in:
Tony
2018-04-04 10:23:36 -07:00
parent c2b64829a7
commit 0c95559cbc
12 changed files with 143 additions and 103 deletions

View File

@@ -31,7 +31,6 @@ import com.android.launcher3.anim.AnimatorSetBuilder;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.graphics.ViewScrim;
import com.android.launcher3.uioverrides.UiFactory;
/**
* Manages the animations between each of the workspace states.
@@ -74,11 +73,11 @@ public class WorkspaceStateTransitionAnimation {
propertySetter);
}
propertySetter.setFloat(mWorkspace, SCALE_PROPERTY, mNewScale, Interpolators.ZOOM_IN);
propertySetter.setFloat(mWorkspace, SCALE_PROPERTY, mNewScale, Interpolators.ZOOM_OUT);
propertySetter.setFloat(mWorkspace, View.TRANSLATION_X,
scaleAndTranslation[1], Interpolators.ZOOM_IN);
scaleAndTranslation[1], Interpolators.ZOOM_OUT);
propertySetter.setFloat(mWorkspace, View.TRANSLATION_Y,
scaleAndTranslation[2], Interpolators.ZOOM_IN);
scaleAndTranslation[2], Interpolators.ZOOM_OUT);
int elements = state.getVisibleElements(mLauncher);
float hotseatIconsAlpha = (elements & HOTSEAT_ICONS) != 0 ? 1 : 0;
@@ -113,7 +112,7 @@ public class WorkspaceStateTransitionAnimation {
int drawableAlpha = Math.round(pageAlpha * (state.hasWorkspacePageBackground ? 255 : 0));
propertySetter.setInt(cl.getScrimBackground(),
DRAWABLE_ALPHA, drawableAlpha, Interpolators.ZOOM_IN);
DRAWABLE_ALPHA, drawableAlpha, Interpolators.ZOOM_OUT);
propertySetter.setFloat(cl.getShortcutsAndWidgets(), View.ALPHA,
pageAlpha, pageAlphaProvider.interpolator);
}