https://github.com/woxingxiao/BubbleSeekBar
  
  
    A beautiful Android custom seekbar, which has a bubble view with progress appearing upon when seeking. 自定义SeekBar,进度变化更以可视化气泡样式呈现 
    https://github.com/woxingxiao/BubbleSeekBar
  
android seekbar
        Last synced: 7 months ago 
        JSON representation
    
A beautiful Android custom seekbar, which has a bubble view with progress appearing upon when seeking. 自定义SeekBar,进度变化更以可视化气泡样式呈现
- Host: GitHub
 - URL: https://github.com/woxingxiao/BubbleSeekBar
 - Owner: woxingxiao
 - Created: 2016-11-03T14:31:05.000Z (about 9 years ago)
 - Default Branch: master
 - Last Pushed: 2022-06-29T13:11:46.000Z (over 3 years ago)
 - Last Synced: 2024-08-02T01:25:21.816Z (over 1 year ago)
 - Topics: android, seekbar
 - Language: Java
 - Homepage:
 - Size: 42 MB
 - Stars: 3,353
 - Watchers: 58
 - Forks: 516
 - Open Issues: 58
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- awesome-github-android-ui - BubbleSeekBar - 自定义SeekBar (SeekBar)
 
README
          [](https://android-arsenal.com/api?level=16)
[](https://opensource.org/licenses/Apache-2.0)
[**中文说明**](https://github.com/woxingxiao/BubbleSeekBar/blob/master/README_zh.md)

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


******


## Download
The **LATEST_VERSION**: [](https://bintray.com/woxingxiao/maven/bubbleseekbar/_latestVersion)
```groovy
  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
```xml
```
```xml
```
### Init in java (not for **_lite_** version)
```java
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**](https://github.com/woxingxiao/BubbleSeekBar/raw/master/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:
```java
   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:
```java
   mBubbleSeekBar.setCustomSectionTextArray(new BubbleSeekBar.CustomSectionTextArray() {
       @NonNull
       @Override
       public SparseArray onCustomize(int sectionCount, @NonNull SparseArray 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](https://github.com/woxingxiao/BubbleSeekBar/blob/master/bubbleseekbar/src/main/res/values/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.
```