Git Product home page Git Product logo

crystal-range-seekbar's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crystal-range-seekbar's Issues

Change bar value programatically

How to change bar value programatically.. ?
Cant find the setValue method..
all i find just setMinValue, setMinStartValue & setMaxStartValue...

CrystalRangeSeekbar

Through setGap () method is set up, have no effect Bug and there are many

setMinStartValue and setMaxStartValue do not work properly for CrystalRangeSeekbar

I've seen this issue more than a few times, but I thought I would share my experience with it. It really doesn't seem like this methods work correctly at all, or at least the setMaxStartValue method doesn't work at all.

rsb.setMinStartValue(valOne).apply(); rsb.setMaxStartValue(valTwo).apply();

sets both cursors to min value (0, or whatever that is);

rsb.setMinStartValue(valOne).setMaxStartValue(valTwo).apply();

sets both cursors to valOne

rsb.setMaxStartValue(valTwo).setMinStartValue(valOne).apply();

sets both cursors to valOne

rsb.setMaxStartValue(valOne).setMinStartValue(valTwo).apply();

sets both cursors to valTwo

I try to set shape drawable - and ap crashed!

app:left_thumb_image="@drawable/tmp"

/drawable/tmp.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#bada55"/> <size android:width="20dp" android:height="20dp"/> </shape>

How i can set shape drawable and vector drawable to the thumb?

Bug found in: CrystalRangeSeekbar.setMinStartValue(float)

When the range is smaller than 100, it went wrong.
Here is the reson:
when update the maxStartValue in method apply(),
// set max start value
if (maxStartValue <= minStartValue || maxStartValue <= minValue) {
maxStartValue = 0;
setNormalizedMaxValue(maxStartValue);
}
else if(maxStartValue >= maxValue){
maxStartValue = maxValue;
setMaxStartValue();
}
else{
setMaxStartValue();
}

minStartValue is not the value that set before any more. so it goes to the wrong condition.

You can reproduce the issue by:

rangeSeekbar.setMinValue(2).setMaxValue(17).setMinStartValue(4).setMaxStartValue(8).apply();

Add method for set thumbs radius

Default size of thumbs is too big (comparing with native elements). But I do not found method for changing radius and forced to override CrystalRangeSeekbar:

public class PatchedCrystalRangeSeekbar extends CrystalRangeSeekbar {
    private final int mThumbsSize = 30;

    // ... override constructors

    @Override
    protected float getThumbWidth() {
        return mThumbsSize;
    }

    @Override
    protected float getThumbHeight() {
        return mThumbsSize;
    }
}

It will be great to create method or style for changing default radius.

Thumb size

Hi! Is there a way for changing the thumb size? I want it more small but layout_height dont work :/

Ty

Start Values

Hi, if I set CrystalRangeSeekbar like this:

    CrystalRangeSeekbar seekbar = new CrystalRangeSeekbar(this);
    seekbar .setDataType(CrystalRangeSeekbar.DataType.FLOAT)
            .setMinValue(5f)
            .setMaxValue(30f)
            .setSteps(0.5f)
            .setMinStartValue(18.5f)
            .setMaxStartValue(23.0f);

it gives me maxStartValue equal to minStartValue, so min and max start values are both 18.5 at the end.

set limit to left and right sides

how can I set minimum value and maximum values for the start and the end of the bar, and without being able to over do it, to be fixed, something similar to the gap, but in the start and the end

Drawable xml and bar thickness

Hello!
Thanks for great job!

Is it possible to add drawable xml for thumb and bar thickness?

With it possibility it'll my favourite range bar ;)

corner_radius is using a float format instead of dimension

Would be nice if corner_radius would take a dp value rather than a float value.
I could submit a PR for this change, but it could break backwards compatibility?
If this is something you'd want a PR for, let me know? Otherwise feel free to close this issue.
Thanks!

More control over steps?

Hi,
Is it possible to explicitly set the Steps?
I am doing an age range using your CrystalRangeSeekbar. My min is 18, max 100. I'd like the steps to be;
18, 20, 25, 30....[then in 5s]...95, 100.
Thanks a lot!

Some lag in the view while seekbar change happen

