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

setOnRangeSeekbarChangeListener gives wrong Max Value #157

Open
gmacdev opened this issue Dec 31, 2020 · 2 comments
Open

setOnRangeSeekbarChangeListener gives wrong Max Value #157

gmacdev opened this issue Dec 31, 2020 · 2 comments

Comments

@gmacdev
Copy link

gmacdev commented Dec 31, 2020

Hey, I'm using the range seekbar and I've set the value as shown below:

XML:

<com.crystal.crystalrangeseekbar.widgets.CrystalRangeSeekbar
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
                    android:layout_marginTop="16dp"
                    android:layout_marginEnd="16dp"
                    android:layout_marginBottom="6dp"
                    app:bar_color="@color/grey"
                    app:bar_highlight_color="@color/white"
                    app:corner_radius="20"
                    app:data_type="_integer"
                    app:left_thumb_color="@color/blue"
                    app:left_thumb_color_pressed="@color/white"
                    app:right_thumb_color="@color/blue"
                    app:right_thumb_color_pressed="@color/white" />

Code:

seek_bar
        .setMaxValue(449755406)
        .setMaxStartValue(449755406)
        .setMinValue(32)
        .setMinStartValue(32)
        .apply();

seek_bar.setOnRangeSeekbarChangeListener((minValue, maxValue) -> {
             start_text.setText(String.valueOf(minValue));
             end_text.setText(String.valueOf(maxValue));
    });

But the maxValue under setOnRangeSeekbarChangeListener is 449755392 which is wrong. It should be 449755406.

Here's the screenshot
Screenshot_20201231-072849__01

This doesn't happen for all numbers but only for some, like in this case 449755406.
Am I doing something wrong or is this a bug?

@gmacdev
Copy link
Author

gmacdev commented Dec 31, 2020

Here's a demo project.

@sandipborad
Copy link

Here's a demo project.

Perfect, it's working great. it's save my time. @gmacdev (y)

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