O'Reilly logo

Mastering Android Game Development by Raul Portales

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required