Skip to content

Commit 2f8f459

Browse files
committed
feat: Update Beta icon
Signed-off-by: Hu Shenghao <dede.hu@qq.com>
1 parent f110f59 commit 2f8f459

File tree

7 files changed

+105
-20
lines changed

7 files changed

+105
-20
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright 2025 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.dede.android_eggs.ui.composes.icons.outlined
18+
19+
import androidx.compose.material.icons.Icons
20+
import androidx.compose.material.icons.materialPath
21+
import androidx.compose.ui.graphics.vector.ImageVector
22+
import com.dede.android_eggs.ui.composes.icons.materialIcon
23+
24+
public val Icons.Outlined.Beta: ImageVector
25+
get() {
26+
if (_beta != null) {
27+
return _beta!!
28+
}
29+
_beta = materialIcon(
30+
name = "Outlined.Beta",
31+
viewportWidth = 1_024.0f,
32+
viewportHeight = 1_024.0f
33+
) {
34+
materialPath {
35+
moveTo(393.8f, 750.5f)
36+
lineTo(393.8f, 986.5f)
37+
lineTo(293.5f, 986.5f)
38+
lineTo(293.5f, 286.7f)
39+
curveTo(293.5f, 224.9f, 311.9f, 176.2f, 348.2f, 139.9f)
40+
curveTo(384.0f, 103.7f, 433.9f, 85.3f, 495.4f, 85.3f)
41+
curveTo(554.7f, 85.3f, 600.3f, 99.8f, 634.5f, 128.0f)
42+
curveTo(668.2f, 157.0f, 684.8f, 197.1f, 684.8f, 247.9f)
43+
curveTo(684.8f, 282.9f, 673.7f, 315.7f, 651.5f, 346.0f)
44+
curveTo(629.3f, 376.3f, 600.7f, 397.2f, 565.3f, 408.7f)
45+
lineTo(565.3f, 410.5f)
46+
curveTo(618.7f, 419.0f, 660.1f, 438.2f, 688.2f, 469.3f)
47+
curveTo(716.4f, 499.6f, 730.5f, 538.5f, 730.5f, 586.2f)
48+
curveTo(730.5f, 642.6f, 710.8f, 688.6f, 672.0f, 724.1f)
49+
curveTo(632.7f, 759.5f, 581.5f, 777.0f, 517.5f, 777.0f)
50+
curveTo(472.3f, 777.0f, 430.9f, 768.0f, 393.8f, 750.5f)
51+
moveTo(457.4f, 458.7f)
52+
lineTo(457.4f, 376.7f)
53+
curveTo(494.5f, 372.1f, 524.8f, 358.4f, 549.1f, 335.4f)
54+
curveTo(573.0f, 311.9f, 585.0f, 285.9f, 585.0f, 256.0f)
55+
curveTo(585.0f, 197.1f, 554.7f, 167.3f, 494.9f, 167.3f)
56+
curveTo(462.5f, 167.3f, 437.3f, 177.5f, 419.8f, 198.4f)
57+
curveTo(402.3f, 219.3f, 393.8f, 248.3f, 393.8f, 286.3f)
58+
lineTo(393.8f, 661.3f)
59+
curveTo(432.6f, 683.9f, 470.6f, 695.0f, 507.3f, 695.0f)
60+
curveTo(543.1f, 695.0f, 571.3f, 685.7f, 591.4f, 667.3f)
61+
curveTo(611.4f, 648.5f, 621.2f, 622.1f, 621.2f, 588.4f)
62+
curveTo(621.2f, 512.0f, 566.6f, 469.3f, 457.4f, 458.7f)
63+
close()
64+
}
65+
}
66+
return _beta!!
67+
}
68+
69+
private var _beta: ImageVector? = null

app/src/main/java/com/dede/android_eggs/ui/composes/icons/rounded/Shapes.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 The Android Open Source Project
2+
* Copyright 2025 The Android Open Source Project
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

app/src/main/java/com/dede/android_eggs/views/settings/compose/groups/AboutGroup.kt

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
package com.dede.android_eggs.views.settings.compose.groups
22

