Create rectangle with curved side - android

I am attempting to create a shape to "border" a button (linked below with the asterisk inside). I have a rounded button to the right that I have I already created, but have become stuck trying to create the other shape.
I have had many attempts at this, but none seem to work and it's incredibly frustrating.
Just to note, that the shape I want is currently a TextView and houses a number "1:" through to "4:"
Any help at all will be appreciated.
Image of what I am attempting to achieve:

Related

Android :How to design 3D joysticks

I am going to design an app where i have 3D joysticks that sends some command from app towards arduino via BLE.i searched out alot about 3D joy sticks lib or other source to integrate it within in my app but i am unable to find it.There is some lib on github that gives 2D joysticks functionality but have no 3D design.
But this is not the one that i need.i want to desgin the jostick like below one.
please any one have any idea how to design it in android..any help would be appreciated.
you can create this design that is very easy, you have to create some drawables with gradient and selector for button and need some images.
Here is the list of components you need
background image
left, right, top bottom navigation images
outer circle drawable with gradient color.
Inner circle with border of gradient color.
And finally two button images one for pressed effect and second for normal state (will be used in selector to make 3D effect).
That is enough to make this design in Android.
Hope it will help you.

Custom Button Shape (substract shapes)

I try to create a custom button where a circular shape is cut out from a rectangular button, see mockup.
I already looked into the Outline class but it doesn't provide subtraction, only rects and ovals, no combination of them.
Also, I thought of setting android:background to a custom drawable but I couldn't succeed. The drawable consisted of a layer-list with a colored rect and a white oval but the oval was always placed at a different position depending on the device's resolution.
Do I really have to go through the pain of creating my own View class? That seems to be an overkill for this rather simple task, doesn't it?
PS: Concerning usability, I know that buttons close to each other aren't user-friendly, but this problem doesn't arise in my real scenario, only in this mockup.

Creating non-traditional shape tooltip in android with border

Hello fellow Android designers,
I am struggling right now to create xml tooltip that would look like the one on this picture:
Unfortunately it seems like a hell of a work. Till now I was only able to create a simple rounded rectangle like that:
Is it actually possible to create such a shape I have presented on the first photo using xml styling or should I try to create it programatically (which will probably take huge amount of time and creating border would be really hard)? Or maybe the simplest solution is the best and I should use partially transparent png image with the shape of my choosing?
Any advice would be much appreciated.
You can draw it using stretchable 9-patch drawable.
You can specify there which parts are fixed (the little knob on the left and corners) and which are stretchable (all other parts)

Draw a gradient filled polygon to use in a selector

I am trying to create a drawable such as this in Android:
I don't think a nine patch will work because there is nowhere that can safety scale vertically. So next I tried a shape drawable but it does not support triangles.
I want to render this image on the fly so there are no artifacts. Also I want to be able to use it in a selector, so I need to be able to represent this image in xml. Maybe I need to extend some class to manually make the shape. If so how do I embed a tag in the xml to tell it where to render? Does anyone know where to start with this or have an example of something similar?
I have read the first 10 pages of hits on stack overflow and google and am not getting anywhere. Thanks very much for any help.
I think a 9-patch would work. For the vertical stretching on the left boundary, fill in the line from top to bottom.

Circle/daisy layout (pinwheel) in Android?

I want to create a circle layout. All of my views should be in the circle. Which layout do I have to prefer and how? The focus of the layout should be a clockwise circle.
Edit:
I can do this view and it is an update of my question, prompted by the comments to this question. Is there any example for doing that?
The screenshot is attached below.
image http://www.freeimagehosting.net/uploads/e11f35e522.png
For people who is coming to this question now I recently had to implement this circle layout and after a lot of searching I decide that a relative layout that draws a petal shaped buttons will not give me the effect I needed so I followed those steps
you can see if you tested the nbc app on iphone they are placing invisible buttons on the words and the circle is just an image with the button overlaid but I didn't like this solution .
So here's how I implemented it
1- asked for the flower with the words on it from the UI guy and told him that the colors must be solid no gradient what so ever and then asked him to send me the hexadecimal values of each color.
2- then I implemented a motion listener that checks the color of the pixel the user clicked on ACTION_UP event and launch the event corresponding with the category of that color .
3-I check the color by getting x & y from the listener and then get the color from the image bitmap
I'll post snippets of the code If anyone needs it but I don't have it on me now.

Categories

Resources