1 /*
2  * Copyright (C) 2020 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 package com.android.car.ui.toolbar;
17 
18 /**
19  * Interface for a Progress Bar. It's methods are a subset of the methods of
20  * {@link android.widget.ProgressBar}. This is so that an application doesn't
21  * have access to customize the {@link android.widget.ProgressBar} or other
22  * views in it's hierarchy in ways that were not intended.
23  */
24 public interface ProgressBarController {
25 
26     /** Shows/hides the progress bar */
setVisible(boolean visible)27     void setVisible(boolean visible);
28     /** Returns true if the progress bar is visible */
isVisible()29     boolean isVisible();
30     /** Equivalent to {@link android.widget.ProgressBar#setIndeterminate(boolean)} */
setIndeterminate(boolean indeterminate)31     void setIndeterminate(boolean indeterminate);
32     /** Equivalent to {@link android.widget.ProgressBar#isIndeterminate()} */
isIndeterminate()33     boolean isIndeterminate();
34     /** Equivalent to {@link android.widget.ProgressBar#setMax(int)} */
setMax(int max)35     void setMax(int max);
36     /** Equivalent to {@link android.widget.ProgressBar#getMax()} */
getMax()37     int getMax();
38     /** Equivalent to {@link android.widget.ProgressBar#setMin(int)} */
setMin(int min)39     void setMin(int min);
40     /** Equivalent to {@link android.widget.ProgressBar#getMin()} */
getMin()41     int getMin();
42     /** Equivalent to {@link android.widget.ProgressBar#setProgress(int)} */
setProgress(int progress)43     void setProgress(int progress);
44     /** Equivalent to {@link android.widget.ProgressBar#getProgress()} */
getProgress()45     int getProgress();
46 }
47