Skip to content

Commit b968194

Browse files
committed
style: align LargeActionCard background with dynamic clash state
- Force null background on internal label root to ensure seamless inheritance of card color. - Remove default surface background initialization to prevent visual artifacts in stopped state. - Synchronize card radius and elevation with Material 3 design tokens. - Disable card checkable state to prevent unwanted overlay layers in Monet mode.
1 parent 6d6c77a commit b968194

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

design/src/main/java/com/github/kr328/clash/design/MainDesign.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class MainDesign(context: Context) : Design<MainDesign.Request>(context) {
8282
binding.self = this
8383

8484
binding.colorClashStarted = context.resolveThemedColor(com.google.android.material.R.attr.colorPrimary)
85-
binding.colorClashStopped = context.resolveThemedColor(R.attr.colorClashStopped)
85+
binding.colorClashStopped = context.resolveThemedColor(com.google.android.material.R.attr.colorOnPrimaryContainer)
8686
}
8787

8888
fun request(request: Request) {

design/src/main/java/com/github/kr328/clash/design/view/LargeActionCard.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ class LargeActionCard @JvmOverloads constructor(
3636
binding.iconView.background = value
3737
}
3838

39-
init {
40-
binding.root.background = null
41-
39+
init {
4240
context.resolveClickableAttrs(attributeSet, defStyleAttr) {
4341
isFocusable = focusable(true)
4442
isClickable = clickable(true)
@@ -64,6 +62,5 @@ class LargeActionCard @JvmOverloads constructor(
6462
cardElevation = context.resources.getDimension(R.dimen.large_action_card_elevation)
6563
strokeWidth = 0
6664
setContentPadding(0, 0, 0, 0)
67-
isCheckable = false
6865
}
6966
}

design/src/main/res/layout/component_large_action_label.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
android:layout_gravity="center_vertical"
77
android:gravity="center_vertical"
88
android:orientation="horizontal"
9-
android:paddingVertical="@dimen/large_item_padding_vertical" >
9+
android:paddingVertical="@dimen/large_item_padding_vertical"
10+
android:background="@{clashRunning ? colorClashStarted : colorClashStopped}" >
1011

1112
<View
1213
android:id="@+id/icon_view"

design/src/main/res/values-v31/themes.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<item name="android:textColorSecondary">?attr/colorOnSurfaceVariant</item>
66
<item name="android:textColor">?attr/colorOnSurface</item>
77
<item name="android:textColorHint">?attr/colorOutline</item>
8-
<item name="colorClashStopped">?attr/colorSurface</item>
8+
<item name="colorClashStopped">?attr/colorOnPrimaryContainer</item>
99

1010
<item name="textAppearanceHeadlineSmall">@style/TextAppearance.Material3.HeadlineSmall</item>
1111
<item name="textAppearanceBodyMedium">@style/TextAppearance.Material3.BodyMedium</item>
@@ -19,7 +19,7 @@
1919
<item name="android:textColorSecondary">?attr/colorOnSurfaceVariant</item>
2020
<item name="android:textColor">?attr/colorOnSurface</item>
2121
<item name="android:textColorHint">?attr/colorOutline</item>
22-
<item name="colorClashStopped">?attr/colorSurface</item>
22+
<item name="colorClashStopped">?attr/colorOnPrimaryContainer</item>
2323

2424
<item name="textAppearanceHeadlineSmall">@style/TextAppearance.Material3.HeadlineSmall</item>
2525
<item name="textAppearanceBodyMedium">@style/TextAppearance.Material3.BodyMedium</item>

0 commit comments

Comments
 (0)