I am trying to change my positive button of the alert dialog. Can someone please help me?
This is what I have tried so far in my theme.xml from reading other people's answer:
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MyFirstTest" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/yellow_200</item>
<item name="colorPrimaryVariant">@color/yellow_500</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<item name="android:positiveButtonText">#00f</item>
</style>
<style name="AlertDialogTheme" parent="Theme.MaterialComponents.Light.Dialog.Alert">
<item name="buttonBarPositiveButtonStyle">@style/Alert.Button.Positive</item>
</style>
<style name="Alert.Button.Positive" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:textColor">#00f</item>
<item name="android:textSize">14sp</item>
<item name="android:textAllCaps">false</item>
</style>
</resources>
I am trying to change the positive button color to blue (#00f), but it kept on showing my primary color (yellow_200). I honestly do not know how to customize this theme: Theme.MaterialComponents.Light.NoActionBar Is there a website that guides what is included in this theme and how to customize it?
Thank you!