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 */
16package com.android.systemui.qs;
17
18import android.support.annotation.Nullable;
19import android.view.View;
20
21/**
22 * The bottom footer of the quick settings panel.
23 */
24public interface QSFooter {
25    /**
26     * Sets the given {@link QSPanel} to be the one that will display the quick settings.
27     */
28    void setQSPanel(@Nullable QSPanel panel);
29
30    /**
31     * Sets whether or not the footer should be visible.
32     *
33     * @param visibility One of {@link View#VISIBLE}, {@link View#INVISIBLE} or {@link View#GONE}.
34     * @see View#setVisibility(int)
35     */
36    void setVisibility(int visibility);
37
38    /**
39     * Sets whether the footer is in an expanded state.
40     */
41    void setExpanded(boolean expanded);
42
43    /**
44     * Returns the full height of the footer.
45     */
46    int getHeight();
47
48    /**
49     * Sets the percentage amount that the quick settings has been expanded.
50     *
51     * @param expansion A value from 1 to 0 that indicates how much the quick settings have been
52     *                  expanded. 1 is fully expanded.
53     */
54    void setExpansion(float expansion);
55
56    /**
57     * Sets whether or not this footer should set itself to listen for changes in any callbacks
58     * that it has implemented.
59     */
60    void setListening(boolean listening);
61
62    /**
63     * Sets whether or not the keyguard is currently being shown.
64     */
65    void setKeyguardShowing(boolean keyguardShowing);
66
67    /**
68     * Sets the {@link android.view.View.OnClickListener to be used on elements that expend QS.
69     */
70    void setExpandClickListener(View.OnClickListener onClickListener);
71
72    default void disable(int state1, int state2, boolean animate) {}
73}
74