diff --git a/wear/src/main/java/com/birdsounds/identify/presentation/ControlDashboard.kt b/wear/src/main/java/com/birdsounds/identify/presentation/ControlDashboard.kt index 18f7a9d..89adecc 100644 --- a/wear/src/main/java/com/birdsounds/identify/presentation/ControlDashboard.kt +++ b/wear/src/main/java/com/birdsounds/identify/presentation/ControlDashboard.kt @@ -31,7 +31,6 @@ import com.google.android.horologist.annotations.ExperimentalHorologistApi fun ControlDashboard( controlDashboardUiState: ControlDashboardUiState, onMicClicked: () -> Unit, - onPlayClicked: () -> Unit, recordingProgress: Float, modifier: Modifier = Modifier ) { @@ -39,13 +38,7 @@ fun ControlDashboard( contentAlignment = Alignment.Center, modifier = modifier.fillMaxSize() ) { - // Show the progress indicator only when recording - if (controlDashboardUiState.micState.expanded) { - CircularProgressIndicator( - progress = recordingProgress, - modifier = modifier.fillMaxSize() - ) - } + Row( horizontalArrangement = Arrangement.spacedBy(8.dp) @@ -61,12 +54,7 @@ fun ControlDashboard( } ) - ControlDashboardButton( - buttonState = controlDashboardUiState.playState, - onClick = onPlayClicked, - imageVector = Icons.Filled.PlayArrow, - contentDescription = stringResource(id = R.string.play_recording) - ) + } } } diff --git a/wear/src/main/java/com/birdsounds/identify/presentation/MainActivity.kt b/wear/src/main/java/com/birdsounds/identify/presentation/MainActivity.kt index 585422f..15de297 100644 --- a/wear/src/main/java/com/birdsounds/identify/presentation/MainActivity.kt +++ b/wear/src/main/java/com/birdsounds/identify/presentation/MainActivity.kt @@ -128,9 +128,6 @@ fun WearApp(greetingName: String) { scope.launch { mainState.onMicClicked() } - }, - onPlayClicked = { - navController.navigate("player") } ) @@ -157,17 +154,8 @@ fun WearApp(greetingName: String) { } } } - composable("player") { - SpeakerPlayerScreen( - volumeViewModel = volumeViewModel, - onVolumeClick = { navController.navigate("volume") } - ) - } - composable("volume") { - ScreenScaffold(timeText = {}) { - VolumeScreen(volumeViewModel = volumeViewModel) - } - } + + } } diff --git a/wear/src/main/java/com/birdsounds/identify/presentation/MainState.kt b/wear/src/main/java/com/birdsounds/identify/presentation/MainState.kt index 1138b20..da8c62d 100644 --- a/wear/src/main/java/com/birdsounds/identify/presentation/MainState.kt +++ b/wear/src/main/java/com/birdsounds/identify/presentation/MainState.kt @@ -154,34 +154,6 @@ sealed class PlaybackState { object Recording : PlaybackState() } -/** - * Determines if the device has a way to output audio and if it is supported. - * - * This could be an on-device speaker, or a connected bluetooth device. - */ -private fun speakerIsSupported(activity: Activity): Boolean { - val hasAudioOutputFeature = - activity.packageManager.hasSystemFeature(PackageManager.FEATURE_AUDIO_OUTPUT) - val devices = activity.getSystemService()!! - .getDevices(AudioManager.GET_DEVICES_OUTPUTS) - - // We can only trust AudioDeviceInfo.TYPE_BUILTIN_SPEAKER if the device advertises - // FEATURE_AUDIO_OUTPUT - val hasBuiltInSpeaker = devices.any { it.type == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER } && - hasAudioOutputFeature - - // Check all the Wear supported BT devices - // https://developer.android.com/training/wearables/apps/audio - val hasBluetoothSpeaker = devices.any { - it.type == AudioDeviceInfo.TYPE_BLUETOOTH_A2DP || - it.type == AudioDeviceInfo.TYPE_BLE_BROADCAST || - it.type == AudioDeviceInfo.TYPE_BLE_SPEAKER || - it.type == AudioDeviceInfo.TYPE_BLE_HEADSET - } - - return hasBuiltInSpeaker || hasBluetoothSpeaker -} - /** * A helper function to record, updating the progress state while recording. * diff --git a/wear/src/main/java/com/birdsounds/identify/presentation/SpeakerRecordingScreen.kt b/wear/src/main/java/com/birdsounds/identify/presentation/SpeakerRecordingScreen.kt index 550c0fd..702fd4e 100644 --- a/wear/src/main/java/com/birdsounds/identify/presentation/SpeakerRecordingScreen.kt +++ b/wear/src/main/java/com/birdsounds/identify/presentation/SpeakerRecordingScreen.kt @@ -18,8 +18,7 @@ fun SpeakerRecordingScreen( playbackState: PlaybackState, isPermissionDenied: Boolean, recordingProgress: Float, - onMicClicked: () -> Unit, - onPlayClicked: () -> Unit + onMicClicked: () -> Unit ) { ScreenScaffold { // Determine the control dashboard state. @@ -31,7 +30,6 @@ fun SpeakerRecordingScreen( ControlDashboard( controlDashboardUiState = controlDashboardUiState, onMicClicked = onMicClicked, - onPlayClicked = onPlayClicked, recordingProgress = recordingProgress ) } @@ -98,7 +96,6 @@ fun SpeakerScreenPreview( playbackState = playbackState, isPermissionDenied = true, recordingProgress = 0.25f, - onMicClicked = {}, - onPlayClicked = {} + onMicClicked = {} ) }