1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 
17 package com.android.systemui.shared.system;
18 
19 import android.graphics.Rect;
20 import android.view.RemoteAnimationTarget;
21 
22 import com.android.systemui.shared.recents.model.ThumbnailData;
23 
24 import java.util.HashMap;
25 
26 public interface RecentsAnimationListener {
27     /**
28      * Called when the animation into Recents can start. This call is made on the binder thread.
29      */
onAnimationStart(RecentsAnimationControllerCompat controller, RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers, Rect homeContentInsets, Rect minimizedHomeBounds)30     void onAnimationStart(RecentsAnimationControllerCompat controller,
31             RemoteAnimationTarget[] apps, RemoteAnimationTarget[] wallpapers,
32             Rect homeContentInsets, Rect minimizedHomeBounds);
33 
34     /**
35      * Called when the animation into Recents was canceled. This call is made on the binder thread.
36      */
onAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas)37     void onAnimationCanceled(HashMap<Integer, ThumbnailData> thumbnailDatas);
38 
39     /**
40      * Called when the task of an activity that has been started while the recents animation
41      * was running becomes ready for control.
42      */
onTasksAppeared(RemoteAnimationTarget[] app)43     void onTasksAppeared(RemoteAnimationTarget[] app);
44 
45     /**
46      * Called to request that the current task tile be switched out for a screenshot (if not
47      * already). Once complete, onFinished should be called.
48      * @return true if this impl will call onFinished. No other onSwitchToScreenshot impls will
49      *         be called afterwards (to avoid multiple calls to onFinished).
50      */
onSwitchToScreenshot(Runnable onFinished)51     default boolean onSwitchToScreenshot(Runnable onFinished) {
52         return false;
53     }
54 }
55