Code Monkey home page Code Monkey logo

bubbleseekbar's Introduction

API License

中文说明

logo

A beautiful Android custom seek bar, which has a bubble view with progress appearing upon when seeking. Highly customizable, mostly demands has been considered. star or pull request will be welcomed


Screenshot

demo1 demo2


demo3 demo4

Download

The LATEST_VERSION: Download

  dependencies {
     // lite version (recommended)
     // e.g. implementation 'com.xw.repo:bubbleseekbar:3.20-lite'
        implementation 'com.xw.repo:bubbleseekbar:${LATEST_VERSION}-lite'

     // enhanced version
     // e.g. implementation 'com.xw.repo:bubbleseekbar:3.20'
     // implementation 'com.xw.repo:bubbleseekbar:${LATEST_VERSION}'
  }

Usage

Init in xml

<com.xw.repo.BubbleSeekBar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:bsb_bubble_color="@color/color_red_light"
    app:bsb_bubble_text_color="@color/colorPrimaryDark"
    app:bsb_max="50.0"
    app:bsb_min="-50"
    app:bsb_progress="0"
    app:bsb_second_track_color="@color/color_red"
    app:bsb_section_count="5"
    app:bsb_section_text_position="bottom_sides"
    app:bsb_show_progress_in_float="true"
    app:bsb_show_section_mark="true"
    app:bsb_show_section_text="true"
    app:bsb_show_thumb_text="true"
    app:bsb_track_color="@color/color_red_light"/>
<com.xw.repo.BubbleSeekBar
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:bsb_auto_adjust_section_mark="true"
    app:bsb_second_track_color="@color/color_blue"
    app:bsb_section_count="5"
    app:bsb_section_text_position="below_section_mark"
    app:bsb_show_section_mark="true"
    app:bsb_show_section_text="true"
    app:bsb_show_thumb_text="true"
    app:bsb_thumb_text_size="18sp"
    app:bsb_touch_to_seek="true"/>

Init in java (not for lite version)

mBbubbleSeekBar.getConfigBuilder()
               .min(0.0)
               .max(50)
               .progress(20)
               .sectionCount(5)
               .trackColor(ContextCompat.getColor(getContext(), R.color.color_gray))
               .secondTrackColor(ContextCompat.getColor(getContext(), R.color.color_blue))
               .thumbColor(ContextCompat.getColor(getContext(), R.color.color_blue))
               .showSectionText()
               .sectionTextColor(ContextCompat.getColor(getContext(), R.color.colorPrimary))
               .sectionTextSize(18)
               .showThumbText()
               .thumbTextColor(ContextCompat.getColor(getContext(), R.color.color_red))
               .thumbTextSize(18)
               .bubbleColor(ContextCompat.getColor(getContext(), R.color.color_green))
               .bubbleTextSize(18)
               .showSectionMark()
               .seekBySection()
               .autoAdjustSectionMark()
               .sectionTextPosition(BubbleSeekBar.TextPosition.BELOW_SECTION_MARK)
               .build();

Check out the demo for more details. Or download the apk: sample.apk

Attentions

  • There are two versions of this library.The differences as follow:

    version init getter/setter
    lite xml min, max, progress
    enhanced xml, java all attrs

    lite version is recommended.

  • You must correct the offsets by setting ScrollListener when BubbleSeekBar's parent view is scrollable (such as ScrollView, except ViewPager), otherwise, the appearing position of the bubble may be wrong. For example:

   mContainer.setOnYourContainerScrollListener(new OnYourContainerScrollListener() {
       @Override
       public void onScroll() {
           // call this method to correct offsets
           mBubbleSeekBar.correctOffsetWhenContainerOnScrolling();
       }
   });
  • When customize the section texts, you should make sure that the attr bsb_section_text_position has been set to below_section_mark at first, then follow the example below in your java code:
   mBubbleSeekBar.setCustomSectionTextArray(new BubbleSeekBar.CustomSectionTextArray() {
       @NonNull
       @Override
       public SparseArray<String> onCustomize(int sectionCount, @NonNull SparseArray<String> array) {
           array.clear();
           array.put(1, "bad");
           array.put(4, "ok");
           array.put(7, "good");
           array.put(9, "great");

           return array;
       }
   });

