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

Is there no getValue? (also: numbers after decimal point AND indicator corner radius) #41

Closed
sicksugar opened this issue Jun 8, 2018 · 6 comments
Labels

Comments

@sicksugar
Copy link

I only found setValue but no getValue.
There's getMinProgress and getMaxProgress, but in a slider of 0-10 they will only return 0 and 10.
The most basic functionality of a slider is to be able to give me the value the user chose.
What am i missing?

I had to set a listener and take the min value from it, and put it into a variable.
But this means that this variable changes all the time when the user slides the slider.
I just want to take the final/current value and use it for something.

Two other smaller issues:

  1. I can set the seekbar to display a specific number format (for example 0.1 instead of 0.12345), but the actual value remains 0.12345 when i try to use the seekbar value elsewhere. is there a way to control the output or the intervals?
  2. I see on the first demo gif, the 3rd indicator has a corner radius, but i could not find a way to set this in the XML or in the JAVA. Is there a way?
@JinJieGu
Copy link
Member

JinJieGu commented Jul 9, 2018

guys,you must be not read wiki seriously. You can find answer in the wiki.

  1. how to get current value
rangeSeekBar.setOnRangeChangedListener(new OnRangeChangedListener() {
            @Override
            public void onRangeChanged(RangeSeekBar view, float min, float max, boolean isFromUser) {
           //min is left seekbar value, max is right seekbar value
            }
            ...
        });

2.how to set radius
you can use rangeSeekBar.setProgressRadius()andapp:rsb_progress_radius="0.8dp"to set the corner radius.

@sonshark
Copy link

sonshark commented Aug 17, 2018

I think, You should add "getMinValue", "getMaxValue", it's very helful. BTW, thanks for your support
rangeSeekBar.setValue(0, 3000000);
rangeSeekBar.setIndicatorTextDecimalFormat("0");
rangeSeekBar.setOnRangeChangedListener(new OnRangeChangedListener() {
@OverRide
public void onRangeChanged(RangeSeekBar view, float leftValue, float rightValue, boolean isFromUser) {

                minPrice = leftValue ;
                maxPrice = rightValue ;
    

        }

        @Override
        public void onStartTrackingTouch(RangeSeekBar view, boolean isLeft) {
            //do what you want!!
        }

        @Override
        public void onStopTrackingTouch(RangeSeekBar view, boolean isLeft) {
            //do what you want!!
        }
    });

@hamzaahmedkhan
Copy link

You should add getValue(), its really necessary. Like I want to calculate BMI on a Button action and wants to getValue from seekbar.

@fineemb
Copy link

fineemb commented Oct 23, 2018

除了在Listener里面获取最大最小值之外,不能直接在外部使用getMinValue, getMaxValue,或者是getValue吗?
希望可以增加,这个还是比较有用的

@Elank0521
Copy link

I think should add "getMinValue()" and "getMaxValue()", I want to use them, but they don't exist. Thanks.

@bahmanworld
Copy link

Thanks for great library:
but I really need getMinValue() and getMaxValue() !

@JinJieGu JinJieGu closed this as completed Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants