Adding animation so the CellLayout is properly spaced on Foldables

Flag: LEGACY FOLDABLE_SINGLE_PAGE DISABLED
Fix: 294841331
Test: atest HomeScreenEditStateImageTest
Change-Id: I5dc94b63ca322748b952ce4bd55b6951d51d190f
This commit is contained in:
Sebastian Franco
2023-09-21 13:56:42 -07:00
parent c4f9dd2c04
commit 9ea36d429c
5 changed files with 79 additions and 12 deletions

View File

@@ -34,6 +34,7 @@ import static com.android.launcher3.LauncherState.HOTSEAT_ICONS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.WORKSPACE_PAGE_INDICATOR;
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
import static com.android.launcher3.config.FeatureFlags.FOLDABLE_SINGLE_PAGE;
import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_SCALE;
@@ -172,9 +173,13 @@ public class WorkspaceStateTransitionAnimation {
scaleAndTranslation.translationY, translationInterpolator);
PageTranslationProvider pageTranslationProvider = state.getWorkspacePageTranslationProvider(
mLauncher);
for (int i = 0; i < childCount; i++) {
applyPageTranslation((CellLayout) mWorkspace.getChildAt(i), i, pageTranslationProvider,
propertySetter, config);
if (!FOLDABLE_SINGLE_PAGE.get()) {
for (int i = 0; i < childCount; i++) {
applyPageTranslation((CellLayout) mWorkspace.getChildAt(i), i,
pageTranslationProvider,
propertySetter, config);
}
}
Interpolator hotseatTranslationInterpolator = config.getInterpolator(