Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: custom button shape

I'm trying to achieve a custom controller containing of various buttons in different shapes. I'm wondering how I can achieve this with Android.

The result should look similar like this, where every color is a different button. alt text

I suppose I have to subclass View so please don't write that as an answer ;-) Please give some methodical steps what's needs to be implemented, like drawing, sensing touches, etc or maybe point me to some examples (if exist).

Thanks

like image 264
znq Avatar asked Sep 22 '10 16:09

znq


2 Answers

if you intend to draw this dynamically you would have to extend View and override onDraw, you can implement onTouchListeners, etc to detect when and where people are touching it.

like image 162
Nathan Schwermann Avatar answered Oct 05 '22 22:10

Nathan Schwermann


I found this document explaining everything in detail and having links pointing to related topics.

like image 28
znq Avatar answered Oct 05 '22 23:10

znq