blob: 0a2533a8426ead3246cd982f518d0d9ecc0e333e [file] [log] [blame]
Jason Monk3d5f5512014-07-25 11:17:28 -04001/*
Anthony Chen54daefe2017-04-07 17:19:54 -07002 * Copyright (C) 2017 The Android Open Source Project
Jason Monk3d5f5512014-07-25 11:17:28 -04003 *
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
Jason Monke5b770e2017-03-03 21:49:29 -050014 * limitations under the License
Jason Monk3d5f5512014-07-25 11:17:28 -040015 */
16package com.android.systemui.qs;
17
Jason Monk3d5f5512014-07-25 11:17:28 -040018import android.view.View;
Jason Monk3d5f5512014-07-25 11:17:28 -040019
Gus Prevasab336792018-11-14 13:52:20 -050020import androidx.annotation.Nullable;
21
Anthony Chen54daefe2017-04-07 17:19:54 -070022/**
23 * The bottom footer of the quick settings panel.
24 */
25public interface QSFooter {
26 /**
27 * Sets the given {@link QSPanel} to be the one that will display the quick settings.
28 */
29 void setQSPanel(@Nullable QSPanel panel);
Jason Monk3d5f5512014-07-25 11:17:28 -040030
Anthony Chen54daefe2017-04-07 17:19:54 -070031 /**
Fabian Kozynskic8d8f052019-09-09 09:15:04 -040032 * Sets the given {@link QuickQSPanel} to be the one associated with quick settings.
33 */
34 default void setQQSPanel(@Nullable QuickQSPanel panel) {};
35
36 /**
Anthony Chen54daefe2017-04-07 17:19:54 -070037 * Sets whether or not the footer should be visible.
38 *
39 * @param visibility One of {@link View#VISIBLE}, {@link View#INVISIBLE} or {@link View#GONE}.
40 * @see View#setVisibility(int)
41 */
42 void setVisibility(int visibility);
Robin Leea249aee2016-02-03 13:42:56 +000043
Anthony Chen54daefe2017-04-07 17:19:54 -070044 /**
45 * Sets whether the footer is in an expanded state.
46 */
47 void setExpanded(boolean expanded);
Jason Monk3d5f5512014-07-25 11:17:28 -040048
Anthony Chen54daefe2017-04-07 17:19:54 -070049 /**
50 * Returns the full height of the footer.
51 */
52 int getHeight();
Jason Monk3d5f5512014-07-25 11:17:28 -040053
Anthony Chen54daefe2017-04-07 17:19:54 -070054 /**
55 * Sets the percentage amount that the quick settings has been expanded.
56 *
57 * @param expansion A value from 1 to 0 that indicates how much the quick settings have been
58 * expanded. 1 is fully expanded.
59 */
60 void setExpansion(float expansion);
Jason Monk3d5f5512014-07-25 11:17:28 -040061
Anthony Chen54daefe2017-04-07 17:19:54 -070062 /**
63 * Sets whether or not this footer should set itself to listen for changes in any callbacks
64 * that it has implemented.
65 */
66 void setListening(boolean listening);
Jason Monkb1c2f3b2014-08-20 10:17:00 -040067
Anthony Chen54daefe2017-04-07 17:19:54 -070068 /**
69 * Sets whether or not the keyguard is currently being shown.
70 */
71 void setKeyguardShowing(boolean keyguardShowing);
Jason Monke5b770e2017-03-03 21:49:29 -050072
Anthony Chen54daefe2017-04-07 17:19:54 -070073 /**
Amin Shaikh8a3e23c2018-04-17 11:14:32 -040074 * Sets the {@link android.view.View.OnClickListener to be used on elements that expend QS.
Anthony Chen54daefe2017-04-07 17:19:54 -070075 */
Amin Shaikh8a3e23c2018-04-17 11:14:32 -040076 void setExpandClickListener(View.OnClickListener onClickListener);
Amin Shaikhf09450b2018-04-06 17:32:45 -040077
78 default void disable(int state1, int state2, boolean animate) {}
Jason Monk3d5f5512014-07-25 11:17:28 -040079}