Skip to content

Commit 03e788f

Browse files
committed
fix: avoid floating lyrics expansion setter clash
Rename the expansion command to updateExpanded so it does not collide with the JVM setExpanded accessor generated for the delegated expanded state. Update every touch, outside-tap, idle-collapse and accessibility call site without changing behavior. Fixes the shared platform declaration error from remote CI; no local builds or tests were run.
1 parent f32b140 commit 03e788f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎app/src/main/java/app/gyrolet/mpvrx/ui/player/floating/FloatingLyricsWindow.kt‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ internal class FloatingLyricsWindow(
210210
private val detector = GestureDetector(windowContext, object : GestureDetector.SimpleOnGestureListener() {
211211
override fun onDown(event: MotionEvent): Boolean = true
212212
override fun onSingleTapUp(event: MotionEvent): Boolean {
213-
if (!dragging) setExpanded(!expanded)
213+
if (!dragging) updateExpanded(!expanded)
214214
return true
215215
}
216216
override fun onLongPress(event: MotionEvent) {
@@ -220,7 +220,7 @@ internal class FloatingLyricsWindow(
220220
if (first == null) return false
221221
if (!dragging) {
222222
dragging = true
223-
setExpanded(false)
223+
updateExpanded(false)
224224
view?.performAppHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
225225
showDropTarget()
226226
}
@@ -256,7 +256,7 @@ internal class FloatingLyricsWindow(
256256
}
257257
setOnTouchListener { _, event ->
258258
if (event.actionMasked == MotionEvent.ACTION_OUTSIDE) {
259-
setExpanded(false)
259+
updateExpanded(false)
260260
true
261261
} else false
262262
}
@@ -417,7 +417,7 @@ internal class FloatingLyricsWindow(
417417
}
418418
}
419419

420-
private fun setExpanded(value: Boolean) {
420+
private fun updateExpanded(value: Boolean) {
421421
touchTick++
422422
if (value) {
423423
growUp = anchor.y + metrics.expandedHeight.pixels() - coverInsetY + shadow * 2 > safeBounds.bottom
@@ -575,7 +575,7 @@ internal class FloatingLyricsWindow(
575575
LaunchedEffect(expanded, touchTick, scrubbing != null) {
576576
if (expanded && scrubbing == null) {
577577
delay(6_000)
578-
setExpanded(false)
578+
updateExpanded(false)
579579
}
580580
}
581581
val displayMode by preferences.lyricsTranslationDisplayMode.collectAsState()
@@ -624,7 +624,7 @@ internal class FloatingLyricsWindow(
624624
Modifier.fillMaxWidth().height(metrics.collapsedHeight)
625625
.semantics(mergeDescendants = true) {
626626
role = Role.Button
627-
onClick(expandLabel) { setExpanded(!expanded); true }
627+
onClick(expandLabel) { updateExpanded(!expanded); true }
628628
onLongClick(openLabel) { onOpenPlayer(); true }
629629
customActions = listOf(
630630
CustomAccessibilityAction(leftLabel) { dock(false); true },

0 commit comments

Comments
 (0)