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

Commit 2d620806 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Adding some utility callbacks in TaskOverlayManager

Change-Id: Id2ef8f1c2bf4c6eab4170c32cfafad0b448e63db
parent c477c373
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16,4 +16,5 @@
<resources>
    <string name="task_overlay_factory_class" translatable="false"></string>

    <string name="overview_callbacks_class" translatable="false"></string>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Handler;

import com.android.launcher3.states.InternalStateHandler;
import com.android.quickstep.ActivityControlHelper.ActivityInitListener;
import com.android.quickstep.OverviewCallbacks;
import com.android.quickstep.util.RemoteAnimationProvider;

import java.util.function.BiPredicate;
@@ -60,6 +61,7 @@ public class LauncherInitListener extends InternalStateHandler implements Activi
                return null;
            });
        }
        OverviewCallbacks.get(launcher).onInitOverviewTransition();
        return mOnInitListener.test(launcher, alreadyOnHome);
    }

+43 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.quickstep;

import android.content.Context;

import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.Preconditions;

/**
 * Callbacks related to overview/quicksteps.
 */
public class OverviewCallbacks {

    private static OverviewCallbacks sInstance;

    public static OverviewCallbacks get(Context context) {
        Preconditions.assertUIThread();
        if (sInstance == null) {
            sInstance = Utilities.getOverrideObject(OverviewCallbacks.class,
                    context.getApplicationContext(), R.string.overview_callbacks_class);
        }
        return sInstance;
    }

    public void onInitOverviewTransition() { }

    public void onResetOverview() { }
}
+3 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.launcher3.util.PendingAnimation;
import com.android.launcher3.util.Themes;
import com.android.quickstep.OverviewCallbacks;
import com.android.quickstep.QuickScrubController;
import com.android.quickstep.RecentsAnimationInterpolator;
import com.android.quickstep.RecentsAnimationInterpolator.TaskWindowBounds;
@@ -513,6 +514,8 @@ public abstract class RecentsView<T extends BaseActivity>
        unloadVisibleTaskData();
        mRunningTaskId = -1;
        setCurrentPage(0);

        OverviewCallbacks.get(getContext()).onResetOverview();
    }

    /**