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

CrystalRangeSeekbar min/max and current values #150

Open
gaminn opened this issue Mar 10, 2020 · 1 comment
Open

CrystalRangeSeekbar min/max and current values #150

gaminn opened this issue Mar 10, 2020 · 1 comment

Comments

@gaminn
Copy link

gaminn commented Mar 10, 2020

I tried this sample code:

<com.crystal.crystalrangeseekbar.widgets.CrystalRangeSeekbar
    android:id="@+id/rangeSeekbar3"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:corner_radius="10"
    app:min_value="50"
    app:max_value="100"
    app:gap="20"
    app:bar_color="#8990C4"
    app:bar_highlight_color="#2434AD"
    app:left_thumb_color="#1A246D"
    app:right_thumb_color="#1A246D"
    app:left_thumb_color_pressed="#030B47"
    app:right_thumb_color_pressed="#030B47"
    app:data_type="_integer"/>

As shown on the initial page of this repo this should display blue range seekbar with current values displayed on the sides. However, in my app, it doesn't display current values.

How to show current values near the seekbar? Or preferably moving labels under the thumb (I know I can implement moving text myself using onRangeSeekbarChangeListener but imagine a situation where the seekbar min and max are 0 - 10 with granularity of 1 and the seekbar is 500 px wide - the moving labels would jump, they won't move smoothly)?

How to show min and max values of the seekbar near the seekbar?

@mohamedtourab
Copy link

The text that appears in the example are TextViews that are added manually, then you can override the setOnRangeSeekbarChangeListener and change the values of the textviews .
This is from the examples provided in the readme

rangeSeekbar.setOnRangeSeekbarChangeListener(new OnRangeSeekbarChangeListener() {
    @Override
    public void valueChanged(Number minValue, Number maxValue) {
        tvMin.setText(String.valueOf(minValue));
        tvMax.setText(String.valueOf(maxValue));
    }
});

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