@@ -17,6 +17,8 @@ import androidx.compose.runtime.getValue
1717import androidx.compose.runtime.setValue
1818import androidx.compose.ui.Alignment
1919import androidx.compose.ui.Modifier
20+ import androidx.compose.ui.graphics.Color
21+ import androidx.compose.ui.text.TextStyle
2022import androidx.compose.ui.unit.dp
2123
2224/* *
@@ -29,6 +31,8 @@ import androidx.compose.ui.unit.dp
2931fun MaterialDialogScope.title (
3032 text : String? = null,
3133 @StringRes res : Int? = null,
34+ color : Color = MaterialTheme .colors.onSurface,
35+ style : TextStyle = MaterialTheme .typography.h6,
3236 center : Boolean = false
3337) {
3438 val titleText = getString(res, text)
@@ -50,8 +54,8 @@ fun MaterialDialogScope.title(
5054
5155 Text (
5256 text = titleText,
53- color = MaterialTheme .colors.onSurface ,
54- style = MaterialTheme .typography.h6 ,
57+ color = color ,
58+ style = style ,
5559 modifier = modifier
5660 )
5761}
@@ -66,6 +70,8 @@ fun MaterialDialogScope.title(
6670fun MaterialDialogScope.iconTitle (
6771 text : String? = null,
6872 @StringRes textRes : Int? = null,
73+ color : Color = MaterialTheme .colors.onSurface,
74+ style : TextStyle = MaterialTheme .typography.h6,
6975 icon : @Composable () -> Unit = {},
7076) {
7177 val titleText = getString(textRes, text)
@@ -79,8 +85,8 @@ fun MaterialDialogScope.iconTitle(
7985 Spacer (Modifier .width(14 .dp))
8086 Text (
8187 text = titleText,
82- color = MaterialTheme .colors.onBackground ,
83- style = MaterialTheme .typography.h6
88+ color = color ,
89+ style = style
8490 )
8591 }
8692}
@@ -91,13 +97,18 @@ fun MaterialDialogScope.iconTitle(
9197 * @param res message text from a string resource
9298 */
9399@Composable
94- fun MaterialDialogScope.message (text : String? = null, @StringRes res : Int? = null) {
100+ fun MaterialDialogScope.message (
101+ text : String? = null,
102+ color : Color = MaterialTheme .colors.onSurface,
103+ style : TextStyle = MaterialTheme .typography.body1,
104+ @StringRes res : Int? = null
105+ ) {
95106 val messageText = getString(res, text)
96107
97108 Text (
98109 text = messageText,
99- color = MaterialTheme .colors.onSurface ,
100- style = MaterialTheme .typography.body1 ,
110+ color = color ,
111+ style = style ,
101112 modifier = Modifier
102113 .padding(bottom = 28 .dp, start = 24 .dp, end = 24 .dp)
103114 )
0 commit comments