BTW, the attr bsb_show_thumb_text will be set to false automatically for avoiding the text coverage display problems.

  • The attr bsb_always_show_bubble is not supported in the RecyclerView, ListView and GridView.

Attributes

attr.xml

How to submit a valid issue

  • Make sure you compiled the latest version. If it still doesn't work out, don't hesitate to open a new issue.
  • Describe the scenarios or operates when crash happened as much as possible(pictures would be better).
  • Tell me your device type and Android OS version is very helpful.
  • Paste your xml or java code.
  • Paste the crash log.
  • Please be polite.

License

   Copyright 2017 woxingxiao

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

bubbleseekbar's People

Contributors

hfeky avatar hgourvest avatar koliong avatar vankain avatar woxingxiao avatar

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  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

bubbleseekbar's Issues

NullPointerException

java.lang.NullPointerException: Attempt to write to field 'int android.view.WindowManager$LayoutParams.x' on a null object reference
at com.xw.repo.BubbleSeekBar$6.onAnimationUpdate(BubbleSeekBar.java:826)
at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1374)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:602)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:550)
at android.animation.ValueAnimator.start(ValueAnimator.java:1039)
at android.animation.ValueAnimator.start(ValueAnimator.java:1050)
at android.animation.AnimatorSet.start(AnimatorSet.java:585)
at com.xw.repo.BubbleSeekBar.autoAdjustSection(BubbleSeekBar.java:884)
at com.xw.repo.BubbleSeekBar.access$100(BubbleSeekBar.java:49)
at com.xw.repo.BubbleSeekBar$2.run(BubbleSeekBar.java:648)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5631)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)

高分辨率屏幕下滑动不顺畅

用小米not lte 2000分辨率的屏幕测试,发现滑动不太流畅,可能问题出现在onTouchEvent滑动的时候会离开滑动点,我的这个控件是放在scrollView中的,求大神指点原因,怎么修改
搞定了,在对应方法中添加, getParent().requestDisallowInterceptTouchEvent(true/false);就好了

建议OnProgressChangedListener接口添加当前控件的参数

类似下面这样
` public interface OnProgressChangedListener {

    void onProgressChanged(BubbleSeekBar bubbleSeekBar, int progress, float progressFloat);

    void getProgressOnActionUp(BubbleSeekBar bubbleSeekBar, int progress, float progressFloat);

    void getProgressOnFinally(BubbleSeekBar bubbleSeekBar, int progress, float progressFloat);
}`

这样在一个页面有多个BubbleSeekBar时可以共用一个回调,Android很多控件的回调都是带了View参数的,如View的点击回调、CheckBox的setOnCheckedChangeListener。
public interface OnClickListener {
/**
* Called when a view has been clicked.
*
* @param v The view that was clicked.
*/
void onClick(View v);
}

On Scroll

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.xw.repo.BubbleSeekBar.correctOffsetWhenContainerOnScrolling()' on a null object reference
at com.zinier.app.ui.fragments.questions.SlidingRatingFragment$2.onScrollChanged(SlidingRatingFragment.java:119)
at android.view.ViewTreeObserver.dispatchOnScrollChanged(ViewTreeObserver.java:1016)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2514)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2446)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2079)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1119)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6060)
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:746)
at android.os.Handler.dispatchMessage(Handler.java:95)

BubbleSeekBar 和viewpager衝突問題

Dear Sir

我把BubbleSeekBar 跟view pager 放在同一個fragment裡,
但是會發生 touch event 衝突(BubbleSeekBar拖曳會變得很慢),
但移除viewpager,一切就可以正常工作,

請問要如何解決?
謝謝

seekbar的bug

bubbleSeekBar1.getConfigBuilder()
.min(1000)
.max(10000)
.sectionCount(9)
.progress(5000)
.showSectionText()
.showSectionText()
.showSectionMark()
.showSectionMark()
.seekBySection()
.build();
当前进度设置了5000,实际只显示了3000?
是不是我姿势不对

Seek onClick

I tried to click any place on the track but it doesn't seek to the clicked position
i think it would be nice if you added seek on touching any position

