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

Commit 43a16157 authored by Zak Cohen's avatar Zak Cohen
Browse files

Hide apps view in transitions if none of its parts are visible.

Check where the all apps view has any pieces visible, if not hide it.

Test: local
Change-Id: I1d9b957b6c10dfbe4beaa56c4fee920844699a6c
parent d71c3b18
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -74,6 +74,10 @@ public abstract class LauncherState {
    public static final int VERTICAL_SWIPE_INDICATOR = 1 << 5;
    public static final int RECENTS_CLEAR_ALL_BUTTON = 1 << 6;

    /** Mask of all the items that are contained in the apps view. */
    public static final int APPS_VIEW_ITEM_MASK =
            HOTSEAT_SEARCH_BOX | ALL_APPS_HEADER | ALL_APPS_HEADER_EXTRA | ALL_APPS_CONTENT;

    protected static final int FLAG_MULTI_PAGE = 1 << 0;
    protected static final int FLAG_DISABLE_ACCESSIBILITY = 1 << 1;
    protected static final int FLAG_DISABLE_RESTORE = 1 << 2;
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ package com.android.launcher3.allapps;

import static com.android.launcher3.LauncherState.ALL_APPS_CONTENT;
import static com.android.launcher3.LauncherState.ALL_APPS_HEADER_EXTRA;
import static com.android.launcher3.LauncherState.APPS_VIEW_ITEM_MASK;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.VERTICAL_SWIPE_INDICATOR;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_FADE;
@@ -203,6 +204,8 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
        boolean hasHeaderExtra = (visibleElements & ALL_APPS_HEADER_EXTRA) != 0;
        boolean hasAllAppsContent = (visibleElements & ALL_APPS_CONTENT) != 0;

        boolean hasAnyVisibleItem = (visibleElements & APPS_VIEW_ITEM_MASK) != 0;

        Interpolator allAppsFade = builder.getInterpolator(ANIM_ALL_APPS_FADE, LINEAR);
        Interpolator headerFade = builder.getInterpolator(ANIM_ALL_APPS_HEADER_FADE, allAppsFade);
        setter.setViewAlpha(mAppsView.getContentView(), hasAllAppsContent ? 1 : 0, allAppsFade);
@@ -213,6 +216,8 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil

        setter.setInt(mScrimView, ScrimView.DRAG_HANDLE_ALPHA,
                (visibleElements & VERTICAL_SWIPE_INDICATOR) != 0 ? 255 : 0, allAppsFade);

        setter.setViewAlpha(mAppsView, hasAnyVisibleItem ? 1 : 0, allAppsFade);
    }

    public AnimatorListenerAdapter getProgressAnimatorListener() {