Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Stop audio visualizer from appearing in screen record mode. #180

Merged
merged 1 commit into from
Aug 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,25 @@ import com.bnyro.recorder.ui.models.RecorderModel
@Composable
fun RecorderPreview(recordScreenMode: Boolean) {
val recorderModel: RecorderModel = viewModel()
Crossfade(
modifier = Modifier.fillMaxSize(),
targetState = recorderModel.recordedAmplitudes
) {
when (it.isEmpty()) {
true -> BlobIconBox(
icon = if (recordScreenMode) R.drawable.ic_screen_record else R.drawable.ic_mic
)
if (recordScreenMode) {
BlobIconBox(
icon = R.drawable.ic_screen_record
)
} else {
Crossfade(
modifier = Modifier.fillMaxSize(),
targetState = recorderModel.recordedAmplitudes
) {
when (it.isEmpty()) {
true -> BlobIconBox(
icon = R.drawable.ic_mic
)

false -> AudioVisualizer(
modifier = Modifier
.fillMaxSize()
)
false -> AudioVisualizer(
modifier = Modifier
.fillMaxSize()
)
}
}
}
}
Loading