Freitag, 14. Mai 2010

Button blues

The Android Buttons are actually quite ugly - even the build in calculator uses an own button class. Yes, not just a new background - a hole new class called “com.android.calculator2.ColorButton”.

The reason is that just changing the background colour does not actually work. If you do that you lose the borders, the edges, the gradient and highlights. After google-ing quite a lot I found that there are three options here:

  1. Use three background graphics.
  2. Use three background definitions.
  3. Create your own button class.


If you wonder why it need three background graphics and definitions: You need one for normal display, of for pressed and one for focused display.

For the FX-602P Simulator I I initially used three background graphics - basically because I already had the needed png files created for the QVGA display variant. However in the end gradients background definitions proved nicer - so I changed that.

For the HP-45 Simulator I didn't have the needed background graphics I used background definitions right from the beginning.

Keine Kommentare:

Kommentar veröffentlichen