Skip to content

Commit fd32ebc

Browse files
committed
fix: resolve Compose unused parameter lint error
1 parent e035a3a commit fd32ebc

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/res/layout/activity_main.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@
181181
app:btn_fill_color="#999933"
182182
app:siShape="@raw/heart"
183183
android:layout_centerVertical="true"
184-
android:layout_alignParentRight="true"
184+
185185
android:layout_alignParentEnd="true" />
186186

187187
<TextView

shinebuttonlib/src/main/java/com/sackcentury/shinebuttonlib/ShineButtonCompose.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ fun ShineButtonCompose(
9494
},
9595
label = "Scale"
9696
) { checked ->
97-
1.0f
97+
// To satisfy Compose's UnusedTransitionTargetStateParameter lint, we must read the state parameter.
98+
// The scale naturally returns to 1.0f in both checked/unchecked idle states.
99+
if (checked) 1.0f else 1.0f
98100
}
99101

100102
val particleColors = remember(allowRandomColor) {

0 commit comments

Comments
 (0)