[Deprecated] AKA VectorDrawableCompat: A 7+ backport of VectorDrawable

Related tags

Utility MrVector
Overview

###@Deprecated Unfortunatenly this library is no longer maintained, we encourage you to use first party VectorDrawableCompat coming soon to support library.

Mr. Vector

Mr. Vector

AKA VectorDrawableCompat: A 7+ backport of VectorDrawable.

Demo

Le demo

Mr. Vector Demo on Google Play Store

Usage

See demo, at this point latest version looks like

compile 'com.telly:mrvector:0.2.0'

Basic inflate

Drawable drawable = MrVector.inflate(getResources(), R.drawable.vector_android);

Unfortunately due some inflate weirdness (able to read some correctly but not others) for now (will fix promise) you'll have to duplicate (sucks I know) all your android: attributes, in example:

Note: you must put auto attributes before android attributes (See #5)

Furthermore: you can use online convertor svg to VectorDrawable + MrVector scheme support

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:auto="http://schemas.android.com/apk/res-auto"
        tools:targetApi="21"

        auto:width="@dimen/simple_vector_width"
        auto:height="@dimen/simple_vector_height"
        auto:viewportWidth="@integer/simple_vector_viewport_width"
        auto:viewportHeight="@integer/simple_vector_viewport_height"

        android:width="@dimen/simple_vector_width"
        android:height="@dimen/simple_vector_height"
        android:viewportWidth="@integer/simple_vector_viewport_width"
        android:viewportHeight="@integer/simple_vector_viewport_height"
    >

  <path
      auto:strokeColor="@color/simple_vector_stroke_color"
      auto:strokeWidth="@integer/simple_vector_stroke_width"
      auto:pathData="@string/simple_vector_path_data"

      android:strokeColor="@color/simple_vector_stroke_color"
      android:strokeWidth="@integer/simple_vector_stroke_width"
      android:pathData="@string/simple_vector_path_data"
      />
</vector>

Inflate from Layout (WIP)

Use it as a regular drawable:

<!-- menu.xml -->
<!-- ... -->
   android:icon="@drawable/vector_drawable"
<!-- ... -->
<!-- layout.xml -->
<!-- ... -->
   android:src="@drawable/vector_drawable"
<!-- ... -->

And then from your Application or Activity:

\\ ...
  {{
    MrVector.register(
      R.drawable.vector_drawable,
      R.drawable.another_vector_drawable,
      \\ ...
    );
  }}
\\ ...
  @Override
  protected void attachBaseContext(Context newBase) {
    super.attachBaseContext(MrVector.wrap(newBase));
  }
\\ ...

Roadmap

Right now only basic inflating works, this is the list of features planed:

  • Put this in GH issues.
  • Full inflate from layout support (partially implemented except for TypedArray calling directly loadDrawable, which sadly is key)
  • Get rid of auto namespace, use android namespace as much as possible (no duplicated attributes).
  • Tint support.
  • Animation support (AnimatedVectorDrawable).

On the long run, it would be nice to see (but no promises):

  • Per node animation.
  • Additional SVG support (e.g. using svg-android or svgandroid).
  • SVG animation support.

###Applications using Mr.Vector:

WatchMe

License & About

See LICENSE file, logo built from opoloo/androidicons.

From @eveliotc @ Telly

You might also like...
A backport of the SwitchPreference component that was introduced on Android 4 (ICS / level 14). This port works on Android 2.1+ (Eclair MR1 / level 7).

Android Switch Preference Backport A backport of the SwitchPreference component that was introduced on Android 4 (ICS / level 14). This port works on

Backport of Material dialogs with easy-to-use API based on DialogFragment
Backport of Material dialogs with easy-to-use API based on DialogFragment

StyledDialogs for Android Demo app: Features: Compatible with Material Design Guidelines Same look for Android 2.2+ Built on top of standard DialogFra

A backport of the Android 4.2 GlowPadView that works on the SDK on API levels 4+

GlowPadBackport A backport of the Android 4.2 GlowPadView that works on the SDK on API levels 4+. It is heavily based upon Google's own internal imple

Minecraft 1.18.2 Backport of Petal, a performance-oriented fork of Purpur intended to increase performance for entity-heavy servers by implementing multi-threaded and asynchronous improvements.

Sakura Performance Minecraft JAR Sakura is a performance-oriented fork of Purpur intended to increase performance for entity-heavy servers by implemen

Provides a set of views which allows to adjust the spacing between the characters of that view, AKA, Kerning effect.
Provides a set of views which allows to adjust the spacing between the characters of that view, AKA, Kerning effect.

KerningViews KerningViews provides a set of views (currently only TextView and Button) which lets you adjust the spacing between the characters in the

General purpose utilities and hash functions for Android and Java (aka java-common)

Essentials Essentials are a collection of general-purpose classes we found useful in many occasions. Beats standard Java API performance, e.g. LongHas

General purpose utilities and hash functions for Android and Java (aka java-common)

Essentials Essentials are a collection of general-purpose classes we found useful in many occasions. Beats standard Java API performance, e.g. LongHas

Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing functionality and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.), inspired by Badoos RIBs fork of the Uber RIBs framework
Kotlin Multiplatform lifecycle-aware business logic components (aka BLoCs) with routing functionality and pluggable UI (Jetpack Compose, SwiftUI, JS React, etc.), inspired by Badoos RIBs fork of the Uber RIBs framework

