android-vectordrawable

Stop working project with vector drawables after update build.gradle on API < 21

三世轮回 提交于 2019-12-30 18:00:28
问题 I have working project. minSdkVersion 17 com.android.tools.build:gradle:2.3.3 gradle 4.1 Android Studio 3 Canary 6 I have in my gradle files: defaultConfig { vectorDrawables.useSupportLibrary = true vectorDrawables.generatedDensities = [] } I call in activity too: AppCompatDelegate.setCompatVectorFromResourcesEnabled(true) Application works perfectly. Now change to: com.android.tools.build:gradle:3.0.0-alpha6 add to repositories google() line Execute gradle clean assembleDebug . App continue

VectorDrawable renders differently in phone than in Android Studio

最后都变了- 提交于 2019-12-25 12:59:26
问题 I have some stylized text that I have converted into SVG paths for use in a VectorDrawable . I directly extracted the path data as a string of text from the .svg file to use as the path data in the VectorDrawable . They look perfectly fine in the Android Studio design window but when I run it on my phone it looks messed up. My phone is a HTC One M8 and is running stock Marshmallow. I have attached two screen shots of how they differ. pathData rendered in Android Studio: vs. pathData rendered

DexGuard and Vector Drawables

∥☆過路亽.° 提交于 2019-12-24 05:44:09
问题 I am using DexGuard to compile my app. My app uses vector drawables. I have all the settings correct, and it works correctly, both in the debug version, and when I use Proguard for the release version. It only crashes in the release version when using DexGuard. So I know it's a DexGuard issue. I am using DexGuard v7.0 and I cannot update due to license restrictions. I have added -keepresourcefiles "res/drawable/**" -keep class android.support.v7.** { *; } to my dexguard file for testing

Android: How to load a vector drawable image into a webview?

不想你离开。 提交于 2019-12-24 00:08:15
问题 Sorry if this is a repeat but I searched diligently and didn't find this question asked yet... So back in ye olden days of Android, you could just add something like this to a WebView's source html: <img src='file:///android_res/drawable/my.png'/> And it would display my.png correctly in the WebView. But-- Android now supports (and prefers we use) these new-fangled vector drawables, and Android Studio's Vector Asset Studio makes it really easy to import them from SVG files or whatever. The

Crash during inflating view with vector drawable tint color selector

落爺英雄遲暮 提交于 2019-12-23 16:44:48
问题 I want to use vector drawable with tint color selector <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/gray_ef" android:state_enabled="false"/> <item android:color="@color/gray_ef" android:state_pressed="true"/> <item android:color="@color/app_main_blue"/> </selector> declaration in style: <style name="SocialButton"> <item name="android:layout_width">0dp</item> <item name="android:layout_height">wrap

Difference between SVG and VectorDrawable in Android

岁酱吖の 提交于 2019-12-23 12:03:31
问题 While Android supports SVG, why should it be converted to VectorDrawable? This code example shows SVG in Android: SVG svg = SVGParser.getSVGFromResource(getResources(), R.raw.android); imageView.setImageDrawable(svg.createPictureDrawable()); 回答1: The SVGParser functionality you mention is a third party implementation of SVG support for Android. The major problems with using SVG in Android are: SVG files may be very complex and can be very slow to render All the third party implementations I

How to define click event separately for each path element

≯℡__Kan透↙ 提交于 2019-12-23 10:21:16
问题 I am working with SVG files on Android. Android Studio converts SVG files into XML files containing vector and path elements. An XML file can have multiple "path" elements. The problem starts right here. I want to give each path element the ability to be individually clicked without using webview. (Cause of javascript is risky !) Is there a way to do that? I cant use clicked pixels colors. Cause they are very variable. I can seperate each path elements to different XML files. But this paths

VectorDrawable is scaled and unsharp

余生长醉 提交于 2019-12-23 02:32:17
问题 Vector xml in Android Studio: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0"> <path android:fillColor="#FF000000" android:pathData="M12,15C7.58,15 4,16.79 4,19V21H20V19C20,16.79 16.42,15 12,15M8,9A4,4 0,0 0,12 13A4,4 0,0 0,16 9M11.5,2C11.2,2 11,2.21 11,2.5V5.5H10V3C10,3 7.75,3.86 7.75,6.75C7.75,6.75 7,6.89 7,8H17C16.95,6.89 16.25,6.75 16.25,6.75C16.25,3.86 14,3 14,3V5

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

纵然是瞬间 提交于 2019-12-22 04:20:54
问题 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

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

耗尽温柔 提交于 2019-12-21 19:40:07
问题 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