android-vectordrawable

Google Play: You need to check the icon inside your APK because it is not valid

匆匆过客 提交于 2019-12-05 03:22:13
I'm getting the following error when uploading an APK file in Google Play Developer Console: Upload failed You need to check the icon inside your APK because it is not valid. All answers on SO I've found seem to suggest that you have to convert Vector Drawable icons to PNGs to get rid of this error. Why is that necessary? Isn't it the whole point of Vector Drawables to avoid generating PNGs manually? Edit: Converting my app icon to PNG actually did help. But I still can't understand why is this necessary. Isn't Android Studio supposed to generate PNGs at build time? Louis CAD The Developer

Add animation at run time

戏子无情 提交于 2019-12-05 01:02:05
I want to animate my AnimatedVectorDrawable at runtime without using .xml files. Actually I'm using .xml files same way as documentation's samples shows: AnimatedVectorDrawable So, I have vector_drawable.xml contains <vector> with nested <group> and <path> which defines a shape. For this vector I have animated_vector_drawable.xml contains <animated-vector> with android:animation assinged to <target> . Last step is define an animation file rotation.xml using <objectAnimator> which is used by animated_vector_drawable.xml Everything works fine, but the problem appears, when I need to create many

AndroidStudio import SVG with ERROR@ <mask> is not supported

本秂侑毒 提交于 2019-12-04 23:02:54
I got message "ERROR@ <mask> is not supported" when try to import SVG using Android Studio 3.0.1 Build #AI-171.4443003, built on November 10, 2017 JRE: 1.8.0_152-release-915-b08 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Mac OS X 10.12.6 Anyway to import SVG and make them show correctly? Solution 1 Flattern image in Sketch and use this site to convert SVG to xml for Android Solution 2 I use nonZero instead of evenOdd and open it in Sketch to reverse Order after reverse it will change pathData and remove android:fillType and everything work fine on Android 21+. Solution 3 PNG TLDR

Blurry Image on API 21+ : AppCompat v23.2.0 using VectorDrawables with srcCompat

与世无争的帅哥 提交于 2019-12-04 10:25:55
I have an image display issue on API 21+, but everything works fine on lower devices and API 22+. I'm using Gradle Plugin 1.5, so my build.gradle look like this: // Gradle Plugin 1.5 android { defaultConfig { generatedDensities = [] } // This is handled for you by the 2.0+ Gradle Plugin aaptOptions { additionalParameters "--no-version-vectors" } } Image View in XML: <ImageView android:id="@+id/landing_img_slide" android:layout_width="225dp" android:layout_height="225dp" android:layout_centerHorizontal="true" android:scaleType="centerCrop" /> Java Code : ImageView iconView = (ImageView)

Using Vector Drawable Compat

风格不统一 提交于 2019-12-04 07:56:29
问题 I am making an android app with a few fragments. In one of these fragments, I have a toolbar with a back arrow as an image button. In the XML File, I have the "app:srcCompat" attribute, but I get an error when using this attribute saying this: "To use VectorDrawableCompat, you need to set 'android.defaultConfig.vectorDrawables.useSupportLibrary = true' 回答1: In your module build.gradle file, you need to add this line: apply plugin: 'com.android.application' android { ... defaultConfig { ...

Reversing the morphing animation from arrow to checkmark

拈花ヽ惹草 提交于 2019-12-04 07:48:07
问题 I am trying to achieve the morphing effect, when the user clicks myButton, the image inside the ImageView should morph from arrow to checkmark. And when he clicks it again, the process should reverse: the checkmark should morph to arrow. This is what I have done: animated_vector.xml: <?xml version="1.0" encoding="utf-8"?> <animated-vector xmlns:android="http://schemas.android.com/apk/res/android" android:drawable="@drawable/vector_upvote"> <target android:name="rotationGroup" android

How to fit VectorDrawable to ImageView and remove unnecessary paddings

这一生的挚爱 提交于 2019-12-04 05:12:06
问题 For my Android app I've created such layer list from two vector Drawable. The xml-code I want to put this image into ImageView, but I have a problem with paddings which I can't remove (marked in red). To solve this issue I've already applied follow steps: Explicitly set paddings to 0 value Set "AdjustViewBound" to true Played with "fitType" attributes. None of this hadn't been worked for me. Please help me to resolve this problem. 回答1: You should get a whole drawable with the circle and

VectorDrawable rendering issue

匆匆过客 提交于 2019-12-04 01:02:39
I'm having problems with the VectorDrawables introduced by the support library. Looking around, I read about similar issues regarding bad scaling or incorrect preview in Android Studio. Well, my problem is unluckily different. PROBLEM: In fact, my VectorDrawable renders perfectly in the Android Studio preview but gets messed up at runtime on device (Android v. 5.1.1 and 6.0). EXPORTING: Starting from an SVG file (with only one compounded path), I imported it with the Android Studio tool (but I also tried many other tools to convert it). The file was made in the same way as a bunch of others,

VectorDrawable causes NumberFormatException

牧云@^-^@ 提交于 2019-12-03 15:57:50
I'm using the quite new and cool vector drawables of Android Lollipop. But with some SVG files I get always a NumberFormatException on runtime when that drawable is used. Here is my stacktrace: android.view.InflateException: Binary XML file line #60: Error inflating class android.widget.ImageButton at android.view.LayoutInflater.createView(LayoutInflater.java:633) at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) at android.view.LayoutInflater.createViewFromTag(LayoutInflater

Android how to resize (scale) an xml vector icon programmatically

白昼怎懂夜的黑 提交于 2019-12-03 14:55:15
This is driving me crazy. I would like to be able to resize an xml vector drawable icon programmatically in order to use it in an ImageView. This is what I've done so far which is not working Drawable drawable = ResourcesCompat.getDrawable(getResources(),R.drawable.ic_marker,null); drawable.setBounds(0,0,512,512); imageVenue.setImageDrawable(drawable); The vector icon ic_marker is not resized. It just keeps the hardcoded width and height values every time. Any ideas? You can change the width and height of your imageview programmatically. Since vector drawables will preserve the original