Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dialog themed activity : positive and negative buttons

I'm trying to theme an activity as an AlertDialog. The problem I'm facing is that I can't find a way to put two buttons on the bottom of my window that would look like the positive and negative buttons of an AlertDialog

I've already added that line to my Activity in the manifest (I'm using Sherlock Library):

android:theme="@style/Theme.Sherlock.Dialog"

And the Activity is looking exactly like a Dialog, but I can't find a theme to set on the buttons. What could I do?

like image 526
MagicMicky Avatar asked Jun 28 '12 21:06

MagicMicky


1 Answers

Alright, if you're developping an application for HC/ICS, without Sherlock, the answer is here : https://gist.github.com/2348305

Just theme using

style="?android:attr/buttonBarStyle"

for container,

style="?android:attr/buttonBarButtonStyle"

for buttons

and

android:divider="?android:attr/dividerHorizontal"
android:showDividers="middle"

for the root layout

like image 81
MagicMicky Avatar answered Oct 21 '22 05:10

MagicMicky