1 /*
2 * Copyright 2024 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 androidx.compose.material3.internal
18
19 import androidx.compose.ui.graphics.Color
20 import androidx.compose.ui.graphics.PathFillType
21 import androidx.compose.ui.graphics.SolidColor
22 import androidx.compose.ui.graphics.StrokeCap
23 import androidx.compose.ui.graphics.StrokeJoin
24 import androidx.compose.ui.graphics.vector.DefaultFillType
25 import androidx.compose.ui.graphics.vector.ImageVector
26 import androidx.compose.ui.graphics.vector.PathBuilder
27 import androidx.compose.ui.graphics.vector.path
28 import androidx.compose.ui.unit.dp
29
30 internal object Icons {
31
32 internal object AutoMirrored {
33 internal object Filled {
34 internal val KeyboardArrowLeft: ImageVector
35 get() {
36 if (_keyboardArrowLeft != null) {
37 return _keyboardArrowLeft!!
38 }
39 _keyboardArrowLeft =
40 materialIcon(
41 name = "AutoMirrored.Filled.KeyboardArrowLeft",
42 autoMirror = true
<lambda>null43 ) {
44 materialPath {
45 moveTo(15.41f, 16.59f)
46 lineTo(10.83f, 12.0f)
47 lineToRelative(4.58f, -4.59f)
48 lineTo(14.0f, 6.0f)
49 lineToRelative(-6.0f, 6.0f)
50 lineToRelative(6.0f, 6.0f)
51 lineToRelative(1.41f, -1.41f)
52 close()
53 }
54 }
55 return _keyboardArrowLeft!!
56 }
57
58 private var _keyboardArrowLeft: ImageVector? = null
59
60 internal val KeyboardArrowRight: ImageVector
61 get() {
62 if (_keyboardArrowRight != null) {
63 return _keyboardArrowRight!!
64 }
65 _keyboardArrowRight =
66 materialIcon(
67 name = "AutoMirrored.Filled.KeyboardArrowRight",
68 autoMirror = true
<lambda>null69 ) {
70 materialPath {
71 moveTo(8.59f, 16.59f)
72 lineTo(13.17f, 12.0f)
73 lineTo(8.59f, 7.41f)
74 lineTo(10.0f, 6.0f)
75 lineToRelative(6.0f, 6.0f)
76 lineToRelative(-6.0f, 6.0f)
77 lineToRelative(-1.41f, -1.41f)
78 close()
79 }
80 }
81 return _keyboardArrowRight!!
82 }
83
84 private var _keyboardArrowRight: ImageVector? = null
85 }
86 }
87
88 internal object Filled {
89 internal val Close: ImageVector
90 get() {
91 if (_close != null) {
92 return _close!!
93 }
94 _close =
<lambda>null95 materialIcon(name = "Filled.Close") {
96 materialPath {
97 moveTo(19.0f, 6.41f)
98 lineTo(17.59f, 5.0f)
99 lineTo(12.0f, 10.59f)
100 lineTo(6.41f, 5.0f)
101 lineTo(5.0f, 6.41f)
102 lineTo(10.59f, 12.0f)
103 lineTo(5.0f, 17.59f)
104 lineTo(6.41f, 19.0f)
105 lineTo(12.0f, 13.41f)
106 lineTo(17.59f, 19.0f)
107 lineTo(19.0f, 17.59f)
108 lineTo(13.41f, 12.0f)
109 close()
110 }
111 }
112 return _close!!
113 }
114
115 private var _close: ImageVector? = null
116
117 internal val Check: ImageVector
118 get() {
119 if (_check != null) {
120 return _check!!
121 }
122 _check =
<lambda>null123 materialIcon(name = "Filled.Check") {
124 materialPath {
125 moveTo(9.0f, 16.17f)
126 lineTo(4.83f, 12.0f)
127 lineToRelative(-1.42f, 1.41f)
128 lineTo(9.0f, 19.0f)
129 lineTo(21.0f, 7.0f)
130 lineToRelative(-1.41f, -1.41f)
131 close()
132 }
133 }
134 return _check!!
135 }
136
137 private var _check: ImageVector? = null
138
139 internal val Edit: ImageVector
140 get() {
141 if (_edit != null) {
142 return _edit!!
143 }
144 _edit =
<lambda>null145 materialIcon(name = "Filled.Edit") {
146 materialPath {
147 moveTo(3.0f, 17.25f)
148 verticalLineTo(21.0f)
149 horizontalLineToRelative(3.75f)
150 lineTo(17.81f, 9.94f)
151 lineToRelative(-3.75f, -3.75f)
152 lineTo(3.0f, 17.25f)
153 close()
154 moveTo(20.71f, 7.04f)
155 curveToRelative(0.39f, -0.39f, 0.39f, -1.02f, 0.0f, -1.41f)
156 lineToRelative(-2.34f, -2.34f)
157 curveToRelative(-0.39f, -0.39f, -1.02f, -0.39f, -1.41f, 0.0f)
158 lineToRelative(-1.83f, 1.83f)
159 lineToRelative(3.75f, 3.75f)
160 lineToRelative(1.83f, -1.83f)
161 close()
162 }
163 }
164 return _edit!!
165 }
166
167 private var _edit: ImageVector? = null
168
169 internal val DateRange: ImageVector
170 get() {
171 if (_dateRange != null) {
172 return _dateRange!!
173 }
174 _dateRange =
<lambda>null175 materialIcon(name = "Filled.DateRange") {
176 materialPath {
177 moveTo(9.0f, 11.0f)
178 lineTo(7.0f, 11.0f)
179 verticalLineToRelative(2.0f)
180 horizontalLineToRelative(2.0f)
181 verticalLineToRelative(-2.0f)
182 close()
183 moveTo(13.0f, 11.0f)
184 horizontalLineToRelative(-2.0f)
185 verticalLineToRelative(2.0f)
186 horizontalLineToRelative(2.0f)
187 verticalLineToRelative(-2.0f)
188 close()
189 moveTo(17.0f, 11.0f)
190 horizontalLineToRelative(-2.0f)
191 verticalLineToRelative(2.0f)
192 horizontalLineToRelative(2.0f)
193 verticalLineToRelative(-2.0f)
194 close()
195 moveTo(19.0f, 4.0f)
196 horizontalLineToRelative(-1.0f)
197 lineTo(18.0f, 2.0f)
198 horizontalLineToRelative(-2.0f)
199 verticalLineToRelative(2.0f)
200 lineTo(8.0f, 4.0f)
201 lineTo(8.0f, 2.0f)
202 lineTo(6.0f, 2.0f)
203 verticalLineToRelative(2.0f)
204 lineTo(5.0f, 4.0f)
205 curveToRelative(-1.11f, 0.0f, -1.99f, 0.9f, -1.99f, 2.0f)
206 lineTo(3.0f, 20.0f)
207 curveToRelative(0.0f, 1.1f, 0.89f, 2.0f, 2.0f, 2.0f)
208 horizontalLineToRelative(14.0f)
209 curveToRelative(1.1f, 0.0f, 2.0f, -0.9f, 2.0f, -2.0f)
210 lineTo(21.0f, 6.0f)
211 curveToRelative(0.0f, -1.1f, -0.9f, -2.0f, -2.0f, -2.0f)
212 close()
213 moveTo(19.0f, 20.0f)
214 lineTo(5.0f, 20.0f)
215 lineTo(5.0f, 9.0f)
216 horizontalLineToRelative(14.0f)
217 verticalLineToRelative(11.0f)
218 close()
219 }
220 }
221 return _dateRange!!
222 }
223
224 private var _dateRange: ImageVector? = null
225
226 internal val ArrowDropDown: ImageVector
227 get() {
228 if (_arrowDropDown != null) {
229 return _arrowDropDown!!
230 }
231 _arrowDropDown =
<lambda>null232 materialIcon(name = "Filled.ArrowDropDown") {
233 materialPath {
234 moveTo(7.0f, 10.0f)
235 lineToRelative(5.0f, 5.0f)
236 lineToRelative(5.0f, -5.0f)
237 close()
238 }
239 }
240 return _arrowDropDown!!
241 }
242
243 private var _arrowDropDown: ImageVector? = null
244 }
245
246 internal object Outlined {
247
248 val Schedule: ImageVector
249 get() {
250 if (_schedule != null) {
251 return _schedule!!
252 }
253 _schedule =
<lambda>null254 materialIcon(name = "Outlined.Schedule") {
255 materialPath {
256 moveTo(11.99f, 2.0f)
257 curveTo(6.47f, 2.0f, 2.0f, 6.48f, 2.0f, 12.0f)
258 reflectiveCurveToRelative(4.47f, 10.0f, 9.99f, 10.0f)
259 curveTo(17.52f, 22.0f, 22.0f, 17.52f, 22.0f, 12.0f)
260 reflectiveCurveTo(17.52f, 2.0f, 11.99f, 2.0f)
261 close()
262 moveTo(12.0f, 20.0f)
263 curveToRelative(-4.42f, 0.0f, -8.0f, -3.58f, -8.0f, -8.0f)
264 reflectiveCurveToRelative(3.58f, -8.0f, 8.0f, -8.0f)
265 reflectiveCurveToRelative(8.0f, 3.58f, 8.0f, 8.0f)
266 reflectiveCurveToRelative(-3.58f, 8.0f, -8.0f, 8.0f)
267 close()
268 moveTo(12.5f, 7.0f)
269 lineTo(11.0f, 7.0f)
270 verticalLineToRelative(6.0f)
271 lineToRelative(5.25f, 3.15f)
272 lineToRelative(0.75f, -1.23f)
273 lineToRelative(-4.5f, -2.67f)
274 close()
275 }
276 }
277 return _schedule!!
278 }
279
280 private var _schedule: ImageVector? = null
281
282 val Keyboard: ImageVector
283 get() {
284 if (_keyboard != null) {
285 return _keyboard!!
286 }
287 _keyboard =
<lambda>null288 materialIcon(name = "Outlined.Keyboard") {
289 materialPath {
290 moveTo(20.0f, 7.0f)
291 verticalLineToRelative(10.0f)
292 lineTo(4.0f, 17.0f)
293 lineTo(4.0f, 7.0f)
294 horizontalLineToRelative(16.0f)
295 moveToRelative(0.0f, -2.0f)
296 lineTo(4.0f, 5.0f)
297 curveToRelative(-1.1f, 0.0f, -1.99f, 0.9f, -1.99f, 2.0f)
298 lineTo(2.0f, 17.0f)
299 curveToRelative(0.0f, 1.1f, 0.9f, 2.0f, 2.0f, 2.0f)
300 horizontalLineToRelative(16.0f)
301 curveToRelative(1.1f, 0.0f, 2.0f, -0.9f, 2.0f, -2.0f)
302 lineTo(22.0f, 7.0f)
303 curveToRelative(0.0f, -1.1f, -0.9f, -2.0f, -2.0f, -2.0f)
304 close()
305 moveTo(11.0f, 8.0f)
306 horizontalLineToRelative(2.0f)
307 verticalLineToRelative(2.0f)
308 horizontalLineToRelative(-2.0f)
309 close()
310 moveTo(11.0f, 11.0f)
311 horizontalLineToRelative(2.0f)
312 verticalLineToRelative(2.0f)
313 horizontalLineToRelative(-2.0f)
314 close()
315 moveTo(8.0f, 8.0f)
316 horizontalLineToRelative(2.0f)
317 verticalLineToRelative(2.0f)
318 lineTo(8.0f, 10.0f)
319 close()
320 moveTo(8.0f, 11.0f)
321 horizontalLineToRelative(2.0f)
322 verticalLineToRelative(2.0f)
323 lineTo(8.0f, 13.0f)
324 close()
325 moveTo(5.0f, 11.0f)
326 horizontalLineToRelative(2.0f)
327 verticalLineToRelative(2.0f)
328 lineTo(5.0f, 13.0f)
329 close()
330 moveTo(5.0f, 8.0f)
331 horizontalLineToRelative(2.0f)
332 verticalLineToRelative(2.0f)
333 lineTo(5.0f, 10.0f)
334 close()
335 moveTo(8.0f, 14.0f)
336 horizontalLineToRelative(8.0f)
337 verticalLineToRelative(2.0f)
338 lineTo(8.0f, 16.0f)
339 close()
340 moveTo(14.0f, 11.0f)
341 horizontalLineToRelative(2.0f)
342 verticalLineToRelative(2.0f)
343 horizontalLineToRelative(-2.0f)
344 close()
345 moveTo(14.0f, 8.0f)
346 horizontalLineToRelative(2.0f)
347 verticalLineToRelative(2.0f)
348 horizontalLineToRelative(-2.0f)
349 close()
350 moveTo(17.0f, 11.0f)
351 horizontalLineToRelative(2.0f)
352 verticalLineToRelative(2.0f)
353 horizontalLineToRelative(-2.0f)
354 close()
355 moveTo(17.0f, 8.0f)
356 horizontalLineToRelative(2.0f)
357 verticalLineToRelative(2.0f)
358 horizontalLineToRelative(-2.0f)
359 close()
360 }
361 }
362 return _keyboard!!
363 }
364
365 private var _keyboard: ImageVector? = null
366 }
367 }
368
materialIconnull369 private inline fun materialIcon(
370 name: String,
371 block: ImageVector.Builder.() -> ImageVector.Builder
372 ): ImageVector =
373 ImageVector.Builder(
374 name = name,
375 defaultWidth = MaterialIconDimension.dp,
376 defaultHeight = MaterialIconDimension.dp,
377 viewportWidth = MaterialIconDimension,
378 viewportHeight = MaterialIconDimension
379 )
380 .block()
381 .build()
382
383 private inline fun materialIcon(
384 name: String,
385 autoMirror: Boolean = false,
386 block: ImageVector.Builder.() -> ImageVector.Builder
387 ): ImageVector =
388 ImageVector.Builder(
389 name = name,
390 defaultWidth = MaterialIconDimension.dp,
391 defaultHeight = MaterialIconDimension.dp,
392 viewportWidth = MaterialIconDimension,
393 viewportHeight = MaterialIconDimension,
394 autoMirror = autoMirror
395 )
396 .block()
397 .build()
398
399 private inline fun ImageVector.Builder.materialPath(
400 fillAlpha: Float = 1f,
401 strokeAlpha: Float = 1f,
402 pathFillType: PathFillType = DefaultFillType,
403 pathBuilder: PathBuilder.() -> Unit
404 ) =
405 path(
406 fill = SolidColor(Color.Black),
407 fillAlpha = fillAlpha,
408 stroke = null,
409 strokeAlpha = strokeAlpha,
410 strokeLineWidth = 1f,
411 strokeLineCap = StrokeCap.Butt,
412 strokeLineJoin = StrokeJoin.Bevel,
413 strokeLineMiter = 1f,
414 pathFillType = pathFillType,
415 pathBuilder = pathBuilder
416 )
417
418 // All Material icons (currently) are 24dp by 24dp, with a viewport size of 24 by 24.
419 private const val MaterialIconDimension = 24f
420