chnouman/AwesomeDialog

Click effect

ArchangerOne opened this issue · 1 comments

Hi,

i'm unable to find a button click effect implementation method. So how to make background selectable effect on buttons?

@ArchangerOne you can try this

  AwesomeDialog.build(this)
                .title(
                    title,
                    titleColor = ContextCompat.getColor(this, android.R.color.white)
                )
                .body(
                    body,
                    color = ContextCompat.getColor(this, android.R.color.white)
                )
                .icon(R.drawable.ic_congrts)
                .background(R.drawable.layout_rounded_green)
                .onPositive(
                    goToMyAccount,
                    buttonBackgroundColor = **R.drawable.layout_rounded_dark_white**,
                    textColor = ContextCompat.getColor(this, android.R.color.black)
                ) {
                    Log.d("TAG", "positive ")
                } 

change drawable to the selector

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- pressed -->
    <item android:drawable="@drawable/button_1_selected" android:state_pressed="true"/>
    <!-- default -->
    <item android:drawable="@drawable/button_1_normal"/>
</selector>