blob: dd7c4c7a6a034e3e822526e5df6fe72f662ea944 [file] [log] [blame]
Selim Cinek4ffd6362015-12-29 15:12:23 +01001/*
2 * Copyright (C) 2016 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
17package com.android.systemui.statusbar;
18
19import com.android.systemui.statusbar.notification.TransformState;
20
21/**
22 * A view that can be transformed to and from.
23 */
24public interface TransformableView {
25 int TRANSFORMING_VIEW_HEADER = 0;
26 int TRANSFORMING_VIEW_TITLE = 1;
27 int TRANSFORMING_VIEW_TEXT = 2;
28 int TRANSFORMING_VIEW_IMAGE = 3;
29 int TRANSFORMING_VIEW_PROGRESS = 4;
Selim Cinekdf5bf612016-02-26 09:56:31 -080030 int TRANSFORMING_VIEW_ACTIONS = 5;
Selim Cinek4ffd6362015-12-29 15:12:23 +010031
32 /**
33 * Get the current state of a view in a transform animation
Selim Cinek8f2f6a62016-02-23 19:56:31 -080034 *
Selim Cinek4ffd6362015-12-29 15:12:23 +010035 * @param fadingView which view we are interested in
36 * @return the current transform state of this viewtype
37 */
38 TransformState getCurrentState(int fadingView);
39
40 /**
41 * Transform to the given view
Selim Cinek8f2f6a62016-02-23 19:56:31 -080042 *
Selim Cinek4ffd6362015-12-29 15:12:23 +010043 * @param notification the view to transform to
44 */
45 void transformTo(TransformableView notification, Runnable endRunnable);
46
47 /**
Selim Cinek8f2f6a62016-02-23 19:56:31 -080048 * Transform to the given view by a specified amount.
49 *
50 * @param notification the view to transform to
51 * @param transformationAmount how much transformation should be done
52 */
53 void transformTo(TransformableView notification, float transformationAmount);
54
55 /**
Selim Cinek4ffd6362015-12-29 15:12:23 +010056 * Transform to this view from the given view
Selim Cinek8f2f6a62016-02-23 19:56:31 -080057 *
Selim Cinek4ffd6362015-12-29 15:12:23 +010058 * @param notification the view to transform from
59 */
60 void transformFrom(TransformableView notification);
61
62 /**
Selim Cinek8f2f6a62016-02-23 19:56:31 -080063 * Transform to this view from the given view by a specified amount.
64 *
65 * @param notification the view to transform from
66 * @param transformationAmount how much transformation should be done
67 */
68 void transformFrom(TransformableView notification, float transformationAmount);
69
70 /**
Selim Cinek4ffd6362015-12-29 15:12:23 +010071 * Set this view to be fully visible or gone
Selim Cinek8f2f6a62016-02-23 19:56:31 -080072 *
Selim Cinek4ffd6362015-12-29 15:12:23 +010073 * @param visible
74 */
75 void setVisible(boolean visible);
76}