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

Wrong background color output (demo app) #8

Open
ghost opened this issue Apr 9, 2016 · 1 comment
Open

Wrong background color output (demo app) #8

ghost opened this issue Apr 9, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 9, 2016

Thanks for this awesome library!

I'm having some issues with the background color transition in the demo app.
To make this bug visible change the page colors in the demo app to this:

<color name="page1">#ff0000</color>
<color name="page2">#ffffff</color>
<color name="page3">#000000</color>
<color name="page4">#0000FF</color>

The expected output is that page 1 is red, page 2 white, page 3 black, page 4 blue.
Actual output:
Welcome coordinator color bug

I think this bug is due to float to int conversion.
I've tried to change this (here):

int maximumScroll = getMeasuredWidth() * numOfPages;

to this:

float maximumScroll = getMeasuredWidth() * numOfPages;

but that doesn't work.

Also why are the parameters in onScrollPage are not like the ViewPager.OnPageChangeListener parameters?

So from this:

public void onScrollPage(View v, float progress, float maximum)

to this:

public void onScrollPage(View v, int position, float positionOffset, int positionOffsetPixels)
@ghost
Copy link
Author

ghost commented Jun 24, 2016

For those who are still looking for a fix:
https://gist.github.com/GerritHoekstra/41b6a5b55f983c6db8985ad62fcc3929

I'm going to close this issue if it's fixed in the demo, for now I'll leave it open.

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

0 participants