I have created the following progressbar style and set the corner radius to both shapes (background, and pogress). But how i make corner straight not rounded?
like this
Related
I want a cardview to look like as in the image below. How to a create shape with rectangle with elongated botton right corner in the drawable and apply it as a background to a cardview? OR is there a better way to achieve this result?
This is a gradient rectangle with rounded corners. The corner radious is 5dp and gray turns to completely transparent within 20dp.
How would I make this bitmap programmatically?
( It's important to have the corners do the same gradient color transition circularly. So I cannot use one rectangle gradient overlapping with an oval gradient coz this would create a darker area where the two gradients would overlap )
An ellipse is easy to create. So is a rectangle with rounded corners. But how do I create a velodrome shape?
That is, half a circle to the left + rectangle in the middle + half circle to the right. Like a straight sausage, if you want.
I want this as an XML drawable to be used as background for a TextView.
What you're describing is a rectangle with rounded corners, just a specific class of one. Simply increase the radius of your corners to half the height of your rectangle.
I have a button say myButton. I want to set the top left corner radius of the button programmatically.
I'm looking for something like
myButton.setTopLeftCornerRadius(10);
I have looked for a method like 'setcornerradius' in eclipse but got nothing.
You can use shape drawable for this or rounded corner background Image.
For shape drawable detail please see this post.
How to set corner radiuses for the button in java code?
Cheers.
Button is type of View and all Views in Android occupy rectangular areas. However, you can set the background of the button to any image you like. Like a Shape Drawable with round corners.
Try this code for draw the rounded corners edittext:
How to create EditText with rounded corners?
I have some text in a relative layout.I know that we can draw a border with curves using stroke and corner in a separate xml.
Is there a way to apply gradient effect for the border constructed with the stroke? or is there any other way to draw a gradient border?
Thanks in advance.
I don't know of a way to do that trivially, but it seems like you could define two shape drawables and combine with a layer drawable. The bottom one would be a rounded corner rectangle with a gradient, the top one would be a slightly smaller rounded corner rectangle of whatever you wanted the interior color to be. The effect should be something like a stroke gradient, although I haven't tried it.