android-shape

How to make shadow in layer-list?

谁说我不能喝 提交于 2019-12-06 05:45:38
The problem is as follows: I need to make in app widget some actionbar like this: For this I use layer-list with shape. <?xml version="1.0" encoding="utf-8"?> <!-- Bottom 2dp Shadow --> <item> <shape android:shape="rectangle"> <solid android:color="#027668"/> <corners android:radius="12dp"/> </shape> </item> <!-- White Top color --> <item android:bottom="4dp"> <shape android:shape="rectangle"> <solid android:color="#20a18b" /> <corners android:radius="7dp" /> </shape> </item> And I get some view: but, I cant do some around shadow like on first image in this post. How to do that? Here you go:

Draw a custom shape in android using XML

主宰稳场 提交于 2019-12-03 10:08:50
问题 I am adding a custom marker to the android map view. here is the image I am using for it.It looks like as more markers are placed say about 100 the entire app is getting slow. Here is the image I am using for that. Instead of using this image, I am planning to draw this image as a shape in XML. How to do that? Also I am following this tutorial to display a custom marker. Is this custom drawing delaying the app? Whats the best way to do it? 回答1: It's possible, but looks like does not make

Draw a custom shape in android using XML

社会主义新天地 提交于 2019-12-03 01:47:55
I am adding a custom marker to the android map view. here is the image I am using for it.It looks like as more markers are placed say about 100 the entire app is getting slow. Here is the image I am using for that. Instead of using this image, I am planning to draw this image as a shape in XML. How to do that? Also I am following this tutorial to display a custom marker. Is this custom drawing delaying the app? Whats the best way to do it? It's possible, but looks like does not make sense. Because Google Map requires only bitmap. So you need create bitmap and draw your shape with help of

how to build a trapezoid shape in android?

十年热恋 提交于 2019-11-30 17:52:30
how can I create a trapezoid shape like below image ? I don't want to use an image or 9.png . Try this: <?xml version="1.0" encoding="utf-8"?> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="292dp" android:height="172dp" android:viewportWidth="292" android:viewportHeight="172"> <path android:strokeWidth="1.5" android:strokeMiterLimit="10" android:pathData="M 27.046 96.615 L 16.416 150.396 L 271.534 150.396 L 186.495 22.836 L 37.676 22.836 L 27.046 86.615 Z" /> <path android:fillColor="#00ff00" android:strokeWidth="1.5" android:strokeMiterLimit="10" android

Android shape with gradient border and shadow

泪湿孤枕 提交于 2019-11-30 15:34:48
I have a png drawable for the buttons. But it image drawable has gradient and it looks bad when applying 9patch (gradient & 9patch non compatible). I want to do this with a shapes. But I can't drawing with android shapes because it's hard to me to understand it. Can you help me to draw this image with a shapes? It's contain a border gradient, orange rectangle inside with a rounded corners and shadow 120° Here you go Create your layout <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android

Draw multi object diagram in fragment

最后都变了- 提交于 2019-11-30 12:51:19
I'd like to achieve drawing a diagram just like the image attached but I'm having trouble drawing the red vertical rectangle on the right along with putting other objects on top. The biggest concern is the to do with numerous different screen sizes of Android devices. I fully understand what I'm trying to achieve during the process, which includes the objectives below. All help would be highly appreciated. 1 red rectangle on each side of the screen (right hand side I don't know how to draw there) 7 grey boxes in between the red vertical rectangles need to be equal in width a black vertical

Android shape with gradient border and shadow

守給你的承諾、 提交于 2019-11-29 20:13:03
问题 I have a png drawable for the buttons. But it image drawable has gradient and it looks bad when applying 9patch (gradient & 9patch non compatible). I want to do this with a shapes. But I can't drawing with android shapes because it's hard to me to understand it. Can you help me to draw this image with a shapes? It's contain a border gradient, orange rectangle inside with a rounded corners and shadow 120° 回答1: Here you go Create your layout <?xml version="1.0" encoding="utf-8"?>

Draw multi object diagram in fragment

允我心安 提交于 2019-11-29 18:02:03
问题 I'd like to achieve drawing a diagram just like the image attached but I'm having trouble drawing the red vertical rectangle on the right along with putting other objects on top. The biggest concern is the to do with numerous different screen sizes of Android devices. I fully understand what I'm trying to achieve during the process, which includes the objectives below. All help would be highly appreciated. 1 red rectangle on each side of the screen (right hand side I don't know how to draw

Defined custom shape for button in xml. Now I want to change the color dynamically. How?

做~自己de王妃 提交于 2019-11-28 13:07:07
I have this: round_button.xml <xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape android:shape="oval"> <solid android:color="#dec60000"/> <size android:width="150dp" android:height="150dp"/> </shape> </item> <item android:state_pressed="false"> <shape android:shape="oval"> <solid android:color="#860000"/> <size android:width="150dp" android:height="150dp"/> </shape> </item> My Button: <Button android:id="@+id/incrementBTN" android:layout_width="wrap_content" android:layout_height="wrap_content"

angle attribute in android gradient

亡梦爱人 提交于 2019-11-28 03:08:04
I am going through test example. Where for some Image background they are using gradient, the code goes like this <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#ff0000" android:centerColor="#00ff00" android:endColor="#0000ff" android:angle="180"/> <corners android:radius="5dp" /> </shape> In the above xml I didn't get angle attribute. but when I change the value of angle slightly the pattern slants. Can anyone explain me how exactly it works? karn Gradient basically represents the variation in space(in a