Add text in the corner of a button Android - 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:
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.

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.

Related

Image button misplaces when clicking Infer Constrains

I am having a problem with Android Studio. I have everything settled but when I click Infer Constraints, the image buttons misplaces. I could not find any solutions on Internet.
Here is the picture.
`
Try this... For the right image button, Don't set the edit text and centre button as constraints... Set the top and bottom of your layout as you did for the bill amount and place it near the centre image button...

Android: Create diamond button with icon and text inside

I would please like to know how to create a diamond shaped button with an icon and text inside. Like in the image below. If i rotate the button then the image and icon get rotated too and if I create a custom shape/image to use as the background the buttons clickable area is still a square. Any help would be appreciated?
if you want change clickable area you have to intercept touch events and filter them. You need custom view for doing this

How can I do when button focus on image another image appear

I already have designed menu bar circle layout and wheel menu for android application. it is scroll circle . But I want this
1) When button comes on image ( focus red circle ) it should be clickable
2) when button hover on image ( focus red circle ) it should be show another image
how can I understand which button focus on image.
I put picture.First picture; when button two hovering red circle second picture appear, and another image showing. Which library should I use. Do you know any project open source code?
sorry my bad english.
You can use the arcMenu or the android Clickwheel layouts.
Check thse links for additional details:
ArcMenu
ClickWheel

creating an "elevated button" effect in android

I want the button to appear as though it has space in between the bottom of it's face and the canvas. Then, when clicked, it will appear as though there is no space between the button and the canvas. I know I can style the button with xml to give it those 2 looks but I don't know how to do the elevated look.
My question is how would one go about doing this?
Easiest approach to this is creating 2 background images, each fitting the state you want, then you can either set the backgrounds according the button's state, or change the backgrounds by setting an onTouchListener to the button.

How to create an iOS style arrow button in Android?

I am partial to dual use buttons in iOS, like in the image below:
How can I create these types of buttons in Android? In other words, the entire button must be clickable, the arrow must be right-aligned and the text of the button must be left aligned.
I tried playing with a regular Button widget, but no luck. Do I have to resort to a Table layout (but then the clickability would be lost).
You will need customized shape background for the Button
You can find customizing shape here.
Set that background to the Button from xml, and for showing arrow, you will need to add arrow.png to your project drawables.
you will add attribute to button like this:
<Button android:backround="#drawable/cell_background"
android:drawableRight="#drawable/arrow" ... />

Categories

Resources