anko
anko copied to clipboard
Is this bug for alert button in Material Components Theme?
when I import design 28.0.0,and theme use "Theme.MaterialComponents.Light.NoActionBar", I build a alert dialog by Anko:
alert("是否提交所选的类型?") {
yesButton {
submit()
}
noButton {
super.onBackPressed()
}
}.show()
preview:
I build a alert dialog by normal:(import android.support.v7.app.AlertDialog)
val dialog = AlertDialog.Builder(ctx)
dialog.setMessage("是否提交所选的类型?")
dialog.setPositiveButton("提交") { _, _ ->
submit()
}
dialog.setNegativeButton("关闭") { _, _ ->
finish()
}
dialog.create().show()
preview:
I'm not sure this is Anko's bug,alert{} is import android.app.AlertDialog seems to be a must,but what should I do if I want use alert{} in Material Components? explain a style,or create extensions function use v7.AlertDialog?
I am seeing the same issue. Just started my material design theme conversion today and I have the same smashed button look.
I have this issue as well since migration to androidx, how can we fix this?
Try to change your style.xml file
2019年3月3日(日) 午後10:20 Benjoyo [email protected]:
I have this issue as well since migration to androidx, how can we fix this?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Kotlin/anko/issues/731#issuecomment-469022320, or mute the thread https://github.com/notifications/unsubscribe-auth/ASlPYzzuV_IHpNRL_0vX3yHlfM8Dw43iks5vS8w6gaJpZM4bItjR .
Use AppCompat version:
alert(Appcompat, "Some text message").show()
if you append ".Bridge" to your app themes parent it displays correctly:
Any Progress on this issue?
You should use MaterialAlertDialogBuilder
if you are using MaterialComponents.
More details here
if you append ".Bridge" to your app themes parent it displays correctly:
This works for me.