-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathSampleCatalog.kt
More file actions
366 lines (360 loc) · 16 KB
/
Copy pathSampleCatalog.kt
File metadata and controls
366 lines (360 loc) · 16 KB
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
/*
* Copyright 2026 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
*
* https://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 com.android.camera.catalog.domain
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import com.android.camera.catalog.R
import com.android.camera.coretheme.extendedColorScheme
import com.android.camera2.extensions.Camera2ExtensionsScreen
import com.android.camera2.hdrvideo.Camera2HdrVideo
import com.android.camera2.hdrviewfinder.Camera2HdrViewfinderScreen
import com.android.camera2.manualcontrols.Camera2ManualControlsScreen
import com.android.camera2.qrscanner.Camera2QrScannerScreen
import com.android.camera2.rawcapture.Camera2RawCaptureScreen
import com.android.camera2.slowmotion.Camera2SlowMotionScreen
import com.android.camera2.takeaphoto.Camera2TakeAPhotoScreen
import com.android.camera2.takeavideo.Camera2TakeAVideoScreen
import com.android.camera2.zoomandtorch.Camera2ZoomAndTorchScreen
import com.android.camerax.concurrentcamera.CameraXConcurrentCameraScreen
import com.android.camerax.effects.CameraXEffectsScreen
import com.android.camerax.exposure.CameraXExposureScreen
import com.android.camerax.extensions.CameraXExtensionsScreen
import com.android.camerax.featurecombination.CameraXFeatureCombination
import com.android.camerax.flipwhilerecording.CameraXFlipWhileRecording
import com.android.camerax.greenscreen.CameraXGreenScreenScreen
import com.android.camerax.hdrvideo.CameraXHdrVideo
import com.android.camerax.imagelabeling.CameraXImageLabelingScreen
import com.android.camerax.lowlightboost.CameraXLowLightBoost
import com.android.camerax.luminosity.CameraXLuminosityScreen
import com.android.camerax.media3effects.CameraXMedia3EffectsScreen
import com.android.camerax.qrscanner.CameraXQrScannerScreen
import com.android.camerax.rawcapture.CameraXRawCaptureScreen
import com.android.camerax.slowmotion.CameraXSlowMotionScreen
import com.android.camerax.takeaphoto.CameraXTakeAPhotoScreen
import com.android.camerax.takeavideo.CameraXTakeAVideoScreen
import com.android.camerax.ultrahdr.CameraXUltraHdrScreen
import com.android.camerax.videopauseresume.CameraXVideoPauseResumeScreen
import com.android.camerax.videostabilization.CameraXVideoStabilization
import com.android.camerax.zoomandtorch.CameraXZoomAndTorchScreen
val sampleCatalog =
listOf(
SampleCatalogItem(
title = R.string.camerax_takeaphoto_list_title,
description = R.string.camerax_takeaphoto_list_description,
route = "CameraXTakeAPhotoScreen",
sampleEntryScreen = { CameraXTakeAPhotoScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.IMAGES,
),
SampleCatalogItem(
title = R.string.camera2_takeaphoto_list_title,
description = R.string.camera2_takeaphoto_list_description,
route = "Camera2TakeAPhotoScreen",
sampleEntryScreen = { Camera2TakeAPhotoScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.IMAGES,
),
SampleCatalogItem(
title = R.string.camerax_takeavideo_list_title,
description = R.string.camerax_takeavideo_list_description,
route = "CameraXTakeAVideoScreen",
sampleEntryScreen = { CameraXTakeAVideoScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camera2_takeavideo_list_title,
description = R.string.camera2_takeavideo_list_description,
route = "Camera2TakeAVideoScreen",
sampleEntryScreen = { Camera2TakeAVideoScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camerax_slowmotion_list_title,
description = R.string.camerax_slowmotion_list_description,
route = "CameraXSlowMotionScreen",
sampleEntryScreen = { CameraXSlowMotionScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camera2_slowmotion_list_title,
description = R.string.camera2_slowmotion_list_description,
route = "Camera2SlowMotionScreen",
sampleEntryScreen = { Camera2SlowMotionScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camerax_qrscanner_list_title,
description = R.string.camerax_qrscanner_list_description,
route = "CameraXQrScannerScreen",
sampleEntryScreen = { CameraXQrScannerScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.ML,
tags = listOf(SampleTags.ML_KIT),
),
SampleCatalogItem(
title = R.string.camerax_imagelabeling_list_title,
description = R.string.camerax_imagelabeling_list_description,
route = "CameraXImageLabelingScreen",
sampleEntryScreen = { CameraXImageLabelingScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.ML,
tags = listOf(SampleTags.ML_KIT, SampleTags.ANALYSIS),
),
SampleCatalogItem(
title = R.string.camera2_hdrviewfinder_list_title,
description = R.string.camera2_hdrviewfinder_list_description,
route = "Camera2HdrViewfinderScreen",
sampleEntryScreen = { Camera2HdrViewfinderScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.GRAPHICS,
tags = listOf(SampleTags.ANALYSIS),
),
SampleCatalogItem(
title = R.string.camerax_extensions_list_title,
description = R.string.camerax_extensions_list_description,
route = "CameraXExtensionsScreen",
sampleEntryScreen = { CameraXExtensionsScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.EXTENSIONS,
tags = listOf(SampleTags.EXTENSIONS),
),
SampleCatalogItem(
title = R.string.camera2_extensions_list_title,
description = R.string.camera2_extensions_list_description,
route = "Camera2ExtensionsScreen",
sampleEntryScreen = { Camera2ExtensionsScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.EXTENSIONS,
tags = listOf(SampleTags.EXTENSIONS),
),
SampleCatalogItem(
title = R.string.camerax_zoomandtorch_list_title,
description = R.string.camerax_zoomandtorch_list_description,
route = "CameraXZoomAndTorchScreen",
sampleEntryScreen = { CameraXZoomAndTorchScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.CONTROLS,
),
SampleCatalogItem(
title = R.string.camera2_zoomandtorch_list_title,
description = R.string.camera2_zoomandtorch_list_description,
route = "Camera2ZoomAndTorchScreen",
sampleEntryScreen = { Camera2ZoomAndTorchScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.CONTROLS,
),
SampleCatalogItem(
title = R.string.camerax_exposure_list_title,
description = R.string.camerax_exposure_list_description,
route = "CameraXExposureScreen",
sampleEntryScreen = { CameraXExposureScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.CONTROLS,
),
SampleCatalogItem(
title = R.string.camera2_manualcontrols_list_title,
description = R.string.camera2_manualcontrols_list_description,
route = "Camera2ManualControlsScreen",
sampleEntryScreen = { Camera2ManualControlsScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.CONTROLS,
),
SampleCatalogItem(
title = R.string.camerax_luminosity_list_title,
description = R.string.camerax_luminosity_list_description,
route = "CameraXLuminosityScreen",
sampleEntryScreen = { CameraXLuminosityScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.GRAPHICS,
tags = listOf(SampleTags.ANALYSIS),
),
SampleCatalogItem(
title = R.string.camera2_qrscanner_list_title,
description = R.string.camera2_qrscanner_list_description,
route = "Camera2QrScannerScreen",
sampleEntryScreen = { Camera2QrScannerScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.ML,
tags = listOf(SampleTags.ML_KIT),
),
SampleCatalogItem(
title = R.string.camerax_ultrahdr_list_title,
description = R.string.camerax_ultrahdr_list_description,
route = "CameraXUltraHdrScreen",
sampleEntryScreen = { CameraXUltraHdrScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.IMAGES,
),
SampleCatalogItem(
title = R.string.camerax_concurrentcamera_list_title,
description = R.string.camerax_concurrentcamera_list_description,
route = "CameraXConcurrentCameraScreen",
sampleEntryScreen = { CameraXConcurrentCameraScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.GRAPHICS,
),
SampleCatalogItem(
title = R.string.camerax_videopauseresume_list_title,
description = R.string.camerax_videopauseresume_list_description,
route = "CameraXVideoPauseResumeScreen",
sampleEntryScreen = { CameraXVideoPauseResumeScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camerax_rawcapture_list_title,
description = R.string.camerax_rawcapture_list_description,
route = "CameraXRawCaptureScreen",
sampleEntryScreen = { CameraXRawCaptureScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.IMAGES,
),
SampleCatalogItem(
title = R.string.camera2_rawcapture_list_title,
description = R.string.camera2_rawcapture_list_description,
route = "Camera2RawCaptureScreen",
sampleEntryScreen = { Camera2RawCaptureScreen() },
type = SampleType.CAMERA2,
category = SampleCategory.IMAGES,
),
SampleCatalogItem(
title = R.string.camerax_effects_list_title,
description = R.string.camerax_effects_list_description,
route = "CameraXEffectsScreen",
sampleEntryScreen = { CameraXEffectsScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.GRAPHICS,
isFeatured = true,
),
SampleCatalogItem(
title = R.string.camerax_media3effects_list_title,
description = R.string.camerax_media3effects_list_description,
route = "CameraXMedia3EffectsScreen",
sampleEntryScreen = { CameraXMedia3EffectsScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.GRAPHICS,
tags = listOf(SampleTags.MEDIA3),
),
SampleCatalogItem(
title = R.string.camerax_greenscreen_list_title,
description = R.string.camerax_greenscreen_list_description,
route = "CameraXGreenScreenScreen",
sampleEntryScreen = { CameraXGreenScreenScreen() },
type = SampleType.CAMERAX,
category = SampleCategory.ML,
tags = listOf(SampleTags.ML_KIT, SampleTags.ANALYSIS),
),
SampleCatalogItem(
title = R.string.camerax_hdrvideo_list_title,
description = R.string.camerax_hdrvideo_list_description,
route = "CameraXHdrVideo",
sampleEntryScreen = { CameraXHdrVideo() },
type = SampleType.CAMERAX,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camera2_hdrvideo_list_title,
description = R.string.camera2_hdrvideo_list_description,
route = "Camera2HdrVideo",
sampleEntryScreen = { Camera2HdrVideo() },
type = SampleType.CAMERA2,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camerax_lowlightboost_list_title,
description = R.string.camerax_lowlightboost_list_description,
route = "CameraXLowLightBoost",
sampleEntryScreen = { CameraXLowLightBoost() },
type = SampleType.CAMERAX,
category = SampleCategory.CONTROLS,
),
SampleCatalogItem(
title = R.string.camerax_videostabilization_list_title,
description = R.string.camerax_videostabilization_list_description,
route = "CameraXVideoStabilization",
sampleEntryScreen = { CameraXVideoStabilization() },
type = SampleType.CAMERAX,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camerax_flipwhilerecording_list_title,
description = R.string.camerax_flipwhilerecording_list_description,
route = "CameraXFlipWhileRecording",
sampleEntryScreen = { CameraXFlipWhileRecording() },
type = SampleType.CAMERAX,
category = SampleCategory.VIDEO,
tags = listOf(SampleTags.VIDEO),
),
SampleCatalogItem(
title = R.string.camerax_featurecombination_list_title,
description = R.string.camerax_featurecombination_list_description,
route = "CameraXFeatureCombination",
sampleEntryScreen = { CameraXFeatureCombination() },
type = SampleType.CAMERAX,
category = SampleCategory.CONTROLS,
),
// To create a new sample entry, add a new SampleCatalogItem here.
)
data class SampleCatalogItem(
@param:StringRes val title: Int,
@param:StringRes val description: Int,
val route: String,
val sampleEntryScreen: @Composable () -> Unit,
val type: SampleType,
val category: SampleCategory = SampleCategory.IMAGES,
val tags: List<SampleTags> = emptyList(),
val isFeatured: Boolean = false,
@param:DrawableRes val keyArt: Int? = null,
)
enum class SampleTags(
val label: String,
val backgroundColor: Color,
) {
MEDIA3("Media3", extendedColorScheme.media3),
ML_KIT("ML Kit", extendedColorScheme.mLKit),
VIDEO("Video", extendedColorScheme.media3),
EXTENSIONS("Extensions", extendedColorScheme.imagen),
ANALYSIS("Analysis", extendedColorScheme.geminiProFlash),
}
/** Broad groupings used by the home-screen filter pills. Every sample belongs to exactly one. */
enum class SampleCategory(
val label: String,
) {
IMAGES("Images"),
VIDEO("Video"),
ML("ML"),
GRAPHICS("Graphics"),
EXTENSIONS("Extensions"),
CONTROLS("Controls"),
}
enum class SampleType {
CAMERAX,
CAMERA2,
}