WTF,why I can't use it anyway~

  1. The sample.apk on the website is not work on my phone.
  2. I fork the BubbleSeekBar in my project with master or lite switch, but I run it on my phone I found that can't see any bubble when I scroll.
  3. So I update the dependency with compile 'com.xw.repo:bubbleseekbar:3.5-lite',but I meet a crash.

BubbleSeekBar父类控件由 gone->visible 时候,BubbleSeekBar绘制的宽度不对。

如下:

xml

<LinearLayout
        android:id="@+id/ll_content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:visibility="gone"
        android:orientation="vertical">

        <com.xinli.yixinli.app.view.seekbar.BubbleSeekBar
            android:id="@+id/bubble_seek_bar_score"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="100dp"
            app:bsb_auto_adjust_section_mark="true"
            app:bsb_second_track_color="@color/c_26C3B8"
            app:bsb_section_count="5"
            app:bsb_show_progress_in_float="true"
            app:bsb_show_section_mark="true"
            app:bsb_show_text="true"
            app:bsb_show_thumb_text="true"
            app:bsb_text_position="bottom"
            app:bsb_thumb_text_color="@color/c_26C3B8"
            app:bsb_thumb_text_size="18sp"
            app:bsb_track_color="@color/c_DBDBDB"/>

    </LinearLayout>

java

 mLlContent.postDelayed(new Runnable() {
            @Override
            public void run() {
                mLlContent.setVisibility(View.VISIBLE);
            }
        }, 2000);

结果:

图片

Crash on fast scroll

