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.car.ui.plugin.oemapis.appstyledview;
18 
19 import android.view.View;
20 import android.view.WindowManager;
21 
22 /** The OEM interface for a AppStyledView. */
23 public interface AppStyledViewControllerOEMV1 {
24 
25     /**
26      * Gets the view to display. This view will contain the content view set in {@link #setContent}.
27      *
28      * @return the view used for app styled view.
29      */
getView()30     View getView();
31 
32     /**
33      * Sets the content view to be contained within this AppStyledView.
34      */
setContent(View content)35     void setContent(View content);
36 
37     /**
38      * Sets a {@link Runnable} to be called whenever the close icon is clicked.
39      */
setOnBackClickListener(Runnable listener)40     void setOnBackClickListener(Runnable listener);
41 
42     int NAV_ICON_DISABLED = 0;
43     int NAV_ICON_BACK = 1;
44     int NAV_ICON_CLOSE = 2;
45 
46     /**
47      * Sets the nav icon to be used. Can be set to one of {@link #NAV_ICON_DISABLED},
48      * {@link #NAV_ICON_BACK} or {@link #NAV_ICON_CLOSE}.
49      */
setNavIcon(int navIcon)50     void setNavIcon(int navIcon);
51 
52     /**
53      * Returns the layout params for the AppStyledView dialog
54      */
getDialogWindowLayoutParam(WindowManager.LayoutParams params)55     WindowManager.LayoutParams getDialogWindowLayoutParam(WindowManager.LayoutParams params);
56 }
57