harjot-oberai / VectorMaster

Dynamic control over vector drawables!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different result using VectorMasterView ?

devendroid opened this issue · comments

Using ImageView (as expecting)

<ImageView
        app:srcCompat="@drawable/man_body"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

But using VectorMasterView

<com.sdsmdg.harjot.vectormaster.VectorMasterView
        app:use_legacy_parser="false"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:vector_src="@drawable/man_body" />

Why result are different with same vector image, there are any criteria for VectorMasterView ?

I commented on a previous issue as well :

For the functionalities provided by the library, I had to parse the XML manually, but all the path parsing code has been shifted to native after API 21 and hence could not be used directly in the library. Therefore the code for parsing the xml is somewhat outdated even though I tried to port some changes from native back to java.

So the drawable API in android is updated and hence draws the vector perfectly, but the path parser I use is from API 21, therefore it is not able to draw the vector properly.

You may try to set use_legacy_parser="false". Setting this parameter will make the library use a 3rd party Path Parser for parsing the xml and it may render the vector properly.

Try to set use_legacy_parser="false".

@harjot-oberai tanks to reply, I'm already using this attribute.

I don't think I can help then. Backporting the path parser code from the native implementation will be too time consuming. Still I will try to look at the updated native code.

Thanks @harjot-oberai , However I was just need to change any specific path of my Vector Drawable,
that i can do now using VectorChildFinder .

Nice work on that library. Closing the issue now

Cheers !