I have a material dialog in a fragment and the second time it is created if i try to scroll the seekbar immediately after its creation it crashes with this error:
03-08 18:10:17.986 4027-4027/com.tea2code.e_gym E/InputEventReceiver: Exception dispatching input event. 03-08 18:10:17.986 4027-4027/com.tea2code.e_gym E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback 03-08 18:10:17.990 4027-4027/com.tea2code.e_gym E/MessageQueue-JNI: android.view.WindowManager$BadTokenException: Unable to add window -- window android.view.ViewRootImpl$W@b8ed3ad has already been added at android.view.ViewRootImpl.setView(ViewRootImpl.java:691) at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:94) at com.xw.repo.BubbleSeekBar$4.onAnimationStart(BubbleSeekBar.java:584) at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationStart(ViewPropertyAnimator.java:1089) at android.animation.ValueAnimator.notifyStartListeners(ValueAnimator.java:951) at android.animation.ValueAnimator.startAnimation(ValueAnimator.java:1186) at android.animation.ValueAnimator.start(ValueAnimator.java:1000) at android.animation.ValueAnimator.start(ValueAnimator.java:1014) at android.view.ViewPropertyAnimator.startAnimation(ViewPropertyAnimator.java:903) at android.view.ViewPropertyAnimator.start(ViewPropertyAnimator.java:415) at com.xw.repo.BubbleSeekBar.showBubble(BubbleSeekBar.java:586) at com.xw.repo.BubbleSeekBar.onTouchEvent(BubbleSeekBar.java:430) at android.view.View.dispatchTouchEvent(View.java:10024) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2264) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2264) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2264) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2264) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2264) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2264) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2632) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2264) at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:413) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1808) at android.app.Dialog.dispatchTouchEvent(Dialog.java:799) at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:375) at android.view.View.dispatchPointerEvent(View.java:10244) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4444) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4312) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3859) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3912) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3878) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4005) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3886) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4062) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3859) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3912) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3878) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3886) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3859) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6252) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6226) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6187) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6355) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(Me

My code is like this:

`dialog = new MaterialDialog.Builder(getActivity())
.title(getString(R.string.search_dialog_distance))
.customView(R.layout.distance_dialog, true)
.positiveText(getString(android.R.string.search_go))
.negativeText(android.R.string.cancel)
.cancelListener(new DialogInterface.OnCancelListener() {
@OverRide
public void onCancel(DialogInterface dialog) {

                    try {
                        progressBar.setVisibility(View.GONE);
                        location.setVisibility(View.VISIBLE);
                        location.setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.places_ic_search));
                        location.setAlpha(0.5f);
                        Toast.makeText(getActivity(), getString(R.string.search_dialog_cancel), Toast.LENGTH_LONG).show();
                    } catch (Exception e) {
                        Log.e("Changed Tab", "KM List:" + e.getMessage());
                    }
                }
            })
            .onPositive(new MaterialDialog.SingleButtonCallback() {
                @Override
                public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                    Toast.makeText(getActivity(), Integer.toString(distance), Toast.LENGTH_LONG).show();
                    task = new AsyncCaller();
                    task.execute();
                }
            }).build();

            mBubbleSeekBar = (BubbleSeekBar) dialog.findViewById(R.id.bubble_seek_bar);
            distance = mBubbleSeekBar.getProgress();
            mBubbleSeekBar.setOnProgressChangedListener(new BubbleSeekBar.OnProgressChangedListenerAdapter() {
            @Override
            public void onProgressChanged(int progress) {
                distance = progress;
            }
            });

            dialog.show();`

Right to Left!

Thank you for this great library.
Is it possible to reverse direction of this bar, meaning that to start from right and end it on the left side?

Thumb is Unexpectedly stick at right of screen

I am using a view pager inside fragment. I used Bubbleseekbar inside fragment item of viewpager.
on first fragment item of viewpager bubbleseekbar is fine and displaying as expected (thumbText is animating well).
But on next fragment items thumbText is not animating and stay at rightAligned to seekbar.
check it to view the error. take a look of snaps or this

[Enhancement] Magnetic seek and Pop-Up

This is really nice ... but I would like to suggests two enhancements:

  1. Oftentimes we want to use a seek bar which has only a discrete number of steps (e.g. 0,1, ...,10). Provide support for this via an attribute (e.g. number_steps). Of course, if set, the seek button should behave magnetically as well, i.e. it should not slide smoothly but snap to the nearest step position.

  2. It would be very nice for compact UIs if you can have an option whereby you show the value of the seekbar as text on the seek button itself (which can be configured to be either a circle or rounded rectangle). Then, when the user drags the button, you can pop up your bubble view to indicate the seek value temporarily (because the finger will be blocking the button)

NullPointterException

java.lang.NullPointerException
at com.xw.repo.BubbleSeekBar.onMeasure(BubbleSeekBar.java)
at android.view.View.measure(View.java:16555)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455)
at android.view.View.measure(View.java:16555)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5147)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1430)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:716)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:609)
at android.view.View.measure(View.java:16555)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455)
at android.view.View.measure(View.java:16555)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1999)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1171)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1356)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1058)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5974)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:780)
at android.view.Choreographer.doCallbacks(Choreographer.java:593)
at android.view.Choreographer.doFrame(Choreographer.java:562)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:766)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5315)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)
at dalvik.system.NativeStart.main(Native Method)

没有提供取消显示的方法,返回页面后还会更新ui,导致必须重启应用

      this.postDelayed(new Runnable() {
        public void run() {
          BubbleSeekBar.this.showBubble();
          BubbleSeekBar.this.triggerBubbleShowing = true;
        }
      }, location[0] == 0 && location[1] == 0?300L:0L);

看了下源码是用handle传Runnable来更新UI的,如果用户在Runnable的方法被调用前离开了activity,这个方法还是会更新UI的,造成的后果就是,页面上多了一个泡泡图标,只能重启应用。
所以,是不是应该提供一个取消的方法,也更新ui前判断下是否被取消显示。

      this.mBubbleView.animate().alpha(1.0F).setDuration(this.mAnimDuration).setListener(new AnimatorListenerAdapter() {
        public void onAnimationStart(Animator animation) {
          BubbleSeekBar.this.mWindowManager.addView(BubbleSeekBar.this.mBubbleView, BubbleSeekBar.this.mLayoutParams);
        }
      }).start();

我看到了,有如下这个方法用来隐藏那个泡泡图标,但我试了调用
seedbar.onStartTemporaryDetach();

viewGroup.removeView(seedbar);
都没有用


  protected void onDetachedFromWindow() {
    this.hideBubble();
    super.onDetachedFromWindow();
  }

问下,我把刻度隐藏之后,监听getProgressOnFinally方法就不执行了,autoAdjustSectionMark也无效了

