android-vectordrawable

How can I use vectorDrawable as icon for push notifications using Android Support Library 23.2? setSmallIcon gives error

与世无争的帅哥 提交于 2020-01-21 12:15:15
问题 My app is under API < v21, so I use Android Support Library 23.2 for managing my vectorDrawables. android { defaultConfig { vectorDrawables.useSupportLibrary = true } } All views works ok exept icon for push notification: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setColor(getResources().getColor(R.color.colorAccent)) .setSmallIcon(R.drawable.ic_play_arrow_white_24dp) //ERROR .setContentTitle(getString(R.string.app_name)) .setContentText(getString(R.string

How can I use vectorDrawable as icon for push notifications using Android Support Library 23.2? setSmallIcon gives error

戏子无情 提交于 2020-01-21 12:15:07
问题 My app is under API < v21, so I use Android Support Library 23.2 for managing my vectorDrawables. android { defaultConfig { vectorDrawables.useSupportLibrary = true } } All views works ok exept icon for push notification: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setColor(getResources().getColor(R.color.colorAccent)) .setSmallIcon(R.drawable.ic_play_arrow_white_24dp) //ERROR .setContentTitle(getString(R.string.app_name)) .setContentText(getString(R.string

Why android:tint=“” produce a bad resolution Image?

ε祈祈猫儿з 提交于 2020-01-16 07:31:07
问题 I'm using vector's in my app with the common way: app:srcCompat="@drawable/ic_camera" . When I use the vector without android:tint="" attribute the image appear in a good condition and resolution: But when I add the android:tint="" attribute the image appear in bad condition and resolution: What I missing here? 来源: https://stackoverflow.com/questions/49931174/why-androidtint-produce-a-bad-resolution-image

Dashes stroke-dasharray in Android Vector

落爺英雄遲暮 提交于 2020-01-14 14:55:13
问题 How to add dashed line on Android Vector Drawable? It seems "stroke-dasharray" from svg is not supported in Android Vector. Is any other way to do it? My drawable that I want to make dashed: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="61dp" android:height="160dp" android:viewportWidth="61.0" android:viewportHeight="160.0"> <path android:pathData="M2,159C6,81.5 38,21 57,4" android:strokeColor="#FFCF4D" android:fillColor="#00000000" android.stroke-dasharray

How to use svgs in selector for pre lollipop version?

亡梦爱人 提交于 2020-01-07 02:29:10
问题 I used selector for checkbox it works, but it causes problems for pre lollipop version <selector xmlns:android="..."> <item android:state_checked="true" android:drawable="@drawable/checked_icon" /> <item android:drawable="@drawable/icon" /> </selector> <CheckBox android:button="@drawable/terms_checkbox"/> it causes resourcNotFoundexception, How to solve the problem, is there any solution? FATAL EXCEPTION: main android.view.InflateException: Binary XML file line #70: Error inflating class

Android using vector drawable for image in customview with android < 5

烂漫一生 提交于 2020-01-02 10:27:07
问题 I have a CustomView class with a TextView and a ImageView like public class CustomView extends LinearLayout { private ImageView imgImage; ... public CustomView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(attrs); } private void init(AttributeSet attrs) { LayoutInflater.from(getContext()).inflate(R.layout.custom_layout, this, true); imgImage = (ImageView) findViewById(R.id.image); TypedArray ta = getContext()

Android circle checkmark animation

僤鯓⒐⒋嵵緔 提交于 2020-01-02 08:26:10
问题 I'm trying to achieve something similar to the BEMAnimationTypeStroke which can be found in the iOS library BEMCheckBox. I've tried using an animated vector drawable to achieve this, but I do not know how to animate the checkmark inside the circle from an 0 start point to the final position. (the circle can be static, I'm looking to animate the check mark). This is the implementation I tried for this: drawable/vector_drawable_ic_check_circle_white_48px.xml <path android:name="check" android

VectorDrawable causes NumberFormatException

喜欢而已 提交于 2020-01-01 05:37:32
问题 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

Converting SVG file to Android Vector Drawable XML while keeping the group structure in place

南笙酒味 提交于 2020-01-01 04:16:26
问题 I want to convert SVG files to Android Vector Drawable XMLs. I need the structure of the SVG. To the extend that the SVG groups multiple elements together, I need that grouping to also be reflected in the Android Vector Drawable. Unfortunately, the tools I found to do SVG to Vector Drawable conversions try to minimize the file size in a way that gets rid of existing grouping in the structure of the file. Is there a smart way to do the conversion that leaves the grouping tree intact? 回答1: Have

Given byte-array of VectorDrawable, how can I create an instance of VectorDrawable from it?

被刻印的时光 ゝ 提交于 2019-12-31 05:13:09
问题 Background My app finds APK files in the storage of the device, showing information about them and allowing to perform operations on them. The problem Thing is, ever since Google added new restrictions about storage, I'm trying to find solutions about how to parse APK files without storage permission (because the framework can handle only file-path). For now I use the special legacy flag (requestLegacyExternalStorage) to allow me to do it with file-path, but it's a temporary solution till the