anko icon indicating copy to clipboard operation
anko copied to clipboard

Is this bug for alert button in Material Components Theme?

Open xloger opened this issue 6 years ago • 8 comments

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: image 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: image

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?

xloger avatar Feb 22 '19 02:02 xloger

I am seeing the same issue. Just started my material design theme conversion today and I have the same smashed button look.

KevinPosim avatar Mar 01 '19 14:03 KevinPosim

I have this issue as well since migration to androidx, how can we fix this?

Benjoyo avatar Mar 03 '19 13:03 Benjoyo

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 .

JAICHANGPARK avatar Mar 03 '19 22:03 JAICHANGPARK

Use AppCompat version:

alert(Appcompat, "Some text message").show()

ageevvalentin avatar Apr 12 '19 19:04 ageevvalentin

if you append ".Bridge" to your app themes parent it displays correctly:

barees63 avatar May 08 '19 01:05 barees63

Any Progress on this issue?

anilsam90 avatar Aug 04 '19 06:08 anilsam90

You should use MaterialAlertDialogBuilder if you are using MaterialComponents. More details here

svsq avatar Nov 25 '19 17:11 svsq

if you append ".Bridge" to your app themes parent it displays correctly:

This works for me.

hargoyal avatar Dec 06 '19 00:12 hargoyal