android-shapedrawable

How to build trapezoid shape in xml android?

谁都会走 提交于 2019-12-04 06:25:47
I want to build this shape with bottom line and text inside it i'm confused little bit how to achieve this i tired some code but don't get required thing. so far i have tried this code shape.xml <?xml version="1.0" encoding="UTF-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- Colored rectangle--> <item> <shape android:shape="rectangle"> <size android:width="100dp" android:height="40dp" /> <solid android:color="#13a89e" /> </shape> </item> <!-- This rectangle for the right side --> <!-- Their color should be the same as layout's background --> <item android

prevent partial overlapping of shape drawable stroke

落爺英雄遲暮 提交于 2019-12-03 12:37:29
Is there any way to prevent partial overlapping of the stroke on the shape drawable . I prefer to overlap the stroke completely on the borders of the shape. Here is my xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <padding android:bottom="0dp" android:top="0dp" android:left="0dp" android:right="0dp" /> <solid android:color="@color/green" /> <stroke android:color="@color/red_50" android:width="20dp" android:dashGap="2dp" android:dashWidth="10dp" /> </shape> colors.xml <color name="green">#0f0</color>

Shape drawable in layer-list rendered incorrectly for APIs below 23

僤鯓⒐⒋嵵緔 提交于 2019-11-30 09:04:24
Yesterday, I've switched to Android Studio version 2.1.3. Today, I've re-opened one of my projects and tried to add some layer-list drawables for use with an ImageView . For example this one: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:width="80px" android:height="80px" android:top="0px" android:left="0px" android:right="0px" android:bottom="0px"> <shape android:shape="rectangle"> <solid android:color="@color/deep_orange"/> </shape> </item> <item android:width="60px" android:height="60px" android:top="10px" android:left="10px" android:right="10px"

How to draw a dot circle inside a square drawable in android?

久未见 提交于 2019-11-29 17:53:24
I want a small dot inside a square button , this is what i have tried till now as answered by azizbekian: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <size android:width="100dp" android:height="100dp"/> <solid android:color="#38b0ef"/> </shape> </item> <item android:bottom="45dp" android:left="45dp" android:right="45dp" android:top="45dp"> <shape android:shape="oval"> <stroke android:width="1dp" android:color="#0c5069"/> <size android:width="20dp" android:height="20dp"/> <solid android

Shape drawable in layer-list rendered incorrectly for APIs below 23

自作多情 提交于 2019-11-29 08:34:14
问题 Yesterday, I've switched to Android Studio version 2.1.3. Today, I've re-opened one of my projects and tried to add some layer-list drawables for use with an ImageView . For example this one: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:width="80px" android:height="80px" android:top="0px" android:left="0px" android:right="0px" android:bottom="0px"> <shape android:shape="rectangle"> <solid android:color="@color/deep_orange"/> </shape> </item> <item

How to draw a dot circle inside a square drawable in android?

天涯浪子 提交于 2019-11-28 12:18:17
问题 I want a small dot inside a square button , this is what i have tried till now as answered by azizbekian: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <size android:width="100dp" android:height="100dp"/> <solid android:color="#38b0ef"/> </shape> </item> <item android:bottom="45dp" android:left="45dp" android:right="45dp" android:top="45dp"> <shape android:shape="oval"> <stroke android