Hi,
Recently implement the crystal-range-seekbar in my project inside dialog.
Now everything work fine until we move the left or right icon in order to change the value of min and max.
During the seekbar min and max change operation the seek is not smooth and some lag while moving left or right end of the seekbar.
Providing the code snippet for seekbar config

pricerangebar.setCornerRadius(10f)
.setBarColor(Color.parseColor("#93F9B5"))
.setBarHighlightColor(Color.parseColor("#16E059"))
.setMinValue(0)
.setMaxValue(10000)
.setSteps(100)
.setLeftThumbDrawable(R.mipmap.dicrease)
.setLeftThumbHighlightDrawable(R.mipmap.dicrease)
.setRightThumbDrawable(R.mipmap.increase)
.setRightThumbHighlightDrawable(R.mipmap.increase)
.setDataType(CrystalRangeSeekbar.DataType.INTEGER)
.apply();

pricerangebar.setOnRangeSeekbarChangeListener(new OnRangeSeekbarChangeListener() {
@SuppressLint("SetTextI18n")
@OverRide
public void valueChanged(Number minValue, Number maxValue) {
minproductPrice=minValue.toString();
maxproductPrice=maxValue.toString();
txt_priceminvalue.setText("From "+minValue);
txt_pricemaxvalue.setText("To "+maxValue);
}
});

Is there any more configuration or setting available with seekbar to make it smooth scroll on both left and right end
Please provide some guideline or help to resolve this problem.

thumb_image from GradientDrawable

Hi!

please add possibility to set GradientDrawable to thumb_image.
for example it is much easier to me draw thumbs as shape drawables, than draw images via gimp

Seekbar gap

Seekbar doesn't keep it's gap when min and max values set programmatically. But when I set min, max values in xml it's working

Click on seekbar to change value without using thumb

Hi,

Many people start using a seekbar without using the thumb, they just click anywhere on the seekbar then move the thumb if necessary.
Currently nothing happens when I click on my crystal seekbar. Is it possible to activate the clicks on the seekbar ?

Feature request: auto-attract

If used in a short range (1-10 for example), the bar should be visually discrete.
The current values are right but the cursors should be attract by the real values or it ends up with visual range but min=max.

image

Unable to specify thumb drawable

Creating a BitmapDrawable and assigning it to a thumb via setLeftThumbDrawable() appears to have no effect. Changing the color programmatically works, but the thumb uses the default dimension and drawable.

How to get current progress

Hi. I really need to know what is the current value outside the Listener.

from some reason seekbar.getProgress isnt exist.

tyyy

CrystalRangeSeekbar not showing when surrounded by TextViews

When I use CrystalRangeSeekbar using the entire width, it shows normally. But when I try to place 2 TextViews on the left and right of the Seekbar, the Seekbar doesn't show. See code below to replicate:

<RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/txt_min"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentStart="true"
                android:text="MIN" />

            <com.crystal.crystalrangeseekbar.widgets.CrystalRangeSeekbar
                android:id="@+id/temperature_rangeseekbar"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toEndOf="@+id/txt_max"
                android:layout_toLeftOf="@+id/txt_min"
                android:layout_toRightOf="@+id/txt_max"
                android:layout_toStartOf="@+id/txt_min"
                app:bar_color="#000"
                app:bar_highlight_color="#2434AD"
                app:data_type="_float"
                app:left_thumb_color="#3caf9a"
                app:left_thumb_color_pressed="#349986"
                app:max_value="42.0"
                app:min_value="35.0"
                app:right_thumb_color="#c44949"
                app:right_thumb_color_pressed="#b43a3a" />

            <TextView
                android:id="@+id/txt_max"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true"
                android:text="MÁX" />
</RelativeLayout>

setminStartValue not working properly

If I'm trying to use setMinStartValue(1735f).apply(); then seekbar is pointing at position 17.
Its not taking start thumb to exact that point.

Please fix this issue.

layout_width="wrap_content" not honored

I've 2 TextView, one before and one after the bar, the all is in a LinearLayout.
The bar is always covering the width until the end of the screen, the second TextView is never visible.

Workaround:
Depending of your layout strategy, you could achieve something by playing with the weight

        android:layout_width="0dp"
        android:layout_weight="1"

How to set setProgress for Min and Max value in progress bar?