3-
import androidx.compose.foundation.layout.width
43
import androidx.compose.material.icons.Icons
54
import androidx.compose.material.icons.rounded.Download
65
import androidx.compose.material.icons.rounded.Info
76
import androidx.compose.material.icons.rounded.Policy
8-
import androidx.compose.material3.Text
7+
import androidx.compose.material3.Icon
98
import androidx.compose.runtime.Composable
109
import androidx.compose.ui.Modifier
10+
import androidx.compose.ui.draw.drawWithCache
11+
import androidx.compose.ui.graphics.Matrix
12+
import androidx.compose.ui.graphics.setFrom
1113
import androidx.compose.ui.platform.LocalContext
1214
import androidx.compose.ui.res.stringResource
13-
import androidx.compose.ui.text.font.FontStyle
14-
import androidx.compose.ui.text.font.FontWeight
15-
import androidx.compose.ui.text.style.TextAlign
1615
import androidx.compose.ui.tooling.preview.Preview
17-
import androidx.compose.ui.unit.dp
18-
import androidx.compose.ui.unit.em
1916
import com.dede.android_eggs.R
17+
import com.dede.android_eggs.ui.composes.icons.outlined.Beta
2018
import com.dede.android_eggs.util.CustomTabsBrowser
2119
import com.dede.android_eggs.views.settings.compose.basic.ExpandOptionsPref
2220
import com.dede.android_eggs.views.settings.compose.basic.Option
@@ -37,13 +35,20 @@ fun AboutGroup() {
3735
VersionOption()
3836
Option(
3937
leadingIcon = {
40-
Text(
41-
"β",
42-
fontSize = 5.2.em,
43-
fontStyle = FontStyle.Italic,
44-
fontWeight = FontWeight.SemiBold,
45-
textAlign = TextAlign.Center,
46-
modifier = Modifier.width(24.dp),
38+
Icon(
39+
imageVector = Icons.Outlined.Beta,
40+
modifier = Modifier
41+
.drawWithCache {
42+
onDrawWithContent {
43+
val androidMatrix = android.graphics.Matrix()
44+
androidMatrix.setSkew(-.18f, 0f)
45+
androidMatrix.postTranslate(drawContext.size.width * .16f, 0f)
46+
val matrix = Matrix().apply { setFrom(androidMatrix) }
47+
drawContext.transform.transform(matrix)
48+
drawContent()
49+
}
50+
},
51+
contentDescription = stringResource(StringsR.string.label_beta)
4752
)
4853
},
4954
title = stringResource(StringsR.string.label_beta),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
Outlined.Beta
12
Rounded.Shapes
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="48dp"
3+
android:height="48dp"
4+
android:viewportWidth="1024"
5+
android:viewportHeight="1024">
6+
<path
7+
android:fillColor="#000000"
8+
android:pathData="M393.8,750.5 L393.8,986.5 293.5,986.5 293.5,286.7C293.5,224.9 311.9,176.2 348.2,139.9 384,103.7 433.9,85.3 495.4,85.3 554.7,85.3 600.3,99.8 634.5,128 668.2,157 684.8,197.1 684.8,247.9 684.8,282.9 673.7,315.7 651.5,346 629.3,376.3 600.7,397.2 565.3,408.7L565.3,410.5C618.7,419 660.1,438.2 688.2,469.3 716.4,499.6 730.5,538.5 730.5,586.2 730.5,642.6 710.8,688.6 672,724.1 632.7,759.5 581.5,777 517.5,777 472.3,777 430.9,768 393.8,750.5M457.4,458.7 L457.4,376.7C494.5,372.1 524.8,358.4 549.1,335.4 573,311.9 585,285.9 585,256 585,197.1 554.7,167.3 494.9,167.3 462.5,167.3 437.3,177.5 419.8,198.4 402.3,219.3 393.8,248.3 393.8,286.3L393.8,661.3C432.6,683.9 470.6,695 507.3,695 543.1,695 571.3,685.7 591.4,667.3 611.4,648.5 621.2,622.1 621.2,588.4 621.2,512 566.6,469.3 457.4,458.7Z" />
9+
</vector>

script/compose-material-icons-generator/src/main/kotlin/androidx/compose/material/icons/generator/IconProcessor.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class IconProcessor(
6666
fun process(): List<Icon> {
6767
val icons = loadIcons()
6868

69-
ensureIconsExistInAllThemes(icons)
69+
// disable this check for now, as we are not generating all icons in all themes
70+
//ensureIconsExistInAllThemes(icons)
7071
val (regularIcons, autoMirroredIcons) = icons.partition { !it.autoMirrored }
7172
writeApiFile(regularIcons, generatedApiFile)
7273
writeApiFile(autoMirroredIcons, generatedAutoMirroredApiFile)

script/compose-material-icons-generator/src/main/kotlin/androidx/compose/material/icons/generator/IconTheme.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ import java.util.Locale
2525
* @property themeClassName the CameCase name used for the theme objects
2626
*/
2727
enum class IconTheme(val themePackageName: String, val themeClassName: String) {
28-
// Filled("filled", "Filled"),
29-
// Outlined("outlined", "Outlined"),
28+
Filled("filled", "Filled"),
29+
Outlined("outlined", "Outlined"),
3030
Rounded("rounded", "Rounded"),
31-
// TwoTone("twotone", "TwoTone"),
32-
// Sharp("sharp", "Sharp"),
31+
TwoTone("twotone", "TwoTone"),
32+
Sharp("sharp", "Sharp"),
3333
}
3434

3535
/**

0 commit comments

Comments
 (0)