blob: 009eed79c48a09a07e9c4d989ef672449c41a370 [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;
30
31 /**
32 * Get the current state of a view in a transform animation
Selim Cinek8f2f6a62016-02-23 19:56:31 -080033 *
Selim Cinek4ffd6362015-12-29 15:12:23 +010034 * @param fadingView which view we are interested in
35 * @return the current transform state of this viewtype
36 */
37 TransformState getCurrentState(int fadingView);
38
39 /**
40 * Transform to the given view
Selim Cinek8f2f6a62016-02-23 19:56:31 -080041 *
Selim Cinek4ffd6362015-12-29 15:12:23 +010042 * @param notification the view to transform to
43 */
44 void transformTo(TransformableView notification, Runnable endRunnable);
45
46 /**
Selim Cinek8f2f6a62016-02-23 19:56:31 -080047 * Transform to the given view by a specified amount.
48 *
49 * @param notification the view to transform to
50 * @param transformationAmount how much transformation should be done
51 */
52 void transformTo(TransformableView notification, float transformationAmount);
53
54 /**
Selim Cinek4ffd6362015-12-29 15:12:23 +010055 * Transform to this view from the given view
Selim Cinek8f2f6a62016-02-23 19:56:31 -080056 *
Selim Cinek4ffd6362015-12-29 15:12:23 +010057 * @param notification the view to transform from
58 */
59 void transformFrom(TransformableView notification);
60
61 /**
Selim Cinek8f2f6a62016-02-23 19:56:31 -080062 * Transform to this view from the given view by a specified amount.
63 *
64 * @param notification the view to transform from
65 * @param transformationAmount how much transformation should be done
66 */
67 void transformFrom(TransformableView notification, float transformationAmount);
68
69 /**
Selim Cinek4ffd6362015-12-29 15:12:23 +010070 * Set this view to be fully visible or gone
Selim Cinek8f2f6a62016-02-23 19:56:31 -080071 *
Selim Cinek4ffd6362015-12-29 15:12:23 +010072 * @param visible
73 */
74 void setVisible(boolean visible);
75}