Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animations issues #7

Closed
manijak opened this issue Oct 31, 2016 · 10 comments
Closed

Animations issues #7

manijak opened this issue Oct 31, 2016 · 10 comments

Comments

@manijak
Copy link

manijak commented Oct 31, 2016

Great job on this indicator widget @romandanylyk. I am currently working on porting it to NativeScript as a plugin. I seem to have some issues with 2 of the animations (Scale & Worm).

If I choose "Scale", then the entire app/view becomes sluggish and laggy. And the indicator becomes all white (the entire row).

If I choose "Worm", and when I do the first slide, the first indicator expands to the left edge of the screen (like a long worm), and then snaps back. This only happens the first time, after that it works very well.

I can provide you with gifs if you want.
The other animations work perfectly, even the new one "Fill", which is great btw. 👍

@romandanylyk
Copy link
Owner

Hi, glad that you liked my library.
I probably understand which bug you are describing, I had it in java earlier, but it seems to be fixed now. Does it looks ok for you in common java code?

I believe that NativeScript is for cross platform, is that right? I didn't tested it on it, more over it wasn't designed for cross platforming. I think that it will require additional fixing after converting, so that I can't really help you with.

For fixing animations you can check if frame values are initialized well at the start, that probably why you get issues with drawing it. For the worm animation those values are: frameLeftX and frameRightX. They should firstly initialize in setFrameValues method after calling view constructor.

Hope it will help you,
thanks.

@manijak
Copy link
Author

manijak commented Nov 2, 2016

I didn't get a change to test it purely in java no. NativeScript is native-cross-platform ;) Each plugin we create can have a platform-specific part, that aims directly at android or ios libraries. So this "porting" that I'm doing is actually just a javascript-wrapper that calls the native functions, properties ect in the "PageIndicatorView" lib. https://www.nativescript.org/about

I will look more into it, and do some more testing. The hard part here is the debugging of these native libraries... These properties you mention, aren't available as public?

@romandanylyk
Copy link
Owner

romandanylyk commented Nov 2, 2016

No those are private inside a PageIndicatorView. They are responsable for drawing each frame while animation is performing. So you just need to check if they are updating correctly for those animation, that has issues.
You can probably send me some videos or gifs and we can try to figure out what's wrong.

@manijak
Copy link
Author

manijak commented Nov 3, 2016

Ok, I created two .gifs, one for each animation that I have issues with.

Scale

https://dl.dropboxusercontent.com/u/33168380/scale_animation.gif

Worm

https://dl.dropboxusercontent.com/u/33168380/worm_animation.gif

@romandanylyk
Copy link
Owner

romandanylyk commented Nov 4, 2016

Looks like I figured out what was the problem with worm animation and fixed it. I will appreciate if you will be able to check it from dev branch.
But I still can't reproduce issue that you have with scale animation. Maybe it is defect by porting library to native script. Can you please describe which parameters in scale animation do you use?

@manijak
Copy link
Author

manijak commented Nov 4, 2016

Thanks, I'll try it out.

The library is used as-is, no porting being done. NativeScript lets your write apps in JavaScript/TypeScript and XML (UI), but compiles and runs as native. Libraries used are left untouched.

Just to show you how we use native libraries, all we do is this:

var pageIndicatorView = new com.rd.PageIndicatorView(_context);
pageIndicatorView.setViewPager(_viewPager);
pageIndicatorView.setCount(_items.childrenCount);
pageIndicatorView.setAnimationType(com.rd.animation.AnimationType.SCALE);

That's it :)

@romandanylyk
Copy link
Owner

Please see update in v0.0.7

@manijak
Copy link
Author

manijak commented Nov 17, 2016

I just updated to v0.0.7 and now the entire Indicator is gone, not visible at all.
If I revert back to v0.0.6 it works again, did not touch my own code.

Any special trick in order to get v0.0.7 working?

@romandanylyk
Copy link
Owner

I have tried to use same parameters that you provided and still can't reproduce issue.
Can you please also provide layout.xml that you use?

The only reason PageIndicatorView could be invisible is that is has indicators count 0. Please make sure you set a right value.
Thanks.

@manijak
Copy link
Author

manijak commented Nov 18, 2016

I don't have a layout.xml since I'm using NativeScript...

I tried with and without setting the indicator count, still nothing. If I do a getCount() after the view is loaded, it returns the proper count (5 items). I can call all properties and methods, I get no exceptions, but still no indicator is shown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants