material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.38k stars 3.07k forks source link

[MaterialAlertDialogBuilder] Title and Subtitle are overlapping in Android 12 devices and samsung devices #3346

Open richanshah opened 1 year ago

richanshah commented 1 year ago

Description: Full description of issue here

Expected behavior: Screenshots and/or description of expected behavior

Source code: The code snippet which is causing this issue ` fun Context.showCustomAlertDialog( strTitle: String, strMsg: CharSequence, strPositive: String, onPositiveClick: () -> Unit ) { val builder = MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogRounded) builder.setTitle(setTypeface(setMediumTypeface(), strTitle)) builder.setMessage(setTypeface(setRegularTypeface(), strMsg)) builder.setPositiveButton( strPositive ) { , _ -> onPositiveClick() } val dialog = builder.create() dialog.show() dialog.setCanceledOnTouchOutside(false) dialog.setCancelable(false) val positiveBtn = dialog.getButton(AlertDialog.BUTTON_POSITIVE) positiveBtn.letterSpacing = -0.01F

}