Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

Commit 3406367

Browse files
Fix overflow on control panel for small devices
1 parent b7665cc commit 3406367

3 files changed

Lines changed: 91 additions & 83 deletions

File tree

android-application/src/main/java/com/inkapplications/ack/android/capture/CaptureScreen.kt

Lines changed: 85 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:OptIn(ExperimentalLayoutApi::class)
2+
13
package com.inkapplications.ack.android.capture
24

35
import android.content.Context
@@ -243,87 +245,93 @@ private fun CaptureSettingsSheet(
243245
)
244246
}
245247
}
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+
}
263268

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+
}
286292
}
287293

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+
}
304311

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+
}
327335
}
328336
}
329337
}

android-application/src/main/java/com/inkapplications/ack/android/ui/LabelledIconButton.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fun LabelledIconButton(
5252
text = title,
5353
style = AckTheme.typography.caption,
5454
textAlign = TextAlign.Center,
55-
modifier = Modifier.padding(top = AckTheme.spacing.item)
55+
modifier = Modifier.padding(top = AckTheme.spacing.item).width(70.dp)
5656
)
5757
}
5858
}

gradle/versions/android.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ version.ref = "room"
4343
module = "androidx.room:room-testing"
4444

4545
[libraries.androidx-compose-ui]
46-
version = "1.3.3"
46+
version = "1.4.3"
4747
module = "androidx.compose.ui:ui"
4848

4949
[libraries.androidx-compose-foundation]
50-
version = "1.3.1"
50+
version = "1.4.3"
5151
module = "androidx.compose.foundation:foundation"
5252

5353
[libraries.androidx-compose-material-core]
54-
version = "1.3.1"
54+
version = "1.4.3"
5555
module = "androidx.compose.material:material"
5656

5757
[libraries.androidx-activity-compose]
@@ -67,11 +67,11 @@ version = "2.5.3"
6767
module = "androidx.navigation:navigation-compose"
6868

6969
[libraries.androidx-compose-material-icons-core]
70-
version = "1.3.1"
70+
version = "1.4.3"
7171
module = "androidx.compose.material:material-icons-core"
7272

7373
[libraries.androidx-compose-material-icons-extended]
74-
version = "1.3.1"
74+
version = "1.4.3"
7575
module = "androidx.compose.material:material-icons-extended"
7676

7777
[bundles]

0 commit comments

Comments
 (0)