znq
znq

Reputation: 44973

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

Upvotes: 7

Views: 4256

Answers (2)

znq
znq

Reputation: 44973

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

Upvotes: 1

Nathan Schwermann
Nathan Schwermann

Reputation: 31503

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.

Upvotes: 1

Related Questions