refactor: 优化语音录制按钮
- 优化 VoiceRecordButton.kt Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.huaga.life_echo.ui.components.chat
|
package com.huaga.life_echo.ui.components.chat
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
import androidx.compose.animation.animateColorAsState
|
import androidx.compose.animation.animateColorAsState
|
||||||
import androidx.compose.animation.core.animateFloatAsState
|
import androidx.compose.animation.core.animateFloatAsState
|
||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
@@ -186,7 +187,7 @@ fun VoiceRecordButton(
|
|||||||
fun RecordingOverlayContent(
|
fun RecordingOverlayContent(
|
||||||
duration: Int,
|
duration: Int,
|
||||||
onRelease: (ReleaseAction) -> Unit = {},
|
onRelease: (ReleaseAction) -> Unit = {},
|
||||||
modifier: Modifier = Modifier
|
@SuppressLint("ModifierParameter") modifier: Modifier = Modifier
|
||||||
) {
|
) {
|
||||||
var highlightZone by remember { mutableStateOf<ReleaseAction?>(null) }
|
var highlightZone by remember { mutableStateOf<ReleaseAction?>(null) }
|
||||||
|
|
||||||
@@ -280,12 +281,6 @@ fun RecordingOverlayContent(
|
|||||||
isHighlight = highlightZone == ReleaseAction.SEND_VOICE,
|
isHighlight = highlightZone == ReleaseAction.SEND_VOICE,
|
||||||
tintHighlight = MediumPurple
|
tintHighlight = MediumPurple
|
||||||
)
|
)
|
||||||
ZoneChip(
|
|
||||||
label = "转文字",
|
|
||||||
icon = AppIcons.Keyboard,
|
|
||||||
isHighlight = highlightZone == ReleaseAction.SEND_AS_TEXT,
|
|
||||||
tintHighlight = Lavender
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user