1 /*
2  * Copyright (C) 2021 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 
17 package com.android.tv.settings.library;
18 
19 import android.annotation.SystemApi;
20 
21 import java.util.List;
22 
23 /**
24  * @hide
25  * Callback for updating UI.
26  */
27 @SystemApi
28 public interface UIUpdateCallback {
29     /**
30      *  @hide
31      *  Notify to update preferenceCompat in a fragment.
32      * @param state state identifier of the fragment
33      * @param preferenceCompat the updated preferenceCompat
34      */
35     @SystemApi
notifyUpdate(int state, PreferenceCompat preferenceCompat)36     void notifyUpdate(int state, PreferenceCompat preferenceCompat);
37 
38     /**
39      * @hide
40      * Notify to update a list of preferenceCompats.
41      * @param state state identifier of the fragment
42      * @param preferences the updated list of preferenceCompats
43      */
44     @SystemApi
notifyUpdateAll(int state, List<PreferenceCompat> preferences)45     void notifyUpdateAll(int state, List<PreferenceCompat> preferences);
46 
47     /**
48      * @hide
49      * Notify to update title of a fragment.
50      * @param state state identifier of the fragment
51      * @param title the updated title
52      */
53     @SystemApi
notifyUpdateScreenTitle(int state, String title)54     void notifyUpdateScreenTitle(int state, String title);
55 
56     /**
57      * @hide
58      * Notify to navigate backward
59      */
60     @SystemApi
notifyNavigateBackward(int state)61     void notifyNavigateBackward(int state);
62 
63 
64     /**
65      * @hide
66      * Notify to navigate forward
67      */
68     @SystemApi
notifyNavigateForward(int state)69     void notifyNavigateForward(int state);
70 }
71