I am using seekbar with two side thumb. I am changing min and max value and viewing result in another activity. Once I returned to that seekbar activity I want to show the last selected min and max value in seekbar. How can I achieve this one? I unable to find setProgress method for Min and Max value respectively.

IllegalArgumentException: Number class 'java.lang.Double' is not supported

` volumeSeekbar.setOnSeekbarChangeListener(new OnSeekbarChangeListener() {
@OverRide
public void valueChanged(Number value) {

            int volume = value.intValue();

            audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,
                    (int) volume, 0);


        }
    });

`

Caused by: java.lang.IllegalArgumentException: Number class 'java.lang.Double' is not supported at com.crystal.crystalrangeseekbar.widgets.CrystalSeekbar.formatValue(CrystalSeekbar.java:712) at com.crystal.crystalrangeseekbar.widgets.CrystalSeekbar.getSelectedMinValue(CrystalSeekbar.java:369) at com.crystal.crystalrangeseekbar.widgets.CrystalSeekbar.setOnSeekbarChangeListener(CrystalSeekbar.java:269)

cry

how set left and right seekbar progress ? i didn't find this method.

Negative numbers crash

I have crash if my maxValue set -15 and min value set to -78.Seekbar step is 0.1.Please tell me if my fix is working.
#28 pull request.

Change bar size

Hi ty for this library.
I have some issues but most important is that I can't change the bar or the thumb of the seekbar.
setScrollBarSize not working and all the other options that are relevant.

Please tell me how can I change the size tyyy

NullPointerException at using Bitmaps in thumbs

Have a code

Bitmap b = Bitmap.createBitmap(30, 30, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
Paint p = new Paint();
p.setColor(getResources().getColor(R.color.accent));
c.drawCircle(15, 15, 15, p);

bar.setLeftThumbBitmap(b);
bar.setRightThumbBitmap(b);
bar.apply();

And after try to move thumbs immediatly get exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.isRecycled()' on a null object reference
    at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1269)
    at android.graphics.Canvas.drawBitmap(Canvas.java:1325)
    at com.crystal.crystalrangeseekbar.widgets.CrystalRangeSeekbar.drawRightThumbWithImage(CrystalRangeSeekbar.java:653)
    at com.crystal.crystalrangeseekbar.widgets.CrystalRangeSeekbar.setupRightThumb(CrystalRangeSeekbar.java:641)
    at com.crystal.crystalrangeseekbar.widgets.CrystalRangeSeekbar.onDraw(CrystalRangeSeekbar.java:899)
    at android.view.View.draw(View.java:16178)
    at android.view.View.updateDisplayListIfDirty(View.java:15174)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
    at android.view.View.updateDisplayListIfDirty(View.java:15134)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
    at android.view.View.updateDisplayListIfDirty(View.java:15134)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
    at android.view.View.updateDisplayListIfDirty(View.java:15134)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
    at android.view.View.updateDisplayListIfDirty(View.java:15134)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
    at android.view.View.updateDisplayListIfDirty(View.java:15134)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
    at android.view.View.updateDisplayListIfDirty(View.java:15134)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
    at android.view.View.updateDisplayListIfDirty(View.java:15134)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:2615)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
    at android.view.Choreographer.doCallbacks(Choreographer.java:670)
    at android.view.Choreographer.doFrame(Choreographer.java:606)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

So I cant use custom bitmaps to thumbs (but I simply want to replace so huge f*cking thumbs, why do you not implement size changing?!, argh...).

Setting min & max start value

When I set both the min and max start values it sets both thumbs to the lowest values that I've defined in setMaxValue() and setMinValue(). However when I set only the min start value or max start value using setMinStartValue() or setMaxStartValue() it works as expected.

Show button when seekbar is released - onStopTrackingTouch ?

Hi,

I need to show a button and a textview when the seekbar is released by the user. I guess I should override the onStopTrackingTouch with a normal seekbar.
It seems that I cannot do it with the crystal-range-seekbar. So what should I do ?

Thank you,

padding not honored

When using a padding on CrystalRangeSeekbar, it's not honored and the visual doesn't change.

Last version

Please update latest version here
compile 'com.crystal:crystalrangeseekbar:1.1.1'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.