Nicolas
Nicolas

Reputation: 7081

Add text in the corner of a button Android

I have a quick symbol bar with a few buttons. I want to place a symbol in each corner of the button in addition to the button text. My goal is that when the user press the button then drag his finger in one of the corner direction, the symbol in the corner is inserted, like in Quoda app. Here's a quick sketch: enter image description here

How can I write in the corners of the button programmatically?

For the second part, I guess I could do it this way: I calculate the x,y difference from the center of the button at the release then insert the right symbol.

EDIT: I cannot use a ImageButton and a drawable background, because I want the symbols to be customizable.

Upvotes: 1

Views: 215

Answers (1)

Andrii Omelchenko
Andrii Omelchenko

Reputation: 13343

Try create custom compound component based on RelativeLayout with ImageView's (You can also use VectorDrawable's) in center and corners like in this tutorial.

Upvotes: 1

Related Questions