Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b794ea64 authored by Alex Chau's avatar Alex Chau
Browse files

Show TaskView as grid in large screens

- Introduced gridProgress to RecentsView/TaskView ofr animating into grid
- Introduced gridProgress dependant translation and scale properties in TaskView
- Animate running task into grid with TaskViewSimulator
- Remove overview actions (for now) but keep clear all button in large screens
- Adjust ClearAllButton translation to acoomodate for grid
- Use screen width +-50% to calculate task visibility
- Use the position where TaskView is on screenEnd as pageScroll
- TODO: Handle separate recents activity

Doc: go/foldables-launcher-overview
Video: http://dr/file/d/107Aydii1LoFCwP63nWG3Twr2PBDE5ZgD/view?resourcekey=0-aUjdnx8ezimS9tmAgao9ag
Test: Test Launchering overview and launching overview from apps with folloiwng combination:
- large / small screen sizes
- portrait / landscape
- thumbnails from different screen sizes / orientations
Bug: 174464863
Fixes: 181509346

Change-Id: I4b691cde774f2e37532b68ba83c6eed399f2332e
parent 13d5079e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
    <dimen name="overview_actions_bottom_margin_three_button">8dp</dimen>
    <dimen name="overview_actions_horizontal_margin">16dp</dimen>

    <dimen name="recents_row_spacing">48dp</dimen>
    <dimen name="recents_page_spacing">16dp</dimen>
    <dimen name="recents_clear_all_deadzone_vertical_margin">70dp</dimen>

+5 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import static com.android.launcher3.states.StateAnimationConfig.PLAY_ATOMIC_OVER
import static com.android.launcher3.states.StateAnimationConfig.PLAY_ATOMIC_OVERVIEW_SCALE;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_OFFSET;
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
import static com.android.quickstep.views.RecentsView.RECENTS_SCALE_PROPERTY;
import static com.android.quickstep.views.RecentsView.TASK_SECONDARY_TRANSLATION;

@@ -73,6 +74,8 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
        SCRIM_PROGRESS.set(scrim, state.getOverviewScrimAlpha(mLauncher));
        SCRIM_MULTIPLIER.set(scrim, 1f);
        getTaskModalnessProperty().set(mRecentsView, state.getOverviewModalness());
        RECENTS_GRID_PROGRESS.set(mRecentsView, state.displayOverviewTasksAsGrid(mLauncher)
                ? 1f : 0f);
    }

    @Override
@@ -117,6 +120,8 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
                mRecentsView, getTaskModalnessProperty(),
                toState.getOverviewModalness(),
                config.getInterpolator(ANIM_OVERVIEW_MODAL, LINEAR));
        setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS,
                toState.displayOverviewTasksAsGrid(mLauncher) ? 1f : 0f, LINEAR);
    }

    abstract FloatProperty getTaskModalnessProperty();
+8 −4
Original line number Diff line number Diff line
@@ -15,7 +15,8 @@
 */
package com.android.launcher3.uioverrides;

import static com.android.launcher3.LauncherState.OVERVIEW_BUTTONS;
import static com.android.launcher3.LauncherState.CLEAR_ALL_BUTTON;
import static com.android.launcher3.LauncherState.OVERVIEW_ACTIONS;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE;
import static com.android.quickstep.views.RecentsView.CONTENT_ALPHA;
@@ -83,11 +84,14 @@ public final class RecentsViewStateController extends

    private void setAlphas(PropertySetter propertySetter, StateAnimationConfig config,
            LauncherState state) {
        float buttonAlpha = (state.getVisibleElements(mLauncher) & OVERVIEW_BUTTONS) != 0 ? 1 : 0;
        float clearAllButtonAlpha = (state.getVisibleElements(mLauncher) & CLEAR_ALL_BUTTON) != 0
                ? 1 : 0;
        propertySetter.setFloat(mRecentsView.getClearAllButton(), ClearAllButton.VISIBILITY_ALPHA,
                buttonAlpha, LINEAR);
                clearAllButtonAlpha, LINEAR);
        float overviewButtonAlpha = (state.getVisibleElements(mLauncher) & OVERVIEW_ACTIONS) != 0
                ? 1 : 0;
        propertySetter.setFloat(mLauncher.getActionsView().getVisibilityAlpha(),
                MultiValueAlpha.VALUE, buttonAlpha, config.getInterpolator(
                MultiValueAlpha.VALUE, overviewButtonAlpha, config.getInterpolator(
                        ANIM_OVERVIEW_ACTIONS_FADE, LINEAR));
    }

+7 −1
Original line number Diff line number Diff line
@@ -69,11 +69,17 @@ public class BackgroundAppState extends OverviewState {
    @Override
    public int getVisibleElements(Launcher launcher) {
        return super.getVisibleElements(launcher)
                & ~OVERVIEW_BUTTONS
                & ~OVERVIEW_ACTIONS
                & ~CLEAR_ALL_BUTTON
                & ~VERTICAL_SWIPE_INDICATOR
                | TASKBAR;
    }

    @Override
    public boolean displayOverviewTasksAsGrid(Launcher launcher) {
        return false;
    }

    @Override
    public ScaleAndTranslation getHotseatScaleAndTranslation(Launcher launcher) {
        if ((getVisibleElements(launcher) & HOTSEAT_ICONS) != 0) {
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ public class OverviewModalTaskState extends OverviewState {

    @Override
    public int getVisibleElements(Launcher launcher) {
        return OVERVIEW_BUTTONS;
        return OVERVIEW_ACTIONS | CLEAR_ALL_BUTTON;
    }

    @Override
Loading