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

The default status of indicator is not correct #10

Closed
JimLyu opened this issue Nov 23, 2020 · 6 comments
Closed

The default status of indicator is not correct #10

JimLyu opened this issue Nov 23, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@JimLyu
Copy link

JimLyu commented Nov 23, 2020

Hello, I use the option like this: (Java)

    IndicatorOptions options = new IndicatorOptions();
    options.setIndicatorStyle(IndicatorStyle.CIRCLE);
    options.setSlideMode(IndicatorSlideMode.WORM); 
    options.setSliderColor(Color.CYAN, Color.BLUE);
    options.setSliderWidth(36, 36);
    indicator.setIndicatorOptions(options);

The color of first circle (default position is 0) would be Cyan (normalColor) until I slid it. And I found out that only I set IndicatorSlideMode.NORMAL, it would be the correct color. How should I do if I want to make the first circle in "checkedColor" in the beginning when the view shows?

Thank you

@zhpanvip
Copy link
Owner

zhpanvip commented Nov 23, 2020

Don't use IndicatorOptions to set the parameters for indicator, you just do like the Code on the REDMINE

indicatorView.setSliderColor(normalColor, checkedColor)
                    .setSliderWidth(resources.getDimension(R.dimen.dp_10))
                    .setSliderHeight(resources.getDimension(R.dimen.dp_5))
                    .setSlideMode(IndicatorSlideMode.WORM)
                    .setIndicatorStyle(IndicatorStyle.CIRCLE)
                    .setupWithViewPager(view_pager2)
               

@JimLyu
Copy link
Author

JimLyu commented Nov 23, 2020

Thanks for answer, but by this way, it still didn't show any activated circle in the beginning.

@zhpanvip
Copy link
Owner

It's something wrong with you code in your project? You can check it. Or you can copy the following code to your project:

val options = IndicatorOptions()
        options.indicatorStyle = IndicatorStyle.CIRCLE
        options.slideMode = IndicatorSlideMode.WORM
        options.setSliderColor(Color.CYAN, Color.BLUE)
        options.setSliderWidth(36f, 36f)
        indicatorView.setIndicatorOptions(options)
        indicatorView.setupWithViewPager(view_pager2)

I have test this code,It works well.

@JimLyu
Copy link
Author

JimLyu commented Nov 23, 2020

Thanks a lot!
I finally succeeded while I changed the "ViewPager" to "ViewPager2" and made the adapter it required.

@zhpanvip
Copy link
Owner

So weird,I also test with ViewPager,It's nothing problem.

@zhpanvip
Copy link
Owner

Oh! I'm so sorry,I think this is a bug in version 1.0.6,and it was coincidentally fixed by recently commits,but The latest code has not been released.
I will be release a new version soon.

@zhpanvip zhpanvip added the bug Something isn't working label Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants