|
| 1 | +@file:OptIn(ExperimentalLayoutApi::class) |
| 2 | + |
1 | 3 | package com.inkapplications.ack.android.capture |
2 | 4 |
|
3 | 5 | import android.content.Context |
@@ -243,87 +245,93 @@ private fun CaptureSettingsSheet( |
243 | 245 | ) |
244 | 246 | } |
245 | 247 | } |
246 | | - Row { |
247 | | - controlPanelState.audioCaptureState.whenOff { |
248 | | - StateLabelledIconButton( |
249 | | - state = controlPanelState.audioCaptureState, |
250 | | - title = stringResource(R.string.capture_controls_audio_capture_disabled_name), |
251 | | - icon = Icons.Outlined.MicOff, |
252 | | - onClick = captureController::onAudioCaptureEnableClick, |
253 | | - ) |
254 | | - } |
255 | | - controlPanelState.audioCaptureState.whenOn { |
256 | | - StateLabelledIconButton( |
257 | | - state = controlPanelState.audioCaptureState, |
258 | | - title = stringResource(R.string.capture_controls_audio_capture_enabled_name, (controlPanelState as ControlPanelState.Loaded).audioCaptureLevel), |
259 | | - icon = Icons.Filled.Mic, |
260 | | - onClick = captureController::onAudioCaptureDisableClick, |
261 | | - ) |
262 | | - } |
| 248 | + FlowRow( |
| 249 | + horizontalArrangement = Arrangement.Center, |
| 250 | + ) { |
| 251 | + Row { |
| 252 | + controlPanelState.audioCaptureState.whenOff { |
| 253 | + StateLabelledIconButton( |
| 254 | + state = controlPanelState.audioCaptureState, |
| 255 | + title = stringResource(R.string.capture_controls_audio_capture_disabled_name), |
| 256 | + icon = Icons.Outlined.MicOff, |
| 257 | + onClick = captureController::onAudioCaptureEnableClick, |
| 258 | + ) |
| 259 | + } |
| 260 | + controlPanelState.audioCaptureState.whenOn { |
| 261 | + StateLabelledIconButton( |
| 262 | + state = controlPanelState.audioCaptureState, |
| 263 | + title = stringResource(R.string.capture_controls_audio_capture_enabled_name, (controlPanelState as ControlPanelState.Loaded).audioCaptureLevel), |
| 264 | + icon = Icons.Filled.Mic, |
| 265 | + onClick = captureController::onAudioCaptureDisableClick, |
| 266 | + ) |
| 267 | + } |
263 | 268 |
|
264 | | - controlPanelState.audioTransmitState.whenDisabled { |
265 | | - StateLabelledIconButton( |
266 | | - state = controlPanelState.audioTransmitState, |
267 | | - icon = Icons.Outlined.VolumeOff, |
268 | | - title = stringResource(R.string.capture_controls_audio_transmit_disabled_name), |
269 | | - ) |
270 | | - } |
271 | | - controlPanelState.audioTransmitState.whenOff { |
272 | | - StateLabelledIconButton( |
273 | | - state = controlPanelState.audioTransmitState, |
274 | | - icon = Icons.Outlined.VolumeOff, |
275 | | - title = stringResource(R.string.capture_controls_audio_transmit_disabled_name), |
276 | | - onClick = captureController::onAudioTransmitEnableClick, |
277 | | - ) |
278 | | - } |
279 | | - controlPanelState.audioTransmitState.whenOn { |
280 | | - StateLabelledIconButton( |
281 | | - state = controlPanelState.audioTransmitState, |
282 | | - icon = Icons.Filled.VolumeUp, |
283 | | - title = stringResource(R.string.capture_controls_audio_transmit_enabled_name), |
284 | | - onClick = captureController::onAudioTransmitDisableClick, |
285 | | - ) |
| 269 | + controlPanelState.audioTransmitState.whenDisabled { |
| 270 | + StateLabelledIconButton( |
| 271 | + state = controlPanelState.audioTransmitState, |
| 272 | + icon = Icons.Outlined.VolumeOff, |
| 273 | + title = stringResource(R.string.capture_controls_audio_transmit_disabled_name), |
| 274 | + ) |
| 275 | + } |
| 276 | + controlPanelState.audioTransmitState.whenOff { |
| 277 | + StateLabelledIconButton( |
| 278 | + state = controlPanelState.audioTransmitState, |
| 279 | + icon = Icons.Outlined.VolumeOff, |
| 280 | + title = stringResource(R.string.capture_controls_audio_transmit_disabled_name), |
| 281 | + onClick = captureController::onAudioTransmitEnableClick, |
| 282 | + ) |
| 283 | + } |
| 284 | + controlPanelState.audioTransmitState.whenOn { |
| 285 | + StateLabelledIconButton( |
| 286 | + state = controlPanelState.audioTransmitState, |
| 287 | + icon = Icons.Filled.VolumeUp, |
| 288 | + title = stringResource(R.string.capture_controls_audio_transmit_enabled_name), |
| 289 | + onClick = captureController::onAudioTransmitDisableClick, |
| 290 | + ) |
| 291 | + } |
286 | 292 | } |
287 | 293 |
|
288 | | - controlPanelState.internetCaptureState.whenOff { |
289 | | - StateLabelledIconButton( |
290 | | - state = controlPanelState.internetCaptureState, |
291 | | - icon = Icons.Outlined.CloudDownload, |
292 | | - title = stringResource(R.string.capture_controls_internet_capture_disabled_name), |
293 | | - onClick = captureController::onInternetCaptureEnableClick, |
294 | | - ) |
295 | | - } |
296 | | - controlPanelState.internetCaptureState.whenOn { |
297 | | - StateLabelledIconButton( |
298 | | - state = controlPanelState.internetCaptureState, |
299 | | - icon = Icons.Filled.CloudDownload, |
300 | | - title = stringResource(R.string.capture_controls_internet_capture_enabled_name), |
301 | | - onClick = captureController::onInternetCaptureDisableClick, |
302 | | - ) |
303 | | - } |
| 294 | + Row { |
| 295 | + controlPanelState.internetCaptureState.whenOff { |
| 296 | + StateLabelledIconButton( |
| 297 | + state = controlPanelState.internetCaptureState, |
| 298 | + icon = Icons.Outlined.CloudDownload, |
| 299 | + title = stringResource(R.string.capture_controls_internet_capture_disabled_name), |
| 300 | + onClick = captureController::onInternetCaptureEnableClick, |
| 301 | + ) |
| 302 | + } |
| 303 | + controlPanelState.internetCaptureState.whenOn { |
| 304 | + StateLabelledIconButton( |
| 305 | + state = controlPanelState.internetCaptureState, |
| 306 | + icon = Icons.Filled.CloudDownload, |
| 307 | + title = stringResource(R.string.capture_controls_internet_capture_enabled_name), |
| 308 | + onClick = captureController::onInternetCaptureDisableClick, |
| 309 | + ) |
| 310 | + } |
304 | 311 |
|
305 | | - controlPanelState.internetTransmitState.whenDisabled { |
306 | | - StateLabelledIconButton( |
307 | | - state = controlPanelState.internetTransmitState, |
308 | | - icon = Icons.Outlined.CloudUpload, |
309 | | - title = stringResource(R.string.capture_controls_internet_transmit_disabled_name), |
310 | | - ) |
311 | | - } |
312 | | - controlPanelState.internetTransmitState.whenOff { |
313 | | - StateLabelledIconButton( |
314 | | - state = controlPanelState.internetTransmitState, |
315 | | - icon = Icons.Outlined.CloudUpload, |
316 | | - title = stringResource(R.string.capture_controls_internet_transmit_disabled_name), |
317 | | - onClick = captureController::onInternetTransmitEnableClick, |
318 | | - ) |
319 | | - } |
320 | | - controlPanelState.internetTransmitState.whenOn { |
321 | | - StateLabelledIconButton( |
322 | | - state = controlPanelState.internetTransmitState, |
323 | | - icon = Icons.Filled.CloudUpload, |
324 | | - title = stringResource(R.string.capture_controls_internet_transmit_enabled_name), |
325 | | - onClick = captureController::onInternetTransmitDisableClick, |
326 | | - ) |
| 312 | + controlPanelState.internetTransmitState.whenDisabled { |
| 313 | + StateLabelledIconButton( |
| 314 | + state = controlPanelState.internetTransmitState, |
| 315 | + icon = Icons.Outlined.CloudUpload, |
| 316 | + title = stringResource(R.string.capture_controls_internet_transmit_disabled_name), |
| 317 | + ) |
| 318 | + } |
| 319 | + controlPanelState.internetTransmitState.whenOff { |
| 320 | + StateLabelledIconButton( |
| 321 | + state = controlPanelState.internetTransmitState, |
| 322 | + icon = Icons.Outlined.CloudUpload, |
| 323 | + title = stringResource(R.string.capture_controls_internet_transmit_disabled_name), |
| 324 | + onClick = captureController::onInternetTransmitEnableClick, |
| 325 | + ) |
| 326 | + } |
| 327 | + controlPanelState.internetTransmitState.whenOn { |
| 328 | + StateLabelledIconButton( |
| 329 | + state = controlPanelState.internetTransmitState, |
| 330 | + icon = Icons.Filled.CloudUpload, |
| 331 | + title = stringResource(R.string.capture_controls_internet_transmit_enabled_name), |
| 332 | + onClick = captureController::onInternetTransmitDisableClick, |
| 333 | + ) |
| 334 | + } |
327 | 335 | } |
328 | 336 | } |
329 | 337 | } |
|
0 commit comments