summaryrefslogtreecommitdiff
path: root/hostsidetests/theme/app/src/android/theme/app/TestConfiguration.java
blob: 27fa66d9baeed16b01a90d7bfaac83affed90f17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package android.theme.app;

import android.os.Build;
import android.theme.app.modifiers.DatePickerModifier;
import android.theme.app.modifiers.ProgressBarModifier;
import android.theme.app.modifiers.SearchViewModifier;
import android.theme.app.modifiers.ViewCheckedModifier;
import android.theme.app.modifiers.ViewPressedModifier;
import android.theme.app.modifiers.TimePickerModifier;

/**
 * Constants defining the themes and layouts to be verified.
 */
public class TestConfiguration {
    @SuppressWarnings("deprecation")
    static final ThemeInfo[] THEMES = {
            // Holo
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo,
                    Build.VERSION_CODES.HONEYCOMB, "holo"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Dialog,
                    Build.VERSION_CODES.HONEYCOMB, "holo_dialog"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Dialog_MinWidth,
                    Build.VERSION_CODES.HONEYCOMB, "holo_dialog_minwidth"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Dialog_NoActionBar,
                    Build.VERSION_CODES.HONEYCOMB, "holo_dialog_noactionbar"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Dialog_NoActionBar_MinWidth,
                    Build.VERSION_CODES.HONEYCOMB, "holo_dialog_noactionbar_minwidth"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_DialogWhenLarge,
                    Build.VERSION_CODES.HONEYCOMB, "holo_dialogwhenlarge"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_DialogWhenLarge_NoActionBar,
                    Build.VERSION_CODES.HONEYCOMB, "holo_dialogwhenlarge_noactionbar"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_InputMethod,
                    Build.VERSION_CODES.HONEYCOMB, "holo_inputmethod"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_NoActionBar,
                    Build.VERSION_CODES.HONEYCOMB, "holo_noactionbar"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_NoActionBar_Fullscreen,
                    Build.VERSION_CODES.HONEYCOMB, "holo_noactionbar_fullscreen"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_NoActionBar_Overscan,
                    Build.VERSION_CODES.JELLY_BEAN_MR2, "holo_noactionbar_overscan"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_NoActionBar_TranslucentDecor,
                    Build.VERSION_CODES.KITKAT, "holo_noactionbar_translucentdecor"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Panel,
                    Build.VERSION_CODES.HONEYCOMB, "holo_panel"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Wallpaper,
                    Build.VERSION_CODES.HONEYCOMB, "holo_wallpaper"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Wallpaper_NoTitleBar,
                    Build.VERSION_CODES.HONEYCOMB, "holo_wallpaper_notitlebar"),

