I am trying to make a button in android that does different things depending on whether you click on the left half of the button or on the right half of the button.
Some additional things that the button needs to do are:
- Have 1-4 of these buttons in an activity all of the same size.
- Be able to rotate the button (e.g. 90 degrees, 180 degrees so it’s upside-down).
I thought up some different solutions and need to know what would be best practice.
Option 1: Put 2 buttons inside of LinearLayout, remove the spacing in-between them, and then add a text-view on top to make it look like one button.
- Easy to do
- It feels like a hackjob and may come back to bite me if I need to change things later.
Option 2: Build a custom View to do the job.
- I can build it to tailor exactly to my needs.
- I’m not sure how to do this or where to find out how to do this.
Should I choose one of these options or is there another, better solution I can’t think of?