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

Commit

Permalink
Merge pull request #180 from SuhasDissa/visualizer-bug
Browse files Browse the repository at this point in the history
Stop audio visualizer from appearing in screen record mode.
  • Loading branch information
SuhasDissa authored Aug 12, 2023
2 parents a496c2f + 4d77eec commit 817cbb7
Showing 1 changed file with 18 additions and 12 deletions.
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()
)
}
}
}
}

0 comments on commit 817cbb7

Please sign in to comment.