@@ -6,12 +6,12 @@ package org.mozilla.focus.ui.dialog
66
77import android.content.res.Configuration
88import androidx.compose.foundation.layout.wrapContentHeight
9- import androidx.compose.material.AlertDialog
10- import androidx.compose.material.MaterialTheme
11- import androidx.compose.material.TextField
12- import androidx.compose.material.TextFieldDefaults
9+ import androidx.compose.material3.AlertDialog
10+ import androidx.compose.material3.MaterialTheme
1311import androidx.compose.material3.Text
1412import androidx.compose.material3.TextButton
13+ import androidx.compose.material3.TextField
14+ import androidx.compose.material3.TextFieldDefaults
1515import androidx.compose.runtime.Composable
1616import androidx.compose.ui.Modifier
1717import androidx.compose.ui.graphics.Color
@@ -31,8 +31,8 @@ import org.mozilla.focus.ui.theme.focusTypography
3131 * (e.g., by tapping outside or pressing the back button).
3232 * @param confirmButtonConfig Optional configuration for the confirm button. If null, the button is not shown.
3333 * @param dismissButtonConfig Optional configuration for the dismiss button. If null, the button is not shown.
34- * @param dialogBackgroundColor Background color for the dialog. Defaults to `focusColors.secondary`.
35- * @param dialogShape Shape for the dialog. Defaults to `MaterialTheme.shapes.medium `.
34+ * @param dialogContainerColor Background color for the dialog. Defaults to `focusColors.secondary`.
35+ * @param dialogShape Shape for the dialog. Defaults to `MaterialTheme.shapes.extraSmall `.
3636 */
3737@Composable
3838fun FocusDialog (
@@ -42,8 +42,8 @@ fun FocusDialog(
4242 onDismissRequest : () -> Unit ,
4343 confirmButtonConfig : DialogButtonConfig ? = null,
4444 dismissButtonConfig : DialogButtonConfig ? = null,
45- dialogBackgroundColor : Color = focusColors.secondary,
46- dialogShape : Shape = MaterialTheme .shapes.medium ,
45+ dialogContainerColor : Color = focusColors.secondary,
46+ dialogShape : Shape = MaterialTheme .shapes.extraSmall ,
4747) {
4848 AlertDialog (
4949 onDismissRequest = onDismissRequest,
@@ -75,7 +75,7 @@ fun FocusDialog(
7575 }
7676 }
7777 },
78- backgroundColor = dialogBackgroundColor ,
78+ containerColor = dialogContainerColor ,
7979 shape = dialogShape,
8080 )
8181}
@@ -141,7 +141,7 @@ fun DialogTextButton(
141141 onClick = onClick,
142142 modifier = modifier,
143143 enabled = enabled,
144- shape = MaterialTheme .shapes.large ,
144+ shape = MaterialTheme .shapes.extraSmall ,
145145 ) {
146146 Text (
147147 modifier = modifier,
@@ -151,7 +151,7 @@ fun DialogTextButton(
151151 focusColors.dialogActiveControls.copy(alpha = 0.5f )
152152 },
153153 text = text,
154- style = MaterialTheme .typography.button ,
154+ style = MaterialTheme .typography.labelLarge ,
155155 )
156156 }
157157}
@@ -173,15 +173,18 @@ fun DialogInputField(
173173 placeholder = placeholder,
174174 onValueChange = onValueChange,
175175 textStyle = focusTypography.dialogInput,
176- colors = TextFieldDefaults .textFieldColors(
177- backgroundColor = focusColors.secondary,
178- textColor = focusColors.onSecondary,
176+ colors = TextFieldDefaults .colors(
177+ focusedContainerColor = focusColors.secondary,
178+ unfocusedContainerColor = focusColors.secondary,
179+ disabledContainerColor = focusColors.secondary,
180+ focusedTextColor = focusColors.onSecondary,
181+ unfocusedTextColor = focusColors.onSecondary,
179182 cursorColor = focusColors.onPrimary,
180183 focusedIndicatorColor = focusColors.dialogActiveControls,
181184 unfocusedIndicatorColor = focusColors.dialogActiveControls,
182185 ),
183186 singleLine = true ,
184- shape = MaterialTheme .shapes.large ,
187+ shape = MaterialTheme .shapes.extraSmall ,
185188 )
186189}
187190
0 commit comments