File tree Expand file tree Collapse file tree 5 files changed +19
-0
lines changed
collect_app/src/main/java/org/odk/collect/android/widgets Expand file tree Collapse file tree 5 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,15 @@ import androidx.compose.ui.draw.clip
2020import androidx.compose.ui.graphics.vector.ImageVector
2121import androidx.compose.ui.res.dimensionResource
2222import androidx.compose.ui.unit.dp
23+ import androidx.compose.ui.unit.sp
2324import org.odk.collect.androidshared.R.dimen
2425import org.odk.collect.androidshared.ui.multiclicksafe.MultiClickGuard
2526
2627@Composable
2728fun WidgetIconButton (
2829 icon : ImageVector ,
2930 text : String ,
31+ fontSize : Int ,
3032 onClick : () -> Unit ,
3133 onLongClick : () -> Unit ,
3234 modifier : Modifier ,
@@ -72,6 +74,7 @@ fun WidgetIconButton(
7274 Text (
7375 text = text,
7476 color = contentColor,
77+ fontSize = fontSize.sp,
7578 style = MaterialTheme .typography.bodyLarge
7679 )
7780 }
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import org.odk.collect.android.widgets.QuestionWidget
2020import org.odk.collect.android.widgets.interfaces.FileWidget
2121import org.odk.collect.android.widgets.interfaces.WidgetDataReceiver
2222import org.odk.collect.android.widgets.utilities.FileRequester
23+ import org.odk.collect.android.widgets.utilities.QuestionFontSizeUtils
2324import org.odk.collect.android.widgets.utilities.WaitingForDataRegistry
2425import org.odk.collect.androidshared.ui.ComposeThemeProvider.Companion.setContextThemedContent
2526import org.odk.collect.androidshared.ui.ToastUtils.showLongToast
@@ -44,13 +45,15 @@ class ExVideoWidget(
4445
4546 override fun onCreateWidgetView (context : Context , prompt : FormEntryPrompt , answerFontSize : Int ): View {
4647 val readOnly = questionDetails.isReadOnly
48+ val buttonFontSize = QuestionFontSizeUtils .getFontSize(settings, QuestionFontSizeUtils .FontSize .BODY_LARGE )
4749
4850 return ComposeView (context).apply {
4951 setContextThemedContent {
5052 ExVideoWidgetContent (
5153 questionMediaManager.getAnswerFile(binaryName)?.toUri(),
5254 mediaUtils,
5355 readOnly,
56+ buttonFontSize,
5457 onLaunchClick = { launchExternalApp() },
5558 onLongClick = { this .showContextMenu() }
5659 )
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ fun ExVideoWidgetContent(
2323 videoUri : Uri ? ,
2424 mediaUtils : MediaUtils ? ,
2525 readOnly : Boolean ,
26+ fontSize : Int ,
2627 onLaunchClick : () -> Unit ,
2728 onLongClick : () -> Unit
2829) {
@@ -31,6 +32,7 @@ fun ExVideoWidgetContent(
3132 WidgetIconButton (
3233 Icons .AutoMirrored .Filled .OpenInNew ,
3334 stringResource(string.launch_app),
35+ fontSize,
3436 onLaunchClick,
3537 onLongClick,
3638 Modifier .testTag(" record_video_button" )
@@ -52,6 +54,7 @@ private fun ExVideoWidgetContentPreview() {
5254 null ,
5355 null ,
5456 false ,
57+ 10 ,
5558 {},
5659 {}
5760 )
@@ -66,6 +69,7 @@ private fun ExVideoWidgetContentReadOnlyPreview() {
6669 null ,
6770 null ,
6871 true ,
72+ 10 ,
6973 {},
7074 {}
7175 )
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import org.odk.collect.android.utilities.QuestionMediaManager
2323import org.odk.collect.android.widgets.QuestionWidget
2424import org.odk.collect.android.widgets.interfaces.FileWidget
2525import org.odk.collect.android.widgets.interfaces.WidgetDataReceiver
26+ import org.odk.collect.android.widgets.utilities.QuestionFontSizeUtils
2627import org.odk.collect.android.widgets.utilities.WaitingForDataRegistry
2728import org.odk.collect.androidshared.ui.ComposeThemeProvider.Companion.setContextThemedContent
2829import org.odk.collect.permissions.PermissionListener
@@ -48,6 +49,7 @@ class VideoWidget(
4849 override fun onCreateWidgetView (context : Context , prompt : FormEntryPrompt , answerFontSize : Int ): View {
4950 val readOnly = questionDetails.isReadOnly
5051 val newVideoOnly = formEntryPrompt.appearanceHint?.lowercase()?.contains(Appearances .NEW ) ? : false
52+ val buttonFontSize = QuestionFontSizeUtils .getFontSize(settings, QuestionFontSizeUtils .FontSize .BODY_LARGE )
5153
5254 return ComposeView (context).apply {
5355 setContextThemedContent {
@@ -56,6 +58,7 @@ class VideoWidget(
5658 mediaUtils,
5759 readOnly,
5860 newVideoOnly,
61+ buttonFontSize,
5962 onRecordClick = {
6063 getPermissionsProvider().requestCameraPermission(
6164 context as Activity ,
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ fun VideoWidgetContent(
2525 mediaUtils : MediaUtils ? ,
2626 readOnly : Boolean ,
2727 newVideoOnly : Boolean ,
28+ fontSize : Int ,
2829 onRecordClick : () -> Unit ,
2930 onChooseClick : () -> Unit ,
3031 onLongClick : () -> Unit
@@ -34,6 +35,7 @@ fun VideoWidgetContent(
3435 WidgetIconButton (
3536 Icons .Default .Videocam ,
3637 stringResource(string.capture_video),
38+ fontSize,
3739 onRecordClick,
3840 onLongClick,
3941 Modifier .testTag(" record_video_button" )
@@ -46,6 +48,7 @@ fun VideoWidgetContent(
4648 WidgetIconButton (
4749 Icons .Default .VideoLibrary ,
4850 stringResource(string.choose_video),
51+ fontSize,
4952 onChooseClick,
5053 onLongClick,
5154 Modifier .testTag(" choose_video_button" )
@@ -68,6 +71,7 @@ private fun VideoWidgetContentPreview() {
6871 null ,
6972 false ,
7073 false ,
74+ 10 ,
7175 {},
7276 {},
7377 {}
@@ -84,6 +88,7 @@ private fun VideoWidgetContentReadOnlyPreview() {
8488 null ,
8589 true ,
8690 false ,
91+ 10 ,
8792 {},
8893 {},
8994 {}
@@ -100,6 +105,7 @@ private fun VideoWidgetContentNewVideoOnlyPreview() {
100105 null ,
101106 false ,
102107 true ,
108+ 10 ,
103109 {},
104110 {},
105111 {}
You can’t perform that action at this time.
0 commit comments