XML shape drawable not rendering desired color

In drawable I use this xml code to define the border and background: <shape xmlns:android=”http://schemas.android.com/apk/res/android”> <stroke android:width=”4dp” android:color=”#D8FDFB” /> <padding android:left=”7dp” android:top=”7dp” android:right=”7dp” android:bottom=”7dp” /> <corners android:radius=”4dp” /> <solid android:color=”#f0600000″/> </shape>

The colored image turned to have no color and just a grey vector in drawable?

I got the answer for my own question which I find it’s useful for some who still do not know how to enable the Batch Drawable Import. It’s easy and just need to download plugin and install. I’ve read that the latest version already has it and I’ve downloaded and reinstalled, but it didn’t show … Read more

Equivalent of ImageView scaleType ‘centerCrop’ to bitmap drawable gravity

To center crop a bitmap in code do this: public static Bitmap cropCenter(Bitmap bmp) { int dimension = Math.min(bmp.getWidth(), bmp.getHeight()); return ThumbnailUtils.extractThumbnail(bmp, dimension, dimension); } I don’t know of any other way to centerCrop a bitmap xml wise. Hope it helps anyone. I found this solution from this post: Android Crop Center of Bitmap

Using layer-list to display some drawable images

Update your layer-list as follows <?xml version=”1.0″ encoding=”utf-8″?> <layer-list xmlns:android=”http://schemas.android.com/apk/res/android”> <item> <shape> <gradient android:centerX=”0.5″ android:centerY=”0.1″ android:endColor=”#08e25b” android:gradientRadius=”300dp” android:startColor=”#b7e9c9″ android:type=”radial” /> </shape> </item> <item android:width=”48dp” android:height=”48dp” android:bottom=”68dp” android:right=”-20dp”> <bitmap android:gravity=”bottom|right” android:src=”@drawable/peas” /> </item> <item android:width=”68dp” android:height=”68dp” android:bottom=”-20dp” android:left=”-20dp”> <bitmap android:gravity=”bottom|left” android:src=”@drawable/peas” /> </item> </layer-list>

Applying ColorFilter to ImageView with ShapedDrawable

Alright, I had a quick play with this and noticed your issue of the circles disappearing. Without you describing what exactly you tried, I assume you haven’t tried setting the color filter to the Drawable itself yet? (as opposed to the ImageView, which only seems to work with BitmapDrawables). The following statements work perfectly fine … Read more

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:

Is there a way to set drawable’s Alpha using XML?

It’s been a while since the OP, but personally found a solution that worked a lot better for me than the suggested answers. Creating a BitmapDrawable makes is easily possible to set the alpha: <?xml version=”1.0″ encoding=”utf-8″?> <bitmap xmlns:android=”http://schemas.android.com/apk/res/android” android:src=”https://stackoverflow.com/questions/8179250/@drawable/your_drawble” android:alpha=”77″> </bitmap> Alpha can be any value between 0 and 255. Note that it is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)