summaryrefslogtreecommitdiff
path: root/com/android/server/wm/BoundsAnimationTarget.java
blob: 647a2d6deac6210262b905b511fc7ff540bf28c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * Copyright (C) 2017 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.server.wm;

import android.graphics.Rect;

/**
 * The target for a BoundsAnimation.
 * @see BoundsAnimationController
 */
interface BoundsAnimationTarget {

    /**
     * Callback for the target to inform it that the animation has started, so it can do some
     * necessary preparation.
     *
     * @param schedulePipModeChangedCallback whether or not to schedule the PiP mode changed
     * callbacks
     */
    void onAnimationStart(boolean schedulePipModeChangedCallback, boolean forceUpdate);

    /**
     * Sets the size of the target (without any intermediate steps, like scheduling animation)
     * but freezes the bounds of any tasks in the target at taskBounds, to allow for more
     * flexibility during resizing. Only works for the pinned stack at the moment.  This will
     * only be called between onAnimationStart() and onAnimationEnd().
     *
     * @return Whether the target should continue to be animated and this call was successful.
     * If false, the animation will be cancelled because the user has determined that the
     * animation is now invalid and not required. In such a case, the cancel will trigger the
     * animation end callback as well, but will not send any further size changes.
     */
    boolean setPinnedStackSize(Rect stackBounds, Rect taskBounds);

    /**
     * Callback for the target to inform it that the animation has ended, so it can do some
     * necessary cleanup.
     *
     * @param schedulePipModeChangedCallback whether or not to schedule the PiP mode changed
     * callbacks
     * @param finalStackSize the final stack bounds to set on the target (can be to indicate that
     * the animation was cancelled and the target does not need to update to the final stack bounds)
     * @param moveToFullscreen whether or the target should reparent itself to the fullscreen stack
     * when the animation completes
     */
    void onAnimationEnd(boolean schedulePipModeChangedCallback, Rect finalStackSize,
            boolean moveToFullscreen);
}