android-vectordrawable

Vector drawable not drawn correctly in Android Studio

一曲冷凌霜 提交于 2019-12-12 11:14:42
问题 I'm in the middle of a redesign for an app, and I am having problems with getting some of the icons to draw correctly in Android Studio. I'm using Sketch for all of the design work. I've looked around quite a bit online to try and figure out a solution but am having a very difficult explaining the problem with search terms, so I thought I would try posting screenshots and providing a Sketch file to see if the StackOverflow community can help. I think the problem has to do with the

Android: How to change android:fillcolor with selector in one Vector Drawable xml

≯℡__Kan透↙ 提交于 2019-12-12 07:27:29
问题 Tab Icons: My current method is to create two files (ic_list_selected_24dp.xml and ic_list_unselected_24dp.xml; they are basically the same but only the android:fillColor='Color HEX CODE' are different), and then create a selector (selector_tabitem_list.xml) to change the drawable color when the state is changed. // @drawable/selector_tabitem_list.xml <selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android

VectorDrawable to Bitmap: Bitmap.setHasAlpha(boolean)' on a null object reference

自作多情 提交于 2019-12-12 04:31:48
问题 I'm trying to get Bitmap from VectorDrawable (xml image): VectorDrawable vectorDrawable = (VectorDrawable) ContextCompat.getDrawable(mContext, R.drawable.test); Bitmap bitmap = UtilMethods.getBitmapFromVector(vectorDrawable); But app crashes on Bitmap.createBitmap method with Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Bitmap.setHasAlpha(boolean)' on a null object reference error public static Bitmap getBitmapFromVector(VectorDrawable

Vectors throwing Resources$NotFoundException after updating support library from 23.v to 24.v

天大地大妈咪最大 提交于 2019-12-12 03:04:35
问题 Everything was working fine while on support lib 23 but after updating support lib to ver 24, i am getting crash exceptions on pre-lollipop devices for layer-list which have vector drawable in them which ultimately leads to Resources$NotFoundException. Any idea why? FYI, everything else is working fine, eg. vector in imageview, runtime vector drawable usage and yes i have configured gradle properly. Adding stack trace for better understanding. Fatal Exception: java.lang.RuntimeException:

VectorDrawable Resources$NotFoundException while xml vector drawable resource file does exist

我怕爱的太早我们不能终老 提交于 2019-12-11 15:44:47
问题 My app min SDK is 21 so its no need to add AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); to Application class since its only for lower than 21 (anyway I tried to add it with no result). My build.gradle config file has defaultConfig {vectorDrawables.useSupportLibrary = true} setting and no proguard/minify enabled debuggable true crunchPngs false minifyEnabled false shrinkResources false splits.abi.enable false splits.density.enable false Anyway I checked the compiled .apk file

Vector Drawables in Layer List on Android API 16 and higher

怎甘沉沦 提交于 2019-12-11 02:38:13
问题 I am having some trouble with vectors drawable on older API version in Android. I need to change drawables at runtime each time the activity starts should load the corresponding svg file. This is my layer list : <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item > <shape android:shape="oval"> <size android:height="50dp" android:width="50dp"/> <!-- fill color --> <solid android:color="@color/white" /> </shape> </item> <item

resize vectordrawable icon programmatically

。_饼干妹妹 提交于 2019-12-10 20:27:20
问题 I am showing some VectorDrawable icon dynamically in my android project. However, I couldn't scale the icons in java layer using the below code: VectorDrawable jDrawable = (VectorDrawable) getContext().getDrawable(nResourceID); // resize the icon jDrawable.setBounds(30, 30, 30, 30); // set the icon in the button view button.setCompoundDrawablesRelativeWithIntrinsicBounds(jDrawable, null, null, null); Note : Android how to resize (scale) an xml vector icon programmatically the answer does not

Auto Mirroring for RTL layout doesn't work in Android versions below 6.0

心不动则不痛 提交于 2019-12-10 15:23:32
问题 As you know Vector Drawables was added in Android Support Library 23.2 which announced in Android Developer Blog that for all versions of android we can use it instead of adding extra icons in different sizes. However "enable auto mirroring for RTL layout" option doesn't work in android versions below 6.0! Is there any additional setting to use it in other android versions? My Test Project uses a simple method to changing the Locale of my application. These are results of my test: Nexus 6P

How to animate a VectorDrawable in a fluid-like manner?

☆樱花仙子☆ 提交于 2019-12-10 04:22:58
问题 Background Suppose I have a VectorDrawable that look like a top->down arrow: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24.0" android:viewportHeight="24.0"> <path android:pathData="M20,12l-1.41,-1.41L13,16.17V4h-2v12.17l-5.58,-5.59L4,12l8,8 8,-8z" android:fillColor="#010101"/> </vector> I want to show an animation of it that looks like a fluid that it poured, so that first nothing is shown, then the top

Vector Drawable Render Issue on Lollipop Devices (API22)

大城市里の小女人 提交于 2019-12-09 14:02:05
问题 Good day, I am having an issues with with SVG files being converted into Vectors to use on Android device. I am using this platform to convert SVG->VectorDrawable This is far the most and the best tool which converts just amazingly, other's convertions are horrible. I want to achieve above Image The actual result on Lollipop device as you can see the letter N is curved that is an issue! Here you can notice again some issues with the rendering of the button's texts (Texts are attached to the