Custom dialogs

The next step in making our UI nicer is to stop using the standard Android dialogs and create our own custom ones instead. Once again this is something completely discouraged for apps but it makes a lot of sense for games.

There are many reasons why a custom dialog system is better for games:

  • The default dialogs will look different in different Android versions. This is in fact great when you use AlertDialog in an app, since it mimics the dialogs of all the rest of the apps, but not the games. We want consistency.
  • Default dialogs use the system font.
  • If you try to set a custom background or a custom content view, AlertDialogs look terrible. Again, you should never do that in an app, but you definitely want it in a game.
  • The standard ...

Get Android Game Programming: A Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.