android - Styling of AlertDialog buttons -
in application use holoeverywhere. change appearance of alertdialog , got stuck on buttons below alert dialog. took how things done in holoeverywhere , tried modify that. here backtracking of reasoning:
in theme there atributes define alertdialogtheme , other stuff. come later selectableitembackground also.
<style name="holo.base.theme" parent="theme.appcompat"> ... <item name="alertdialogtheme">@style/holo.theme.dialog.alert</item> ... <item name="buttonbarbuttonstyle">?borderlessbuttonstyle</item> ... <item name="selectableitembackground">@drawable/item_background_holo_dark</item> * ... </sytle>
so figure alertdialogstyle target further defined in styles:
<style name="holo.base.theme.dialog" parent="holo.theme"> <item name="android:colorbackgroundcachehint">@null</item> <item name="android:windowanimationstyle">@style/holo.animation.dialog</item> <item name="android:windowbackground">@drawable/dialog_full_holo_dark</item> <item name="android:windowcontentoverlay">@null</item> <item name="android:windowframe">@null</item> <item name="android:windowisfloating">true</item> <item name="android:windowsoftinputmode">stateunspecified|adjustpan</item> <item name="android:windowtitlestyle">@style/holo.dialogwindowtitle</item> <item name="borderlessbuttonstyle">@style/holo.button.borderless.small</item> <item name="buttonbarstyle">@style/holo.buttonbar.alertdialog</item> <item name="listpreferreditempaddingleft">16dip</item> <item name="listpreferreditempaddingright">16dip</item> <item name="windowactionbar">false</item> <item name="windowactionmodeoverlay">true</item> <item name="windowanimationstyle">@style/holo.animation.dialog</item> <item name="windowcontentoverlay">@null</item> <item name="windowminwidthmajor">@dimen/dialog_min_width_major</item> <item name="windowminwidthminor">@dimen/dialog_min_width_minor</item> <item name="windownotitle">true</item> </style> <style name="holo.theme.dialog" parent="holo.base.theme.dialog" > </style> <style name="holo.theme.dialog.alert" parent="holo.theme.dialog"> <item name="alertdialogstyle">@style/holo.alertdialog</item> <item name="alertdialogtitledividercolor">@color/holo_blue_light</item> <item name="android:windowbackground">@android:color/transparent</item> </style> <style name="holo.button.borderless" parent="holo.button"> <item name="android:background">?selectableitembackground</item> <item name="android:paddingleft">4dip</item> <item name="android:paddingright">4dip</item> </style>
so holo.theme.dialog.alert inherited holo:base.theme.dialog has atribute borderlessbuttonstyle, guess defines buttons of alert dialog. style holo.button.borderless referes atribute selectableitembackground background. atribute set in application theme itself. so, reasoning if inherit theme holo.theme , set selectablebackground atribut change should reflect in customized alert dialog buttons , else background used.
<style name="themecustom" parent="@style/holo.theme> … <item name="selectableitembackground">@drawable/custom_item_background </item> … </style>
but not work. no change visible in alert dialog buttons. there wrong reasoning?
Comments
Post a Comment