Android :: Setup Rounded Corner Radius Of A Color Drawable Using Xml?
Jan 23, 2010
On the android website, there is a section about color drawables. Defining these drawables in xml looks like this:
<resources>
<drawable name="solid_red">#f00</drawable>
<drawable name="solid_blue">#0000ff</drawable>
<drawable name="solid_green">#f0f0</drawable>
</resources>
In the java api, they have thr following method to define rounded corners:
setCornerRadius(float radius)
Is there a way to set the rounded corners in the xml?
View 2 Replies
Jun 30, 2010
I have a specific drawable that I use as background in my app. It is not a solid color.
Now I want to add rounded corners to this drawable.
I only found the rounded corner available in a shape with a gradient or a solid color as a background but not another drawable.
Is there another easy way of adding rounded corners to a drawable?
View 3 Replies
View Related
Oct 26, 2010
How to setup the attribute to achieve the rounded corner for each item in the ListView?
Please kindly give an example if you can, thanks!
for example:
http://www.flickr.com/photos/jaxxdotorg/3640222441/in/set-72157619952823330/
EDIT:
That's my code here for the answer..
View 1 Replies
View Related
Jun 16, 2010
I want to make a shape with with left-top rounded corner and left-bottom rounded corner...
View 2 Replies
View Related
Nov 8, 2010
I have this Listview element:
<ListView
android:id="@+id/category_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@drawable/list_background"
android:layout_marginTop="10sp"
android:layout_marginLeft="10sp"
android:layout_marginRight="10sp"
android:drawSelectorOnTop="false"
android:listSelector="@drawable/list_item_background"
android:cacheColorHint="#FFFFFF"
android:clipToPadding="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"a
ndroid:longClickable="true"
android:footerDividersEnabled="true"
android:headerDividersEnabled="true"
android:dividerHeight="1px" />
where list_background is:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" /> <solid android:color="#FFFFFF"/>
</shape>
The list view loads itself with the rounded corners, but then, the items of the list hide the round corners.
View 2 Replies
View Related
Feb 16, 2010
I have a small project in which I download images from Internet in the form of drawable and use them in Imageview for which I have provided functionality similar to an Imagebutton but without the gray edges. The question is that is there any functionality in Android (similar to IPhone) by which we can crop the drawable from edges to make them rounded edged drawable. Even if its a "not-tested-neither-recommended" method, do let me know. I would like to work on this a bit.
View 1 Replies
View Related
Sep 19, 2010
This is some part of the colors.xml from android samples directory. Now my question is that, what is the difference between defining a color in <drawable> tag and <color> tag ?
View 1 Replies
View Related
Oct 18, 2010
How can i set the opacity of a Drawable object?
View 1 Replies
View Related
Nov 24, 2009
What would be the right way to turn a color Drawable into a grayscale one (to indicate disabled state)?
View 3 Replies
View Related
Aug 6, 2010
If you squeeze you home page from corner to corner diagonally. ALL of your home pages appear. While holding you finger in the center make a circle and they will stay until you tap the screen.
View 8 Replies
View Related
May 12, 2009
I want to know if I can set color to some of the words in EditText, if it can be done, please tell me how to do this..
View 2 Replies
View Related
Nov 15, 2010
I require a sliding drawer in my application.
It should be placed at the bottom of the page.
It has to contain a set of images and I have to set a background color for the sliding drawer. I saw some sample codes...But I am not getting a clear idea on how to do it.
View 1 Replies
View Related
Jul 19, 2010
Is it possible to set the color of just span of text in a TextView?
I would like to do something similar to the Twitter app, in which a part of the text is blue. See image below..
View 2 Replies
View Related
Jul 13, 2010
Is there a default solid background for my Evo wallpaper? All I have been able to find are pictures, or Live wallpapers; not colors.
Or should I set a solid color JPG as the background?
View 1 Replies
View Related
Oct 19, 2010
I am running my application in the emulator using a high density skin (like WVGA800). However the ressources in my application are loaded from the drawable- mdpi folder instead of drawable-hdpi ... what else should I do so that android use the correct folder ?
View 4 Replies
View Related
Mar 1, 2010
I want to store locations in my Android phone and be able for the application to tell me if I am inside these points&radius.What is the best way to store many point&radius locations and efficiently query for them?
View 1 Replies
View Related
May 12, 2010
I want to draw a a circle of 15 KM radius around a point on Google Maps by using Android. In Android we only have MapView and MapViewController. How can I implement the drawCircle funciton provided in Google Map Circle example in Android.
View 1 Replies
View Related
Jul 26, 2010
When using border-radius on my android emulator I am seeing ugliness like this:
Is there anyway to get Android to display rounded corners via -webkit-border-radius in a more pleasing way? Most modern desktop browsers and Mobile Safari seem to antialias their corners, but not Android's renderer.
I'm really hoping I don't have to do this with images, and there is some awesome trick to get pretty corners with only a border radius css declaration.
View 1 Replies
View Related
Oct 6, 2010
I have the following custom view:
This I have achieved by using the Canvas' drawArc() method. However, with this drawArc() method I cannot limit the arc's inner radius.
What I'd like to have is something like this: where there is only an outer ring left.
What I need is an drawArc() function where I can set the inner radius of the arc. Anyone an idea how to do that?
Overpainting the inner area doesn't work, because it needs to be transparent. Painting an inner circle with Color.TRANSPARENT after painting the red and blue cones doesn't remove the old color. It just puts another layer on top, which is transparent and through which I can still see the red and blue.
View 1 Replies
View Related
Jun 27, 2010
I have this query which does work fine in MySQL
CODE:............
Distance is in Kilometers, the input is lat=12.345 and lon=67.89
The SQLite is 3, and I can't run custom functions with it as it's on Android. I also don't have acos() etc... as that is not part of the standard SQLite.
How would be the above query in SQLite?
View 1 Replies
View Related
Sep 3, 2009
In my application I have a list of +400 GPS coordinates which I retrieve from addresses. The application should give me the top X nearest coordinates based on my current location.
This application is possible (I think) with the distanceBetween function. But (I think) the application is really inefficient when i iterate through the list of 400 coordinates and check the distance within a certain time interval. Another option is (I think) the proximityAlert function? All coordinates are loaded in this function and when my current location comes in the radius of a coordinate an alert is given. But the downside of this solution (I think) is the high memory usage which implies a short battery life of the Android phone?
View 6 Replies
View Related
Jan 16, 2010
I have a MapView that I'm displaying a "useful radius" (think accuracy of coordinate) in. Using MapView's Projection's metersToEquatorPixels, which is admittedly just for equatorial distance) isn't giving me an accurate enough distance (in pixels). How would you compute this if you wanted to display a circle around your coordinate, given radius?
View 1 Replies
View Related
Jul 7, 2010
Does the X support (non-PSK) wpa/wpa2 (enterprise / radius / 802.1x) authentication for connection to wifi networks using a central security authority?
View 2 Replies
View Related
Nov 2, 2010
I'm using the following to draw rounded-corner rectangles in my Android application and it seems to be working alright but with one minor problem:
CODE:.......
(Adding labels to the rectF's defined above follows) ...
The strange thing is that the two ends of the rectangle aren't rounded over the same. The left-size quarter circles are noticeably smaller than the ones on the right.
Anybody experienced anything similar? It's weird enough that I might change my mind about the round corners if I can't do anything about it.... And if I knew how to do a screen capture from my Android, I would.
The rectangles in question are 78 pixels wide and 48 tall, if that helps (and since ykatchou may be onto something).
View 1 Replies
View Related
Oct 27, 2010
I want a RelativeLayout to have a rounded corner just like we have it in the Iphone.Please let me know how can we do this in Android.
View 2 Replies
View Related
May 20, 2010
Does anyone know how to obtain the rounded rectangle effect from this picture? http://developer.android.com/intl/de/resources/articles/images/list_f...
Is it somewhere in samples?
View 3 Replies
View Related
Mar 17, 2010
In android, ImageView is a rectangle by default. Is it possible to make it a rounded rectangle (clipped off all 4 corners of my Bitmap to be rounded rectangles) in the ImageView? If yes, can you please tell me now can I do that?
View 4 Replies
View Related
Sep 5, 2010
Is there any way to create EditText that has rounded corners?
View 2 Replies
View Related
Sep 28, 2010
The following code snippet draws a red rectangle:
RectF rectangle = new RectF(50, 100, 100, 50);
Paint paint = new Paint();
paint.setColor(Color.RED);
canvas.drawRoundRect(rectangle, 0, 0, paint);
However if i change rx and ry both to a positive value, say 5, than nothing is shown. Any ideas?
View 1 Replies
View Related
Apr 6, 2010
I am having a gridview. when i select it, the selector(orange color) will shows like square. i want to set that as rounded corners. how to do that?
View 1 Replies
View Related