Half circle shape not work

you can try this : <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <solid android:color=”#900021df”/> <size android:width=”10dp” android:height=”5dp”/> <corners android:bottomLeftRadius=”20dp” android:bottomRightRadius=”20dp”/> </shape> it gives this shape:

Changing color in a shape inside a layer-list programmatically

Ok I found the answer, I just had to put the id of the shape inside the item not in the shape kachel_ticked_style.xml: <item android:id=”@+id/selectable_kachel_shape”> <shape android:shape=”rectangle” > <stroke android:width=”5dp” android:color=”@color/headrbar_color” /> </shape> </item> And then you can change either the color of the shape calling shape.setColor or the color of the stroke calling shape.setStroke(strokeWidth,strokeColor)

Android Drawable: Specifying shape width in percent in the XML file?

You can’t specify a percentage. You need to specify a Dimension value to it. android:width is defined here: http://developer.android.com/reference/android/R.attr.html#width : (emphasis mine) Must be a dimension value, which is a floating point number appended with a unit such as “14.5sp”. Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font … Read more

Rounded corner for textview in android

Create rounded_corner.xml in the drawable folder and add the following content, <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” > <stroke android:width=”1dp” android:color=”@color/common_border_color” /> <solid android:color=”#ffffff” /> <padding android:left=”1dp” android:right=”1dp” android:bottom=”1dp” android:top=”1dp” /> <corners android:radius=”5dp” /> </shape> Set this drawable in the TextView background property like so: android:background=”@drawable/rounded_corner” I hope this is useful for you.

Creating an Isoceles Trapezoid shape

This shape (an Isoceles Trapezoid) can be easily made using CSS3 by rotating a div with a bit of perspective. Explanation The shape is achieved by rotating an absolutely positioned pseudo-element (.container:after) along the x-axis with a perspective. We are not rotating the actual container div because it would cause the link (and any other) … Read more

Scaling/Translating a Shape to a given Rectangle using AffineTransform

Note that AffineTransform transformations are concatenated “in the most commonly useful way”, which may be regarded as last in, first-out order. The effect can be seen in this example. Given the sequence below, the resulting Shape is first rotated, then scaled and finally translated. at.translate(SIZE/2, SIZE/2); at.scale(60, 60); at.rotate(Math.PI/4); return at.createTransformedShape(…);

How can I smooth my JFrame shape

A lot will come down to how you are rendering your content, but the basic concept is to supply rendering hints to the Graphics context you are drawing to… For example, if I was painting to a component, I might use something like… // Create a “copy” of the graphics context so we don’t modify … Read more