Skip to content

Commit 80befd2

Browse files
authored
Introduce QuackIcon, QuackImage (#694)
* Fixed an issue where images would not load correctly when ColorFilter.tint was QuackColor.Unspecified * Introduce QuackIcon, QuackImage * Update catalog permission (add internet) * Update generated files * Prepare a new version * Make spotless happy * Fix publish issue
1 parent e7b9466 commit 80befd2

File tree

23 files changed

+2161
-137
lines changed

23 files changed

+2161
-137
lines changed

aide/src/main/kotlin/team/duckie/quackquack/aide/rule/QuackComponents.kt

+43
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,49 @@ internal val quackComponents: Map<String, String> = run {
2525
aide["QuackSecondarySmallButton"] = "button"
2626
aide["QuackSecondaryRoundSmallButton"] = "button"
2727

28+
aide["QuackIcon"] = "icon"
29+
aide["QuackAreaIcon"] = "icon"
30+
aide["QuackArrowBackIcon"] = "icon"
31+
aide["QuackArrowDownIcon"] = "icon"
32+
aide["QuackArrowRightIcon"] = "icon"
33+
aide["QuackArrowSendIcon"] = "icon"
34+
aide["QuackBadgeIcon"] = "icon"
35+
aide["QuackBookmarkIcon"] = "icon"
36+
aide["QuackBuyIcon"] = "icon"
37+
aide["QuackCameraIcon"] = "icon"
38+
aide["QuackCheckIcon"] = "icon"
39+
aide["QuackCloseIcon"] = "icon"
40+
aide["QuackCommentIcon"] = "icon"
41+
aide["QuackDeleteIcon"] = "icon"
42+
aide["QuackDeleteBgIcon"] = "icon"
43+
aide["QuackDmIcon"] = "icon"
44+
aide["QuackFeedIcon"] = "icon"
45+
aide["QuackFilledBookmarkIcon"] = "icon"
46+
aide["QuackFilledHeartIcon"] = "icon"
47+
aide["QuackFilledProfileIcon"] = "icon"
48+
aide["QuackFilterIcon"] = "icon"
49+
aide["QuackGalleryIcon"] = "icon"
50+
aide["QuackHeartIcon"] = "icon"
51+
aide["QuackImageIcon"] = "icon"
52+
aide["QuackImageEditIcon"] = "icon"
53+
aide["QuackImageEditBgIcon"] = "icon"
54+
aide["QuackMarketPriceIcon"] = "icon"
55+
aide["QuackMoreIcon"] = "icon"
56+
aide["QuackNoticeAddIcon"] = "icon"
57+
aide["QuackPlaceIcon"] = "icon"
58+
aide["QuackPlusIcon"] = "icon"
59+
aide["QuackProfileIcon"] = "icon"
60+
aide["QuackSearchIcon"] = "icon"
61+
aide["QuackSellIcon"] = "icon"
62+
aide["QuackSettingIcon"] = "icon"
63+
aide["QuackShareIcon"] = "icon"
64+
aide["QuackTagIcon"] = "icon"
65+
aide["QuackTextLogoIcon"] = "icon"
66+
aide["QuackWhiteHeartIcon"] = "icon"
67+
aide["QuackWonIcon"] = "icon"
68+
69+
aide["QuackImage"] = "image"
70+
2871
aide["QuackOutlinedTag"] = "tag"
2972
aide["QuackFilledTag"] = "tag"
3073
aide["QuackGrayscaleFlatTag"] = "tag"

bom/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023.05.17
1+
2023.05.18

casa-ui/report/compose-metrics/casa-ui_debug-module.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"totalGroups": 47,
88
"staticArguments": 61,
99
"certainArguments": 42,
10-
"knownStableArguments": 483,
10+
"knownStableArguments": 509,
1111
"knownUnstableArguments": 6,
1212
"unknownStableArguments": 0,
13-
"totalArguments": 489,
13+
"totalArguments": 515,
1414
"markedStableClasses": 0,
1515
"inferredStableClasses": 0,
1616
"inferredUnstableClasses": 0,

catalog/src/main/AndroidManifest.xml

+16-14
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@
77

88
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
99

10-
<application
11-
android:name=".App"
12-
android:icon="@mipmap/ic_launcher"
13-
android:label="@string/app_name">
10+
<uses-permission android:name="android.permission.INTERNET" />
1411

15-
<activity
16-
android:name=".MainActivity"
17-
android:exported="true"
18-
android:theme="@android:style/Theme.Material.Light.NoActionBar">
12+
<application
13+
android:name=".App"
14+
android:icon="@mipmap/ic_launcher"
15+
android:label="@string/app_name">
1916

20-
<intent-filter>
21-
<action android:name="android.intent.action.MAIN" />
22-
<category android:name="android.intent.category.LAUNCHER" />
23-
</intent-filter>
24-
</activity>
17+
<activity
18+
android:name=".MainActivity"
19+
android:exported="true"
20+
android:theme="@android:style/Theme.Material.Light.NoActionBar">
2521

26-
</application>
22+
<intent-filter>
23+
<action android:name="android.intent.action.MAIN" />
24+
<category android:name="android.intent.category.LAUNCHER" />
25+
</intent-filter>
26+
</activity>
27+
28+
</application>
2729

2830
</manifest>

material/src/main/kotlin/team/duckie/quackquack/material/color.kt

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.runtime.Immutable
1111
import androidx.compose.runtime.Stable
1212
import androidx.compose.ui.graphics.Brush
1313
import androidx.compose.ui.graphics.Color
14+
import androidx.compose.ui.graphics.ColorFilter
1415
import androidx.compose.ui.graphics.SolidColor
1516
import kotlin.properties.ReadOnlyProperty
1617
import kotlin.reflect.KProperty
@@ -29,6 +30,14 @@ public value class QuackColor(public val value: Color) : ReadOnlyProperty<Any, C
2930
@Stable
3031
public fun toBrush(): SolidColor = SolidColor(value)
3132

33+
/**
34+
* [QuackColor]를 [ColorFilter]로 변환합니다. 만약 주어진 [QuackColor]가
35+
* [QuackColor.Unspecified]라면 null을 반환합니다.
36+
*/
37+
@Stable
38+
public fun toColorFilterOrNull(): ColorFilter? =
39+
if (this == Unspecified) null else ColorFilter.tint(value)
40+
3241
/**
3342
* 정해진 [QuackColor]에서 일부 값만 변경이 필요할 때가 있습니다. 이를 대응하기 위해
3443
* 현재 [QuackColor]에서 변경을 허용하는 필드만 변경하여 새로운 [QuackColor]를 반환하는

material/version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0-alpha02
1+
2.0.0-alpha03

ui/build.gradle.kts

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ dependencies {
7171
implementations(
7272
libs.compose.coil,
7373
libs.androidx.annotation,
74-
projects.util.orArtifact(),
7574
projects.runtime.orArtifact(),
75+
projects.material.orArtifact(),
76+
projects.util.orArtifact(),
7677
projects.casaAnnotation.orArtifact(),
7778
projects.aideAnnotation.orArtifact(),
7879
)
+15-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"skippableComposables": 3,
3-
"restartableComposables": 4,
2+
"skippableComposables": 4,
3+
"restartableComposables": 7,
44
"readonlyComposables": 1,
5-
"totalComposables": 22,
6-
"restartGroups": 4,
7-
"totalGroups": 26,
8-
"staticArguments": 17,
9-
"certainArguments": 88,
10-
"knownStableArguments": 161,
11-
"knownUnstableArguments": 12,
5+
"totalComposables": 78,
6+
"restartGroups": 7,
7+
"totalGroups": 83,
8+
"staticArguments": 29,
9+
"certainArguments": 307,
10+
"knownStableArguments": 473,
11+
"knownUnstableArguments": 16,
1212
"unknownStableArguments": 0,
13-
"totalArguments": 173,
14-
"markedStableClasses": 4,
13+
"totalArguments": 489,
14+
"markedStableClasses": 14,
1515
"inferredStableClasses": 0,
1616
"inferredUnstableClasses": 0,
1717
"inferredUncertainClasses": 0,
18-
"effectivelyStableClasses": 4,
19-
"totalClasses": 4,
20-
"memoizedLambdas": 3,
18+
"effectivelyStableClasses": 14,
19+
"totalClasses": 14,
20+
"memoizedLambdas": 5,
2121
"singletonLambdas": 0,
2222
"singletonComposableLambdas": 0,
2323
"composableLambdas": 2,
24-
"totalLambdas": 6
24+
"totalLambdas": 9
2525
}
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
2-
"skippableComposables": 1,
3-
"restartableComposables": 1,
2+
"skippableComposables": 3,
3+
"restartableComposables": 3,
44
"readonlyComposables": 0,
5-
"totalComposables": 1,
6-
"restartGroups": 1,
7-
"totalGroups": 1,
8-
"staticArguments": 2,
5+
"totalComposables": 3,
6+
"restartGroups": 3,
7+
"totalGroups": 3,
8+
"staticArguments": 1,
99
"certainArguments": 0,
10-
"knownStableArguments": 6,
10+
"knownStableArguments": 14,
1111
"knownUnstableArguments": 0,
1212
"unknownStableArguments": 0,
13-
"totalArguments": 6,
13+
"totalArguments": 14,
1414
"markedStableClasses": 0,
1515
"inferredStableClasses": 1,
1616
"inferredUnstableClasses": 0,
1717
"inferredUncertainClasses": 0,
1818
"effectivelyStableClasses": 1,
1919
"totalClasses": 1,
20-
"memoizedLambdas": 1,
20+
"memoizedLambdas": 3,
2121
"singletonLambdas": 0,
22-
"singletonComposableLambdas": 1,
23-
"composableLambdas": 1,
24-
"totalLambdas": 1
22+
"singletonComposableLambdas": 3,
23+
"composableLambdas": 3,
24+
"totalLambdas": 3
2525
}

ui/report/compose-reports/ui_debug-classes.txt

+108-16
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,122 @@ stable class QuackButtonColors {
88
stable val iconColor: QuackColor
99
stable val rippleColor: QuackColor
1010
}
11-
stable class QuackLargeButtonDefaults {
11+
stable class QuackPrimaryLargeButtonDefaults {
1212
stable var colors: QuackButtonColors
13-
stable val radius: Dp
14-
stable val contentPadding: QuackPadding
15-
stable val iconSpacedBy: Dp
16-
stable val borderThickness: Dp
17-
stable val typography: QuackTypography
18-
stable val disabledTypography: QuackTypography
13+
stable var radius: Dp
14+
stable var contentPadding: QuackPadding
15+
stable var iconSpacedBy: Dp
16+
stable var borderThickness: Dp
17+
stable var typography: QuackTypography
18+
stable var disabledTypography: QuackTypography
19+
}
20+
stable class QuackSecondaryLargeButtonDefaults {
21+
stable var colors: QuackButtonColors
22+
stable var radius: Dp
23+
stable var contentPadding: QuackPadding
24+
stable var iconSpacedBy: Dp
25+
stable var borderThickness: Dp
26+
stable var typography: QuackTypography
27+
stable var disabledTypography: QuackTypography
1928
}
2029
stable class QuackMediumButtonDefaults {
2130
stable var colors: QuackButtonColors
22-
stable val radius: Dp
23-
stable val contentPadding: QuackPadding
24-
stable val iconSpacedBy: Dp
25-
stable val borderThickness: Dp
26-
stable val typography: QuackTypography
27-
stable val disabledTypography: QuackTypography
31+
stable var radius: Dp
32+
stable var contentPadding: QuackPadding
33+
stable var iconSpacedBy: Dp
34+
stable var borderThickness: Dp
35+
stable var typography: QuackTypography
36+
stable var disabledTypography: QuackTypography
37+
}
38+
stable class QuackPrimaryFilledSmallButtonDefaults {
39+
stable var colors: QuackButtonColors
40+
stable var radius: Dp
41+
stable var contentPadding: QuackPadding
42+
stable var iconSpacedBy: Dp
43+
stable var borderThickness: Dp
44+
stable var typography: QuackTypography
45+
stable var disabledTypography: QuackTypography
46+
}
47+
stable class QuackPrimaryOutlinedSmallButtonDefaults {
48+
stable var colors: QuackButtonColors
49+
stable var radius: Dp
50+
stable var contentPadding: QuackPadding
51+
stable var iconSpacedBy: Dp
52+
stable var borderThickness: Dp
53+
stable var typography: QuackTypography
54+
stable var disabledTypography: QuackTypography
55+
}
56+
stable class QuackPrimaryOutlinedRoundSmallButtonDefaults {
57+
stable var colors: QuackButtonColors
58+
stable var radius: Dp
59+
stable var contentPadding: QuackPadding
60+
stable var iconSpacedBy: Dp
61+
stable var borderThickness: Dp
62+
stable var typography: QuackTypography
63+
stable var disabledTypography: QuackTypography
64+
}
65+
stable class QuackSecondarySmallButtonDefaults {
66+
stable var colors: QuackButtonColors
67+
stable var radius: Dp
68+
stable var contentPadding: QuackPadding
69+
stable var iconSpacedBy: Dp
70+
stable var borderThickness: Dp
71+
stable var typography: QuackTypography
72+
stable var disabledTypography: QuackTypography
2873
}
29-
stable class QuackSmallButtonDefaults {
74+
stable class QuackSecondaryRoundSmallButtonDefaults {
3075
stable var colors: QuackButtonColors
3176
stable var radius: Dp
3277
stable var contentPadding: QuackPadding
33-
stable val iconSpacedBy: Dp
34-
stable val borderThickness: Dp
78+
stable var iconSpacedBy: Dp
79+
stable var borderThickness: Dp
3580
stable var typography: QuackTypography
3681
stable var disabledTypography: QuackTypography
3782
}
83+
stable class QuackTagColors {
84+
stable val backgroundColor: QuackColor
85+
stable val unselectedBackgroundColor: QuackColor
86+
stable val contentColor: QuackColor
87+
stable val unselectedContentColor: QuackColor
88+
stable val borderColor: QuackColor
89+
stable val unselectedBorderColor: QuackColor
90+
stable val iconColor: QuackColor
91+
stable val unselectedIconColor: QuackColor
92+
stable val rippleColor: QuackColor
93+
}
94+
stable class QuackOutlinedTagDefaults {
95+
stable var colors: QuackTagColors
96+
stable var radius: Dp
97+
stable var contentPadding: QuackPadding
98+
stable var iconSpacedBy: Dp
99+
stable var borderThickness: Dp
100+
stable var typography: QuackTypography
101+
stable var unselectedTypography: QuackTypography
102+
}
103+
stable class QuackFilledTagDefaults {
104+
stable var colors: QuackTagColors
105+
stable var radius: Dp
106+
stable var contentPadding: QuackPadding
107+
stable var iconSpacedBy: Dp
108+
stable var borderThickness: Dp
109+
stable var typography: QuackTypography
110+
stable var unselectedTypography: QuackTypography
111+
}
112+
stable class QuackGrayscaleFlatTagDefaults {
113+
stable var colors: QuackTagColors
114+
stable var radius: Dp
115+
stable var contentPadding: QuackPadding
116+
stable var iconSpacedBy: Dp
117+
stable var borderThickness: Dp
118+
stable var typography: QuackTypography
119+
stable var unselectedTypography: QuackTypography
120+
}
121+
stable class QuackGrayscaleOutlinedTagDefaults {
122+
stable var colors: QuackTagColors
123+
stable var radius: Dp
124+
stable var contentPadding: QuackPadding
125+
stable var iconSpacedBy: Dp
126+
stable var borderThickness: Dp
127+
stable var typography: QuackTypography
128+
stable var unselectedTypography: QuackTypography
129+
}

0 commit comments

Comments
 (0)