AppCompat 23.3 Support Vectors no longer work?

Update: They enable it again in Support Library 23: For AppCompat users, we’ve added an opt-in API to re-enable support Vector Drawables from resources (the behavior found in 23.2) via AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); – keep in mind that this still can cause issues with memory usage and problems updating Configuration instances, hence why it is disabled by … Read more

How to change color of vector drawable path on button click

The color of the whole vector can be changed using setTint. You have to set up your ImageView in your layout file as this: <ImageView android:id=”@+id/myImageView” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:tint=”@color/my_nice_color” android:src=”https://stackoverflow.com/questions/35625099/@drawable/ic_my_drawable” android:scaleType=”fitCenter” /> Then to change the color of your image: DrawableCompat.setTint(myImageView.getDrawable(), ContextCompat.getColor(context, R.color.another_nice_color)); Note: myImageView.getDrawable() gives nullpointerexception if the vector drawable is set to the … Read more

Is it possible to use VectorDrawable in Buttons and TextViews using android:DrawableRight?

it possible to use drawableRight etc for SVG assets ? Yes AppCompatTextView now supports app:drawableLeftCompat, app:drawableTopCompat, app:drawableRightCompat, app:drawableBottomCompat, app:drawableStartCompat and app:drawableEndCompat compound drawables, supporting backported drawable types such as VectorDrawableCompat. Include this in your gradle file implementation ‘androidx.appcompat:appcompat:1.1.0-alpha01’ In your text view you can use app:drawableLeftCompat app:drawableStartCompat If you have problems while using app:drawableLeftCompat, app:drawableStartCompat … Read more

Support library VectorDrawable Resources$NotFoundException

It took 3 separate things for me to get this to work using support library 23.4.0: Add this to build.gradle defaultConfig { vectorDrawables.useSupportLibrary = true } Add the following to onCreate of your Application class AppCompatDelegate.setCompatVectorFromResourcesEnabled(true); (From the reference of this link – “https://stackoverflow.com/a/45582033/10752962“) In API less then 21,use this line before setContentView(); For all … Read more

Change fill color on vector asset in Android Studio

Don’t edit the vector assets directly. If you’re using a vector drawable in an ImageButton, just choose your color in android:tint. <ImageButton android:layout_width=”48dp” android:layout_height=”48dp” android:id=”@+id/button” android:src=”https://stackoverflow.com/questions/32924986/@drawable/ic_more_vert_24dp” android:tint=”@color/primary” />

How to properly use backwards compatible Vector Drawable with the latest Android Support Library?

Add the latest support lib to your app’s build.gradle dependencies: compile ‘com.android.support:appcompat-v7:26.0.2′ and add the following line in the same file: android { … defaultConfig { … vectorDrawables.useSupportLibrary = true } … } Import vector image through Vector Asset Studio. That’s all, you are ready to go! ImageView XML Use app:srcCompat attribute instead of android:src: … Read more

VectorDrawable – is it available somehow for pre-Lollipop versions of Android? [closed]

UPDATE ON March 2016 By Android Support Library 23.2.1 update, Support Vector Drawables and Animated Vector Drawables. (you can also use latestone for the same) Please update version of a library in gradle file. compile ‘com.android.support:recyclerview-v7:23.2.1’ Vector drawables allow you to replace multiple png assets with a single vector graphic, defined in XML. While previously … Read more