seekbar滑动跟随气泡
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
gradle/wrapper
screenshot
seekBarBubble
seekBarBubbleDelegate-kotlin
seekBarBubbleDelegate
.gitignore
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

SeekBarBubble

Apache 2.0 License Download

SeekBar滑动跟随气泡辅助

Delegate

以不侵入的思路为SeekBar增加气泡跟随,依赖SeekBar本身提供的OnSeekBarChangeListener

Installation

implementation 'com.zyhang:seekbarbubbledelegate:<latest-version>'

Usage

具体可以参考MainActivity.kt

val seekBarBubbleDelegate = SeekBarBubbleDelegate(this,
                seekBar,
                LayoutInflater.from(this).inflate(R.layout.seekbar_bubble, null))
        with(seekBarBubbleDelegate) {
            setDefaultListener { _, progress, _ ->
                bubble.findViewById<TextView>(R.id.seekBar_bubble_tv).text = "$progress''"
            }
            // always show
            showBubble(true)
            bubble.findViewById<TextView>(R.id.seekBar_bubble_tv).text = "${seekBar.progress}''"
        }

Kotlin 扩展

Installation

implementation 'com.zyhang:seekbarbubbledelegate-kotlin:<latest-version>'

SeekBarBubble

继承SeekBar基于SeekBarBubbleDelegate提供的一款简单的气泡跟随SeekBar

Screenshot

Installation

implementation 'com.zyhang:seekbarbubble:<latest-version>'

Usage

<com.zyhang.seekBarBubble.SeekBarBubble
            android:id="@+id/seekBarBubble"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            app:sbb_alwaysShow="true"/>