Decompose Please see the project website for documentation and APIs. Decompose is a Kotlin Multiplatform library for breaking down your code into life

 KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP)
KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP)

KaMP Kit Welcome to the KaMP Kit! About Goal The goal of the KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP). It is a coll

btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Systrace
btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Systrace

btrace README 中文版 btrace(AKA RheaTrace) is a high performance Android trace tool

Android + Kotlin Project for the 2022 edition of the Open Source Contribution competition, JGEC Winter of Code aka JWoC.

QuotesApp-JWoC Android + Kotlin Project for the 2022 edition of the Open Source Contribution competition, JGEC Winter of Code aka JWoC. 🎯 Project Obj

Now deprecated. A small Android library allowing you to have a smooth and customizable horizontal indeterminate ProgressBar
Now deprecated. A small Android library allowing you to have a smooth and customizable horizontal indeterminate ProgressBar

Description Small library allowing you to make a smooth indeterminate progress bar. You can either user your progress bars and set this drawable or us

[Deprecated] This project can make it easy to theme and custom Android's dialog. Also provides Holo and Material themes for old devices.
[Deprecated] This project can make it easy to theme and custom Android's dialog. Also provides Holo and Material themes for old devices.

Deprecated Please use android.support.v7.app.AlertDialog of support-v7. AlertDialogPro Why AlertDialogPro? Theming Android's AlertDialog is not an eas

Deprecated in favour of https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html

Deprecated: use https://developer.android.com/reference/android/support/v4/view/animation/PathInterpolatorCompat.html instead. android-cubic-bezier-in

HockeyApp was retired and the SDKs are deprecated. Please use App Center instead.

Version 5.2.0 HockeySDK-Android implements support for using HockeyApp in your Android applications. The following features are currently supported: C

[Deprecated] Little bites of Material Design

Working with shared elements Commit - 8872619 Working with shared elements, explode transition, and animations Commit - 901d62c Playing with the new m

Samples in Material Animation (Deprecated)
Samples in Material Animation (Deprecated)

Material-Animation-Samples (Deprecated) or watch it on youtube #Samples: Samples in material animation will be added through the next two monthes. Lay

Replacement for deprecated official Android crop image function

The MIT License (MIT) Copyright (c) 2012 Jan Muller Permission is hereby granted, free of charge, to any person obtaining a copy of this software and

(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.
(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.

BottomBar (Deprecated) I don't have time to maintain this anymore. I basically wrote the whole library in a rush, without tests, while being a serious

General purpose utilities and hash functions for Android and Java (aka java-common)

Essentials Essentials are a collection of general-purpose classes we found useful in many occasions. Beats standard Java API performance, e.g. LongHas

Markus Junginger 1.4k Dec 29, 2022
General purpose utilities and hash functions for Android and Java (aka java-common)

Essentials Essentials are a collection of general-purpose classes we found useful in many occasions. Beats standard Java API performance, e.g. LongHas

Markus Junginger 1.4k Dec 29, 2022
[Deprecated] Sexy way to execute async/background tasks on Android

Groundy library for Android @Deprecated Unfortunatenly this library is no longer maintained, we encourage you to use other widely supported solutions

Telly 228 Nov 14, 2022
SVG to Android VectorDrawable XML resource file

svg2android [Deprecated - use official Vector Asset Studio directly from Android Studio] Convert SVG to Android VectorDrawable XML resource file. Extr

INLOOPX 1.7k Dec 29, 2022
A support library for VectorDrawable and AnimatedVectorDrawable classes introduced in Lollipop

vector-compat A support library for VectorDrawable and AnimatedVectorDrawable introduced in Lollipop with fully backwards compatible tint support (api

Wael N 1.2k Nov 29, 2022
SVG to Android VectorDrawable XML resource file

svg2android [Deprecated - use official Vector Asset Studio directly from Android Studio] Convert SVG to Android VectorDrawable XML resource file. Extr

INLOOPX 1.7k Dec 29, 2022
An adaptation of the JSR-310 backport for Android.

ThreeTen Android Backport An adaptation of the JSR-310 backport for Android. Attention: Development on this library is winding down. Please consider s

Jake Wharton 3.5k Dec 11, 2022
A backport of the new Transitions API for Android

TransitionsBackport Android library for using the Transitions API released with Android KitKat on older versions of Android. At the moment, it is comp

Stéphane Guérin 578 Dec 29, 2022
Backport of Material dialogs with easy-to-use API based on DialogFragment

StyledDialogs for Android Demo app: Features: Compatible with Material Design Guidelines Same look for Android 2.2+ Built on top of standard DialogFra

Avast 2.2k Dec 29, 2022