bubbleSeekBar1.getConfigBuilder()
.max(10000)
.min(1000)
.progress(5000)
.sectionCount(9)
// .showSectionMark()//隐藏刻度
.autoAdjustSectionMark()
.showSectionText()
.sectionTextPosition(BOTTOM_SIDES)
.build();
bubbleSeekBar1.setOnProgressChangedListener(new BubbleSeekBar.OnProgressChangedListener() {
@OverRide
public void onProgressChanged(int progress, float progressFloat) {
Log.i("====","onProgressChanged="+progress+"");
}

        @Override
        public void getProgressOnActionUp(int progress, float progressFloat) {
            Log.i("====","getProgressOnActionUp="+progress+"");

        }

        @Override
        public void getProgressOnFinally(int progress, float progressFloat) {
            Log.i("====","getProgressOnFinally="+progress+"");

        }
    });

百分一百崩溃

频繁的点击滑动点,立马崩溃。。

java.lang.IllegalStateException: View com.huarui.herolife.widget.BubbleSeekBar$BubbleView{b10e02 V.ED.... ......ID 0,0-126,126} has already been added to the window manager.

                                                                     at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:253)
                                                                     at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
                                                                     at com.huarui.herolife.widget.BubbleSeekBar$2.onAnimationStart(BubbleSeekBar.java:495)
                                                                     at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationStart(ViewPropertyAnimator.java:1111)
                                                                     at android.animation.ValueAnimator.notifyStartListeners(ValueAnimator.java:925)
                                                                     at android.animation.ValueAnimator.start(ValueAnimator.java:962)
                                                                     at android.animation.ValueAnimator.start(ValueAnimator.java:969)
                                                                     at android.view.ViewPropertyAnimator.startAnimation(ViewPropertyAnimator.java:925)
                                                                     at android.view.ViewPropertyAnimator.start(ViewPropertyAnimator.java:425)
                                                                     at com.huarui.herolife.widget.BubbleSeekBar.showBubble(BubbleSeekBar.java:497)
                                                                     at com.huarui.herolife.widget.BubbleSeekBar.onTouchEvent(BubbleSeekBar.java:396)

Issue if view moved to next screen

Thank you for providing the library.

There is crash if we left pointer in between and move to next screen.

Is there any chance to make seek bar animation fast, if it's left in between ?

JNI DETECTED ERROR IN APPLICATION: can't call void android.view.View.setTranslationZ(float) on null object

java.lang.NullPointerException: Attempt to write to field 'int android.view.WindowManager$LayoutParams.x' on a null object reference

@woxingxiao
@VankaIn

java.lang.NullPointerException: Attempt to write to field 'int android.view.WindowManager$LayoutParams.x' on a null object reference
at .BubbleSeekBar.BubbleSeekBar$5.onAnimationUpdate(BubbleSeekBar.java:780)
at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1463)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:642)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:589)
at android.animation.ValueAnimator.start(ValueAnimator.java:1106)
at android.animation.ValueAnimator.start(ValueAnimator.java:1117)
at android.animation.AnimatorSet.start(AnimatorSet.java:586)
at BubbleSeekBar.BubbleSeekBar.autoAdjustSection(BubbleSeekBar.java:833)
at .BubbleSeekBar.BubbleSeekBar.access$100(BubbleSeekBar.java:48)
at.BubbleSeekBar.BubbleSeekBar$2.run(BubbleSeekBar.java:624)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5621)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)

RFE: Show arbitrary section text

Suggestion to add ability to pass an Array that can be used as section labels instead of the numeric value. The length of array must be less than or equal to number of sections. This text is displayed below section text and evenly spread across the track.

Here is an example... (sorry formatting is off and I cant figure it out)

How do you feel:

|----------|----------|----------|----------|
1             2             3              4             5
Terrible                OK              Awesome

显示不对。

你好, 我现在有个需求是要某个位置强制停留。 比如100元~30000元。 用户必须以100为单位递增。
但是我配置了。发现进度条有问题。 如果最小值是500,最大值是3000 效果都是好的。
最小值配置100,最大值配置30000就有问题了。

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.