jeudi 14 mai 2015

Appcompat Alert Dialog Action button background On pressed state

I am trying new AlertDialog from appcompat v7 22.1.1.

It works pretty well (In all android versions) as in image.

enter image description here

Style for AlertDialog is this.

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

            <item name="colorPrimaryDark">#111111</item>

            <item name="colorPrimary">#00ddff</item>

            <item name="colorAccent">#0044aa</item>

            <item name="colorButtonNormal">#00aaaa</item>

            <item name="colorControlHighlight">#00ddff</item>

            <item name="alertDialogTheme">@style/AlertDialogTheme</item>

</style>
<style name="AlertDialogTheme" parent="Theme.AppCompat.Dialog.Alert">
                <item name="colorAccent">#0044aa</item>
                <item name="android:background">#ffffff</item>
                <item name="android:textColorPrimary">#000000</item>
                <item name="android:windowTitleStyle">@style/MyTitleTextStyle</item>
</style>

<style name="MyTitleTextStyle">
                <item name="android:textColor">#0044aa</item>
                <item name="android:textAppearance">@style/TextAppearance.AppCompat.Title</item>
</style>

My question is ,

1) how to change statePressed color which is rounded (Gray) in the image ?

2) No pressed color is there in android >= 21 , what is hack for this ?

3) How can I have different colors of action buttons (Is it possible)?

Any help would be great.

Aucun commentaire:

Enregistrer un commentaire