0

I need to create a dialog which displays text:"Choose your gamemode" and then when user clicks on specific button (4 buttons total), execute the action with onItemClickListener(). But I want from it to have the custom shape. Here is my code for the shape:

<solid android:color="#ffffff" />

<stroke
        android:width="4dp"
        android:color="#000000" />

<corners
        android:bottomLeftRadius="80dp"
        android:bottomRightRadius="80dp"
        android:topLeftRadius="80dp"
        android:topRightRadius="80dp" />

How should I continue with defining the layout and how can I make the dialog itself ?

EDIT:

Now the code works but I can see the ugly black rectangular borders around my DialogActivity. How can I remove them ?

Traabefi
  • 23
  • 5
  • To make your dialog: [API](http://developer.android.com/guide/topics/ui/dialogs.html). To style, what about [this topic](http://stackoverflow.com/questions/2422562/how-to-change-theme-for-alertdialog)? – user2810895 Jan 18 '15 at 17:23
  • that's not exactly what I wanted. I wanted to have a dialog, not AlertDialog. And I don't know either how to make the layout for it. – Traabefi Jan 18 '15 at 17:28
  • You can make your custom `Activity`. Make the background transparent except for your "dialog window" – user2810895 Jan 18 '15 at 17:32
  • Thanks for that. And now the most important thing, how ? – Traabefi Jan 18 '15 at 17:33

1 Answers1

0

According to the comments: This can be handy for you.

user2810895
  • 1,284
  • 3
  • 19
  • 33
  • You can make your own theme based on the code you wrote above. For example (in the `res/values/` folder of your project): ` ` Then just set your style in the activity xml: ` ` – user2810895 Jan 18 '15 at 17:44
  • well, the code works, butI cant make my theme because it won't accept the 'shape' – Traabefi Jan 18 '15 at 18:10
  • How can I remove that ugly black rectangle that's displaying as additional background around my custom shape ? – Traabefi Jan 18 '15 at 18:37