3

I'll need to implement a UI that reflects the layout of a real object. Below is the layout that the client wants. Each black block is a button, so it need a custom drawable, listeners, states, etc.

I'd like to use a custom implementation of the Button widget, but as far as I know they only accept rectangular touch targets and laying them out could be tricky.

enter image description here

What would you use to achieve this layout?
Please note: the 2 central button should be a semicircle cutted in half (with some padding between the 2), not this strange shieldy shape, I'm just not that good with Photoshop.

EDIT: As suggested in this question I could use a TouchListener on the layout and fake a click on the right button. The main problem with this solution is that I'll need to know the bounds of the drawable, not the rectangular ones of the button's bounding box (that is always rectangular). How could I do that?

5
  • The solution: stackoverflow.com/questions/19475368/… Commented Apr 14, 2014 at 9:40
  • so what do you want? ready layout with this buttons? Commented Apr 14, 2014 at 9:44
  • An hint at what I could use. If it is possible to have non rectangular touch target for a Button. You know, some help, as for the purpose of this site. Commented Apr 14, 2014 at 9:46
  • @Foxinsocks I'll try with the overlaying touch listener, I'll just need to figure out how to understand the bounds of the buttons. Commented Apr 14, 2014 at 9:52
  • I'll try with a RelativeLayout containing some TextViews or ImageViews (which are clickable controls). Relatively positioned over the background image. It does really no matter, if they are "square" controls. You typically touch the clickable areas inside, not on the corners or on the sides. So, the "square" approximation is good enough. Commented Apr 14, 2014 at 10:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.