0

How to increase the text size of RadioGroup in AlertDialog made using setSingleChoiceItems? enter image description here

This is what we tried but did not work.

<style name="DialogButtonStyle" parent="Widget.Material3.Button.TextButton.Dialog" tools:keep="@style/DialogButtonStyle">
        <item name="android:textColor">@color/orange</item>
    </style>

    <!-- AlertDialog theme on both light and night mode -->
    <style name="AppDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog" tools:keep="@style/AppDialog">
        <!-- Background color -->
        <!--<item name="colorSurface">@color/colorWhite_Primary</item>-->
        <!-- Message color -->
        <item name="colorOnSurfaceVariant">@color/white_black</item>
        <item name="buttonBarPositiveButtonStyle">@style/DialogButtonStyle</item>
        <item name="buttonBarNegativeButtonStyle">@style/DialogButtonStyle</item>
        <item name="materialAlertDialogBodyTextStyle">@style/AppDialog.Body</item>
        <item name="alertDialogStyle">@style/MaterialAlertDialog.App</item>
    </style>

    <style name="MaterialAlertDialog.App" parent="MaterialAlertDialog.Material3" tools:keep="@style/MaterialAlertDialog_App">
        <item name="shapeAppearance">@style/ShapeAppearance.App.MediumComponent</item>
        <item name="shapeAppearanceOverlay">@null</item>
    </style>

    <style name="AppDialog.Body" parent="@style/MaterialAlertDialog.MaterialComponents.Title.Text">
        <item name="android:textAppearance">@style/AppDialog.Body.Appearance</item>
    </style>
    <style name="AppDialog.Body.Appearance" parent="@style/TextAppearance.MaterialComponents.Subtitle1">
        <item name="android:textSize">34sp</item>
    </style>
Bitwise DEVS
  • 2,858
  • 4
  • 24
  • 67

1 Answers1

0

I found the answer here, it should be checkedTextViewStyle instead of materialAlertDialogBodyTextStyle. It's a shame that Material 2 documentation is better than Material 3.

Bitwise DEVS
  • 2,858
  • 4
  • 24
  • 67