harjot-oberai / VectorMaster

Dynamic control over vector drawables!
MIT License
1.59k stars 161 forks source link

API 16 not visible VectorMasterView, VectorMasterDrawable #10

Open edgelv34 opened 6 years ago

edgelv34 commented 6 years ago

hello. your VectorMaster is very good. but It is not visible in API 16.

first of all, Successfully registered VectorMasterView on XML. Then, animation was made in Java source using PathModel.

However, when the app was running, no images were visible.

So i registered ImageView to the XML and did setImageDrawable to ImageView as VectorMasterDrawable from java source.

but not visible too.

Let me show you my XML and Java source parts.

[xml]

<ImageView
            android:id="@+id/header_menu"
            android:layout_width="30dp"
            android:layout_height="24dp"
            android:layout_centerVertical="true"/>

[java]

headerMenuView = (ImageView) activity.findViewById(R.id.header_menu);
headerMenuVMView = new VectorMasterDrawable(mContext, R.drawable.ic_menu);
headerMenuView.setImageDrawable(headerMenuVMView);

VectorMasterDrawable menuView = headerMenuVMView;
final GroupModel menuGroupModel = menuView.getGroupModelByName("menu_group");
final PathModel menuPathModel1 = menuView.getPathModelByName("menu1");

menuGroupModel.setRotation(MathUtil.lerp(0, (float) 360, offset));
menuPathModel1.setTrimPathEnd(1 - offset);

why not show image?


You can check VectorMaster Demos when operating the API 16.

SrikalyanBurra commented 6 years ago

I am facing the same problem. Any Solutions?

SrikalyanBurra commented 6 years ago

Actually the issue was that android:layout_width and layout_height cannot have wrap_content as arguments. At least that was the issue for me in this case. After I declared specific values it worked.

edgelv34 commented 6 years ago

uhm.. maybe ... I think it is available from version 17.

rubenspischedda commented 6 years ago

I have the same problem. But giving a fixed size or match_parent to the VectorMasterView did not solve it. I've tried to give a background to the View, and I can see it. It means that the view is there at runtime, but the vector is not drawn. Is there any workaround?