            // Holo Light
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light,
                    Build.VERSION_CODES.HONEYCOMB, "holo_light"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_DarkActionBar,
                    Build.VERSION_CODES.ICE_CREAM_SANDWICH, "holo_light_darkactionbar"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_Dialog,
                    Build.VERSION_CODES.HONEYCOMB, "holo_light_dialog"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_Dialog_MinWidth,
                    Build.VERSION_CODES.HONEYCOMB, "holo_light_dialog_minwidth"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_Dialog_NoActionBar,
                    Build.VERSION_CODES.HONEYCOMB, "holo_light_dialog_noactionbar"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_Dialog_NoActionBar_MinWidth,
                    Build.VERSION_CODES.HONEYCOMB, "holo_light_dialog_noactionbar_minwidth"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_DialogWhenLarge,
                    Build.VERSION_CODES.HONEYCOMB, "holo_light_dialogwhenlarge"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_DialogWhenLarge_NoActionBar,
                    Build.VERSION_CODES.HONEYCOMB, "holo_light_dialogwhenlarge_noactionbar"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_NoActionBar,
                    Build.VERSION_CODES.HONEYCOMB_MR2, "holo_light_noactionbar"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_NoActionBar_Fullscreen,
                    Build.VERSION_CODES.HONEYCOMB_MR2, "holo_light_noactionbar_fullscreen"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_NoActionBar_Overscan,
                    Build.VERSION_CODES.JELLY_BEAN_MR2, "holo_light_noactionbar_overscan"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_NoActionBar_TranslucentDecor,
                    Build.VERSION_CODES.KITKAT, "holo_light_noactionbar_translucentdecor"),
            new ThemeInfo(ThemeInfo.HOLO, android.R.style.Theme_Holo_Light_Panel,
                    Build.VERSION_CODES.HONEYCOMB, "holo_light_panel"),

            // Material
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material,
                    Build.VERSION_CODES.LOLLIPOP, "material"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Dialog,
                    Build.VERSION_CODES.LOLLIPOP, "material_dialog"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Dialog_Alert,
                    Build.VERSION_CODES.LOLLIPOP, "material_dialog_alert"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Dialog_MinWidth,
                    Build.VERSION_CODES.LOLLIPOP, "material_dialog_minwidth"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Dialog_NoActionBar,
                    Build.VERSION_CODES.LOLLIPOP, "material_dialog_noactionbar"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Dialog_NoActionBar_MinWidth,
                    Build.VERSION_CODES.LOLLIPOP, "material_dialog_noactionbar_minwidth"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Dialog_Presentation,
                    Build.VERSION_CODES.LOLLIPOP, "material_dialog_presentation"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_DialogWhenLarge,
                    Build.VERSION_CODES.LOLLIPOP, "material_dialogwhenlarge"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_DialogWhenLarge_NoActionBar,
                    Build.VERSION_CODES.LOLLIPOP, "material_dialogwhenlarge_noactionbar"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_InputMethod,
                    Build.VERSION_CODES.LOLLIPOP, "material_inputmethod"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_NoActionBar,
                    Build.VERSION_CODES.LOLLIPOP, "material_noactionbar"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_NoActionBar_Fullscreen,
                    Build.VERSION_CODES.LOLLIPOP, "material_noactionbar_fullscreen"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_NoActionBar_Overscan,
                    Build.VERSION_CODES.LOLLIPOP, "material_noactionbar_overscan"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_NoActionBar_TranslucentDecor,
                    Build.VERSION_CODES.LOLLIPOP, "material_noactionbar_translucentdecor"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Panel,
                    Build.VERSION_CODES.LOLLIPOP, "material_panel"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Settings,
                    Build.VERSION_CODES.LOLLIPOP, "material_settings"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Voice,
                    Build.VERSION_CODES.LOLLIPOP, "material_voice"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Wallpaper,
                    Build.VERSION_CODES.LOLLIPOP, "material_wallpaper"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Wallpaper_NoTitleBar,
                    Build.VERSION_CODES.LOLLIPOP, "material_wallpaper_notitlebar"),

            // Material Light
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light,
                    Build.VERSION_CODES.LOLLIPOP, "material_light"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_DarkActionBar,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_darkactionbar"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_Dialog,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_dialog"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_Dialog_Alert,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_dialog_alert"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_Dialog_MinWidth,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_dialog_minwidth"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_Dialog_NoActionBar,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_dialog_noactionbar"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_Dialog_NoActionBar_MinWidth,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_dialog_noactionbar_minwidth"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_Dialog_Presentation,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_dialog_presentation"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_DialogWhenLarge,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_dialogwhenlarge"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_DialogWhenLarge_NoActionBar,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_dialogwhenlarge_noactionbar"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_LightStatusBar,
                    Build.VERSION_CODES.M, "material_light_lightstatusbar"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_NoActionBar,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_noactionbar"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_NoActionBar_Fullscreen,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_noactionbar_fullscreen"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_NoActionBar_Overscan,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_noactionbar_overscan"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_NoActionBar_TranslucentDecor,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_noactionbar_translucentdecor"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_Panel,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_panel"),
            new ThemeInfo(ThemeInfo.MATERIAL, android.R.style.Theme_Material_Light_Voice,
                    Build.VERSION_CODES.LOLLIPOP, "material_light_voice")
    };

    static final LayoutInfo[] LAYOUTS = {
            //new LayoutInfo(R.layout.button, "button"),
            // Temporarily remove tests for pressed Button widget. The Material ripple is in
            // flux, so this is going to be failing frequently on Material until it stablizes.
            //new LayoutInfo(R.layout.button, "button_pressed",
            //        new ViewPressedModifier()),
            new LayoutInfo(R.layout.checkbox, "checkbox"),
            new LayoutInfo(R.layout.checkbox, "checkbox_checked",
                    new ViewCheckedModifier()),
            new LayoutInfo(R.layout.chronometer, "chronometer"),
            new LayoutInfo(R.layout.color_blue_bright, "color_blue_bright"),
            new LayoutInfo(R.layout.color_blue_dark, "color_blue_dark"),
            new LayoutInfo(R.layout.color_blue_light, "color_blue_light"),
            new LayoutInfo(R.layout.color_green_dark, "color_green_dark"),
            new LayoutInfo(R.layout.color_green_light, "color_green_light"),
            new LayoutInfo(R.layout.color_orange_dark, "color_orange_dark"),
            new LayoutInfo(R.layout.color_orange_light, "color_orange_light"),
            new LayoutInfo(R.layout.color_purple, "color_purple"),
            new LayoutInfo(R.layout.color_red_dark, "color_red_dark"),
            new LayoutInfo(R.layout.color_red_light, "color_red_light"),
            // Temporarily remove tests for the DatePicker widget. Something changed with font
            // rendering behavior (likely ag/12562227 which upgraded Roboto to variable format)
            // but we don't have resources available right now to update the golden images.
            //new LayoutInfo(R.layout.datepicker, "datepicker",
            //        new DatePickerModifier()),
            new LayoutInfo(R.layout.edittext, "edittext"),
            new LayoutInfo(R.layout.progressbar_horizontal_0, "progressbar_horizontal_0"),
            new LayoutInfo(R.layout.progressbar_horizontal_100, "progressbar_horizontal_100"),
            new LayoutInfo(R.layout.progressbar_horizontal_50, "progressbar_horizontal_50"),
            new LayoutInfo(R.layout.progressbar_large, "progressbar_large",
                    new ProgressBarModifier()),
            new LayoutInfo(R.layout.progressbar_small, "progressbar_small",
                    new ProgressBarModifier()),
            new LayoutInfo(R.layout.progressbar, "progressbar",
                    new ProgressBarModifier()),
            new LayoutInfo(R.layout.radiobutton_checked, "radiobutton_checked"),
            new LayoutInfo(R.layout.radiobutton, "radiobutton"),
            new LayoutInfo(R.layout.radiogroup_horizontal, "radiogroup_horizontal"),
            new LayoutInfo(R.layout.radiogroup_vertical, "radiogroup_vertical"),
            // Temporarily remove tests for the RatingBar widget. It has indeterminate rendering
            // behavior on 360dpi devices, but we don't know why yet.
            //new LayoutInfo(R.layout.ratingbar_0, "ratingbar_0"),
            //new LayoutInfo(R.layout.ratingbar_2point5, "ratingbar_2point5"),
            //new LayoutInfo(R.layout.ratingbar_5, "ratingbar_5"),
            //new LayoutInfo(R.layout.ratingbar_0, "ratingbar_0_pressed",
            //        new ViewPressedModifier()),
            //new LayoutInfo(R.layout.ratingbar_2point5, "ratingbar_2point5_pressed",
            //        new ViewPressedModifier()),
            //new LayoutInfo(R.layout.ratingbar_5, "ratingbar_5_pressed",
            //        new ViewPressedModifier()),
            // Temporarily remove tests for the SearchView widget with no hint. The "X" icon has
            // indeterminate rendering behavior on 480dpi devices, but we don't know why yet.
            //new LayoutInfo(R.layout.searchview, "searchview_query",
            //        new SearchViewModifier(SearchViewModifier.QUERY)),
            new LayoutInfo(R.layout.searchview, "searchview_query_hint",
                    new SearchViewModifier(SearchViewModifier.QUERY_HINT)),
            new LayoutInfo(R.layout.seekbar_0, "seekbar_0"),
            new LayoutInfo(R.layout.seekbar_100, "seekbar_100"),
            new LayoutInfo(R.layout.seekbar_50, "seekbar_50"),
            new LayoutInfo(R.layout.spinner, "spinner"),
            new LayoutInfo(R.layout.switch_button_checked, "switch_button_checked"),
            new LayoutInfo(R.layout.switch_button, "switch_button"),
            new LayoutInfo(R.layout.textview, "textview"),
            new LayoutInfo(R.layout.timepicker, "timepicker",
                    new TimePickerModifier()),
            new LayoutInfo(R.layout.togglebutton_checked, "togglebutton_checked"),
            new LayoutInfo(R.layout.togglebutton, "togglebutton"),
    };
}