Skip to content

Commit

Permalink
Introduce QuackIcon, QuackImage (#694)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jisungbin authored May 18, 2023
1 parent e7b9466 commit 80befd2
Show file tree
Hide file tree
Showing 23 changed files with 2,161 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,49 @@ internal val quackComponents: Map<String, String> = run {
aide["QuackSecondarySmallButton"] = "button"
aide["QuackSecondaryRoundSmallButton"] = "button"

aide["QuackIcon"] = "icon"
aide["QuackAreaIcon"] = "icon"
aide["QuackArrowBackIcon"] = "icon"
aide["QuackArrowDownIcon"] = "icon"
aide["QuackArrowRightIcon"] = "icon"
aide["QuackArrowSendIcon"] = "icon"
aide["QuackBadgeIcon"] = "icon"
aide["QuackBookmarkIcon"] = "icon"
aide["QuackBuyIcon"] = "icon"
aide["QuackCameraIcon"] = "icon"
aide["QuackCheckIcon"] = "icon"
aide["QuackCloseIcon"] = "icon"
aide["QuackCommentIcon"] = "icon"
aide["QuackDeleteIcon"] = "icon"
aide["QuackDeleteBgIcon"] = "icon"
aide["QuackDmIcon"] = "icon"
aide["QuackFeedIcon"] = "icon"
aide["QuackFilledBookmarkIcon"] = "icon"
aide["QuackFilledHeartIcon"] = "icon"
aide["QuackFilledProfileIcon"] = "icon"
aide["QuackFilterIcon"] = "icon"
aide["QuackGalleryIcon"] = "icon"
aide["QuackHeartIcon"] = "icon"
aide["QuackImageIcon"] = "icon"
aide["QuackImageEditIcon"] = "icon"
aide["QuackImageEditBgIcon"] = "icon"
aide["QuackMarketPriceIcon"] = "icon"
aide["QuackMoreIcon"] = "icon"
aide["QuackNoticeAddIcon"] = "icon"
aide["QuackPlaceIcon"] = "icon"
aide["QuackPlusIcon"] = "icon"
aide["QuackProfileIcon"] = "icon"
aide["QuackSearchIcon"] = "icon"
aide["QuackSellIcon"] = "icon"
aide["QuackSettingIcon"] = "icon"
aide["QuackShareIcon"] = "icon"
aide["QuackTagIcon"] = "icon"
aide["QuackTextLogoIcon"] = "icon"
aide["QuackWhiteHeartIcon"] = "icon"
aide["QuackWonIcon"] = "icon"

aide["QuackImage"] = "image"

aide["QuackOutlinedTag"] = "tag"
aide["QuackFilledTag"] = "tag"
aide["QuackGrayscaleFlatTag"] = "tag"
Expand Down
2 changes: 1 addition & 1 deletion bom/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023.05.17
2023.05.18
4 changes: 2 additions & 2 deletions casa-ui/report/compose-metrics/casa-ui_debug-module.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"totalGroups": 47,
"staticArguments": 61,
"certainArguments": 42,
"knownStableArguments": 483,
"knownStableArguments": 509,
"knownUnstableArguments": 6,
"unknownStableArguments": 0,
"totalArguments": 489,
"totalArguments": 515,
"markedStableClasses": 0,
"inferredStableClasses": 0,
"inferredUnstableClasses": 0,
Expand Down
30 changes: 16 additions & 14 deletions catalog/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@

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

<application
android:name=".App"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
<uses-permission android:name="android.permission.INTERNET" />

<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@android:style/Theme.Material.Light.NoActionBar">
<application
android:name=".App"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@android:style/Theme.Material.Light.NoActionBar">

</application>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.SolidColor
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
Expand All @@ -29,6 +30,14 @@ public value class QuackColor(public val value: Color) : ReadOnlyProperty<Any, C
@Stable
public fun toBrush(): SolidColor = SolidColor(value)

/**
* [QuackColor]를 [ColorFilter]로 변환합니다. 만약 주어진 [QuackColor]가
* [QuackColor.Unspecified]라면 null을 반환합니다.
*/
@Stable
public fun toColorFilterOrNull(): ColorFilter? =
if (this == Unspecified) null else ColorFilter.tint(value)

/**
* 정해진 [QuackColor]에서 일부 값만 변경이 필요할 때가 있습니다. 이를 대응하기 위해
* 현재 [QuackColor]에서 변경을 허용하는 필드만 변경하여 새로운 [QuackColor]를 반환하는
Expand Down
2 changes: 1 addition & 1 deletion material/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0-alpha02
2.0.0-alpha03
3 changes: 2 additions & 1 deletion ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ dependencies {
implementations(
libs.compose.coil,
libs.androidx.annotation,
projects.util.orArtifact(),
projects.runtime.orArtifact(),
projects.material.orArtifact(),
projects.util.orArtifact(),
projects.casaAnnotation.orArtifact(),
projects.aideAnnotation.orArtifact(),
)
Expand Down
30 changes: 15 additions & 15 deletions ui/report/compose-metrics/ui_debug-module.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"skippableComposables": 3,
"restartableComposables": 4,
"skippableComposables": 4,
"restartableComposables": 7,
"readonlyComposables": 1,
"totalComposables": 22,
"restartGroups": 4,
"totalGroups": 26,
"staticArguments": 17,
"certainArguments": 88,
"knownStableArguments": 161,
"knownUnstableArguments": 12,
"totalComposables": 78,
"restartGroups": 7,
"totalGroups": 83,
"staticArguments": 29,
"certainArguments": 307,
"knownStableArguments": 473,
"knownUnstableArguments": 16,
"unknownStableArguments": 0,
"totalArguments": 173,
"markedStableClasses": 4,
"totalArguments": 489,
"markedStableClasses": 14,
"inferredStableClasses": 0,
"inferredUnstableClasses": 0,
"inferredUncertainClasses": 0,
"effectivelyStableClasses": 4,
"totalClasses": 4,
"memoizedLambdas": 3,
"effectivelyStableClasses": 14,
"totalClasses": 14,
"memoizedLambdas": 5,
"singletonLambdas": 0,
"singletonComposableLambdas": 0,
"composableLambdas": 2,
"totalLambdas": 6
"totalLambdas": 9
}
24 changes: 12 additions & 12 deletions ui/report/compose-metrics/ui_debugUnitTest-module.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"skippableComposables": 1,
"restartableComposables": 1,
"skippableComposables": 3,
"restartableComposables": 3,
"readonlyComposables": 0,
"totalComposables": 1,
"restartGroups": 1,
"totalGroups": 1,
"staticArguments": 2,
"totalComposables": 3,
"restartGroups": 3,
"totalGroups": 3,
"staticArguments": 1,
"certainArguments": 0,
"knownStableArguments": 6,
"knownStableArguments": 14,
"knownUnstableArguments": 0,
"unknownStableArguments": 0,
"totalArguments": 6,
"totalArguments": 14,
"markedStableClasses": 0,
"inferredStableClasses": 1,
"inferredUnstableClasses": 0,
"inferredUncertainClasses": 0,
"effectivelyStableClasses": 1,
"totalClasses": 1,
"memoizedLambdas": 1,
"memoizedLambdas": 3,
"singletonLambdas": 0,
"singletonComposableLambdas": 1,
"composableLambdas": 1,
"totalLambdas": 1
"singletonComposableLambdas": 3,
"composableLambdas": 3,
"totalLambdas": 3
}
124 changes: 108 additions & 16 deletions ui/report/compose-reports/ui_debug-classes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,122 @@ stable class QuackButtonColors {
stable val iconColor: QuackColor
stable val rippleColor: QuackColor
}
stable class QuackLargeButtonDefaults {
stable class QuackPrimaryLargeButtonDefaults {
stable var colors: QuackButtonColors
stable val radius: Dp
stable val contentPadding: QuackPadding
stable val iconSpacedBy: Dp
stable val borderThickness: Dp
stable val typography: QuackTypography
stable val disabledTypography: QuackTypography
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var disabledTypography: QuackTypography
}
stable class QuackSecondaryLargeButtonDefaults {
stable var colors: QuackButtonColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var disabledTypography: QuackTypography
}
stable class QuackMediumButtonDefaults {
stable var colors: QuackButtonColors
stable val radius: Dp
stable val contentPadding: QuackPadding
stable val iconSpacedBy: Dp
stable val borderThickness: Dp
stable val typography: QuackTypography
stable val disabledTypography: QuackTypography
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var disabledTypography: QuackTypography
}
stable class QuackPrimaryFilledSmallButtonDefaults {
stable var colors: QuackButtonColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var disabledTypography: QuackTypography
}
stable class QuackPrimaryOutlinedSmallButtonDefaults {
stable var colors: QuackButtonColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var disabledTypography: QuackTypography
}
stable class QuackPrimaryOutlinedRoundSmallButtonDefaults {
stable var colors: QuackButtonColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var disabledTypography: QuackTypography
}
stable class QuackSecondarySmallButtonDefaults {
stable var colors: QuackButtonColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var disabledTypography: QuackTypography
}
stable class QuackSmallButtonDefaults {
stable class QuackSecondaryRoundSmallButtonDefaults {
stable var colors: QuackButtonColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable val iconSpacedBy: Dp
stable val borderThickness: Dp
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var disabledTypography: QuackTypography
}
stable class QuackTagColors {
stable val backgroundColor: QuackColor
stable val unselectedBackgroundColor: QuackColor
stable val contentColor: QuackColor
stable val unselectedContentColor: QuackColor
stable val borderColor: QuackColor
stable val unselectedBorderColor: QuackColor
stable val iconColor: QuackColor
stable val unselectedIconColor: QuackColor
stable val rippleColor: QuackColor
}
stable class QuackOutlinedTagDefaults {
stable var colors: QuackTagColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var unselectedTypography: QuackTypography
}
stable class QuackFilledTagDefaults {
stable var colors: QuackTagColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var unselectedTypography: QuackTypography
}
stable class QuackGrayscaleFlatTagDefaults {
stable var colors: QuackTagColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var unselectedTypography: QuackTypography
}
stable class QuackGrayscaleOutlinedTagDefaults {
stable var colors: QuackTagColors
stable var radius: Dp
stable var contentPadding: QuackPadding
stable var iconSpacedBy: Dp
stable var borderThickness: Dp
stable var typography: QuackTypography
stable var unselectedTypography: QuackTypography
}
Loading

0 comments on commit 80befd2

Please sign in to comment.