Android diagonal triangular buttons

I am working on an android application.

I need to have 2 buttons, but it looks like the following image.

enter image description here

The red triangle is a button, and the yellow is another button.

How can this be achieved?

Is there a way to do this otherwise than having it as 1 image and then check the position of the touch? because it will require a lot of math and may be inaccurate. Also, if I use this method, I cannot press each press of each button separately. (for example, when the button turns gray when touched)

Thanks for any advice.

+4
source share

Source: https://habr.com/ru/post/1538215/


All Articles