• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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 android.car.app.menu;
17 
18 import android.annotation.IntDef;
19 
20 import java.lang.annotation.Retention;
21 import java.lang.annotation.RetentionPolicy;
22 
23 /**
24  * Contains keys to the metadata of car menu, such as id, title, icon, etc.
25  */
26 public class CarMenuConstants {
27     public static class MenuItemConstants {
28         @Retention(RetentionPolicy.SOURCE)
29         @IntDef(flag = true,
30                 value = {FLAG_BROWSABLE, FLAG_FIRSTITEM})
31         public @interface MenuItemFlags {}
32 
33         /**
34          * Flag: Indicates that the item has children of its own
35          */
36         public static final int FLAG_BROWSABLE = 0x1;
37 
38         /**
39          * Flag: Indicates that the menu should scroll to this item
40          */
41         public static final int FLAG_FIRSTITEM = 0x2;
42 
43         @Retention(RetentionPolicy.SOURCE)
44         @IntDef(value = {WIDGET_CHECKBOX, WIDGET_TEXT_VIEW})
45         public @interface WidgetTypes {}
46 
47         /**
48          * Use a checkbox widget.
49          */
50         public static final int WIDGET_CHECKBOX = 0x1;
51 
52         /**
53          * Use a TextView widget
54          */
55         public static final int WIDGET_TEXT_VIEW = 0x2;
56 
57         /**
58          * Key for the car menu title.
59          */
60         public static final String KEY_TITLE = "android.car.app.menu.title";
61 
62         /**
63          * Key for the item title.
64          */
65         public static final String KEY_TEXT = "android.car.app.menu.text";
66 
67         /**
68          * Key for the left icon.
69          */
70         public static final String KEY_LEFTICON = "android.car.app.menu.leftIcon";
71 
72         /**
73          * Key for the right icon.
74          */
75         public static final String KEY_RIGHTICON = "android.car.app.menu.rightIcon";
76 
77         /**
78          * Key for the text to be shown to the right of the item.
79          */
80         public static final String KEY_RIGHTTEXT = "android.car.app.menu.rightText";
81 
82         /**
83          * Key for the widget type.
84          */
85         public static final String KEY_WIDGET = "android.car.app.menu.widget";
86 
87         /**
88          * Key for the widget state.
89          */
90         public static final String KEY_WIDGET_STATE = "android.car.app.menu.widget_state";
91 
92         /**
93          * Key for the value of whether the item is a place holder.
94          */
95         public static final String KEY_EMPTY_PLACEHOLDER = "android.car.app.menu.empty_placeholder";
96 
97         /**
98          * Key for the flags.
99          */
100         public static final String KEY_FLAGS = "android.car.app.menu.flags";
101 
102         /**
103          * Key for the menu item id.
104          */
105         public static final String KEY_ID = "android.car.app.menu.id";
106 
107         /**
108          * Key for the remote views.
109          */
110         public static final String KEY_REMOTEVIEWS = "android.car.app.menu.remoteViews";
111     }
112 }