百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

BubbleSeekBar

> 编程语言
开源

一个美丽的 Android 自定义 SeekBar,其在寻找时会显示进度的气泡视图。

3.4K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个美丽的 Android 自定义 SeekBar,其在寻找时会显示进度的气泡视图。

中文说明

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:

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

…

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.

GitHub Issues· 61 开放

在 GitHub 查看全部
  • #216

    这个能引用吗?

    更新于 2025年8月22日
  • #215

    could not get resource

    更新于 2025年5月13日
  • #214

    使用 Application 创建后显示 bubble 时报错

    更新于 2024年10月21日
  • #213

    我在父容器为约束布局内使用,悬浮气泡位置偏移了应该怎么办呢?设置correctOffsetWhenContainerOnScrolling无效

    更新于 2024年3月1日
  • #189

    seekbar可以竖直方向?

    更新于 2022年10月8日
  • #180

    在PopupWindow中使用,拇指水滴与实际布局分离

    更新于 2022年9月26日
  • #211

    频繁滑动就会卡顿

    更新于 2022年7月5日
  • #209

    setEnabled(false) looks exactly the same as setEnabled(true)

    更新于 2022年2月4日
  • #207

    Issue in progress when (max-min)/sectionCount not an integer

    更新于 2021年8月29日
  • #208

    How to set section text interval in float?

    更新于 2021年6月17日

核心特点

  • •There are two versions of this library.The differences as follow:
  • •You must correct the offsets by setting ScrollListener when BubbleSeekBar's parent view is scrollable
  • •When customize the section texts, you should make sure that the attr bsb_section_text_position
  • •The attr bsb_always_show_bubble is not supported in the RecyclerView, ListView and GridView.
  • •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.

> 标签

Javaandroidseekbar

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言