A simple material-based support library to bring consistent SeekBars on Android 14 and above

Overview

SeekBarCompat

Release GitHub license Android Arsenal

A support library for the material design SeekBar in Android for API 14 and above.

Screenshot

On APIs 14 and above - Seekbars would look something like

Example

The SeekBarCompat picks up the PrimaryColor by default, but you can set custom colors for SeekBar thumb and progress too, both in xml and programmatically.

Xml

<app.minimize.com.seek_bar_compat.SeekBarCompat
        android:id="@+id/materialSeekBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:maxHeight="300sp"
        app:progressColor="#AFF123"
        app:progressBackgroundColor="#000"
        app:thumbColor="#FF4444"
        app:thumbAlpha="1.0"/>

Note: Add maxHeight attribute in xml - it fixes the thumb gravity issues on APIs < 21

In Xml you can also specify progressBackgroundColor - by default the progressBackgroundColor (progress-line color) is Black.

Programmatically

  val seekBarCompat = findViewById<View>(R.id.materialSeekBar) as SeekBarCompat
  seekBarCompat.setThumbColor(Color.RED)
  seekBarCompat.setProgressColor(Color.CYAN)
  seekBarCompat.setProgressBackgroundColor(Color.BLUE)
  seekBarCompat.setThumbAlpha(128)

Download

Repository available on jCenter

compile 'com.minimize.library:seekbar-compat:0.3.0'

If the dependency fails to resolve, add this to your project repositories

repositories {
    maven {
        url  "http://dl.bintray.com/ahmedrizwan/maven" 
    }
}

License

Copyright 2015 Ahmed Rizwan

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.
Comments
  • Compatibility issue with KitKat (and possibly other versions)

    Compatibility issue with KitKat (and possibly other versions)

    Hello. I would like to integrate this library into my app (https://play.google.com/store/apps/details?id=com.pablode.labeledmusicplayer), however I ran into some compatibility issues with older android versions, more specifically KitKat (haven't tested other ones).

    s1

    Basically, screenshot 1 shows how it SHOULD look. This is a screenshot of android 22 (htc one, cyanogenmod, newest version), however I can confirm that it also works on 21 (nexus 9, stock android). Additionally, this is how it looks when using the native seekbar provided by android (but obviously I don't want to use that, since I want the material style on every device, which this library tries to provide).

    s2

    Screenshot 2 shows how the use of the library actually looks in an emulator of KitKat, API level 19. On the left side is the corresponding code. There is programmatical interaction, but only for setting thumb color/alpha, enabling/disabling it and bringing the view to the front.

    I can provide you with more code, if needed, however I suppose it won't be relevant.

    It would be awesome if you were to fix this. Thanks.

    opened by pablode 18
  • Version 0.2.1 on Jellybean

    Version 0.2.1 on Jellybean

    Today I compiled my code with the new version 0.2.1 on a tablet 4.1 Jellybean, and this is what happened: screenshot_2015-07-21-15-58-12

    Works fine on 0.2.0!

    Thankyou so much for such great lib =)

    opened by shinayser 8
  • Compatibility Issue

    Compatibility Issue

    Hi,

    I love this library, thank you so much for implement it. I can understand that Thumb of SeekBar required API 16 & up. Yet can you make this library compliant from API 14 & up. I mean can I just skip calling setThumbColor methods from my app for API < 16.

    I hope we can make it backward compatibility.

    EDIT: I checked the source & I guess we can easily make it backward compatible, just need to put API condition. Let me know if you need my help

    opened by AkshayChordiya 4
  • Issue with devices & android version

    Issue with devices & android version

    Hi,

    This library is perfect for me. Moreover it is compatible down to API 14. But when I tested on some other devices, it showed weird view & on some devices the thumb ahead of seek. I appreciate your hard work. But is there any solution to these issues, because I can't go back to Seekbar as this library is awesome

    opened by AkshayChordiya 3
  • Application label conflict

    Application label conflict

    Tried using the library by adding compile 'com.minimize.library:seekbar-compat:0.1.2' to my dependencies, but encountered an error.

    Error:(13, 9) Attribute application@label value=(@string/launcher_title) from AndroidManifest.xml:13:9 Error:(13, 9) Execution failed for task ':app:processDebugManifest'. Manifest merger failed : Attribute application@label value=(@string/launcher_title) from AndroidManifest.xml:13:9 is also present at com.minimize.library:seekbar-compat:0.1.2:13:9 value=(@string/app_name) Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:11:5 to override

    Is there any need for the application tags, or more specifically the android:label tag in the Manifest.xml? This is obviously a library, not an app.

    opened by pablode 3
  • setThumb() doesn't set a custom thumb on Android 4.3

    setThumb() doesn't set a custom thumb on Android 4.3

    I'm testing using a Samsung Galaxy S3 running 4.3. The setThumb() method fails to set a custom thumb on this version. It works fine on Lollipop, as expected.

    opened by colintheshots 1
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
  • ProgressBackgroundColor has weird offset on Kitkat

    ProgressBackgroundColor has weird offset on Kitkat

    Hey, when I try to use this library, the ProgressBackgroundColor is drawn with an offset above the actual SeekBar.

    Code

    <app.minimize.com.seek_bar_compat.SeekBarCompat
                android:id="@+id/seekBar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                android:max="100"
                app:progressColor="@color/green"
                app:progressBackgroundColor="@color/white"
                app:thumbColor="@color/green"/>
    

    API 19 bildschirmfoto 2017-05-12 um 12 53 57

    opened by philipphager 0
  • getProgressDrawable() returns null

    getProgressDrawable() returns null

    Hi,

    On setupProgressColor() getProgressDrawable() returns null and a NullPointerException is triggered,

    I'm using android 4.3 on a galaxy SIII stock firmware

    opened by myrmidon-media 1
  • Not working on Samsung galaxy S5 with Lolipop

    Not working on Samsung galaxy S5 with Lolipop

    Hi, in my case only one thing that works is thumbColor. Looks like progressBackgroundColor and progressColor have no affect at all. I tried it also on emulator and it worked, but on my device it's not working. I also tried Labeled Music Player and only white progress line was displayed (without thumb). EDIT: in Labeled music player it has same behaviour as in my app

    opened by palicka 4
Releases(v0.2.4)
Owner
Ahmed Rizwan
React | Android | RN
Ahmed Rizwan
A material Date Range Picker based on wdullaers MaterialDateTimePicker

Material Date and Time Picker with Range Selection Credits to the original amazing material date picker library by wdullaer - https://github.com/wdull

Supratim 1.3k Dec 14, 2022
Custom circular SeekBar (Circle, Semi-circle, and Ellipse) View/Widget for Android

CircularSeekBar Android CircularSeekBar Custom View/Widget This is a custom circular SeekBar. It can be used to create SeekBars that are: -Full Circle

Matt Joseph 462 Dec 19, 2022
 A beautiful and powerful SeekBar what supports single、 range、steps、vetical、custom( 一款美观强大的支持单向、双向范围选择、分步、垂直、高度自定义的SeekBar)

文档还是中文好 Demo APK download fir.im Usage Dependencies Release Version allprojects { repositories { ... maven { url 'https://jitpack.io' }

null 2.3k Jan 5, 2023
A seekbar contains two cursor(left and right). Multiple touch supported.

RangeSeekbar A seekbar contains two cursor and support multi-touch. RangeSeekbar have left and right cursors, user can move cursor to make fliter. How

dolphinWang 283 Mar 28, 2022
Android widget for selecting a range of values.

MaterialRangeBar MaterialRangeBar is a fork from https://github.com/edmodo/range-bar that adds some basic material styling, as well as start and end v

null 1.7k Dec 30, 2022
Circular SeekBar view for Android

SeekArc What is a SeekArc? So what the heck is a SeekArc? Essentially it’s a SeekBar that has been wrapped around a circle. It acts like a SeekBar and

Neil Davies 870 Dec 10, 2022
A circular seek bar for Android

CircularSeekBar A circular seek bar for Android. Modification 1. Modified setProgress(int progress) method. 2. Added hideSeekBar() To hide seekbar. 3.

Raghav Sood 289 Nov 25, 2022
Android circle seekbar widget inspired from: https://github.com/LarsWerkman/HoloColorPicker

Android HoloCircleSeekBar A Circle SeekBar inspired by Android Holo ColorPicker designed by Marie Schweiz and developed by Lars Werkman. How to integr

Jesus 232 Nov 10, 2022
StartPointSeekBar is a custom view for the Android platform that makes it possible to have a SeekBar to have custom start point.

Forked/Inspired from https://code.google.com/p/range-seek-bar/ by [email protected] This solves the problem as described in http://

Gaurav Vashisth 142 Dec 29, 2022
A color picker seekbar for android.

ColorSeekBar A color picker seekbar for android. Download Use Gradle compile 'com.divyanshu.colorseekbar:colorseekbar:1.0.2' or Maven <dependency>

Divyanshu Bhargava 129 Nov 29, 2022
Ranger is custom view which able to act like android seekbar.

Ranger is custom view which able to act like android seekbar.

Enes Zor 3 Oct 17, 2021
Simple custom Android View providing a Circular spin to SeekBars

CircularSeekBar This is a simple Seek Bar, in the shape of a circle, responsive to the speed of the spin: the faster you spin the control, the faster

Mikel 34 Feb 18, 2022
Material Design ProgressBar with consistent appearance

MaterialProgressBar Material Design ProgressBar with consistent appearance on Android 4.0+. Why MaterialProgressBar? Consistent appearance on Android

Hai Zhang 2.2k Dec 21, 2022
Material Design ProgressBar with consistent appearance

MaterialProgressBar Material Design ProgressBar with consistent appearance on Android 4.0+. Why MaterialProgressBar? Consistent appearance on Android

Hai Zhang 2.2k Jan 1, 2023
Material Design ProgressBar with consistent appearance

MaterialProgressBar Material Design ProgressBar with consistent appearance on Android 4.0+. Why MaterialProgressBar? Consistent appearance on Android

Hai Zhang 2.2k Jan 1, 2023
A library to bring fully animated Material Design components to pre-Lolipop Android.

Material MaterialLibrary is an Open Source Android library that back-port Material Design components to pre-Lolipop Android. MaterialLibrary's origina

Rey Pham 6k Dec 21, 2022
GreenDroid is a development library for the Android platform. It makes UI developments easier and consistent through your applications.

#GreenDroid Foreword : This project, initially initiated by me, Cyril Mottier, is not maintained anymore and can be considered as deprecated. As a con

Cyril Mottier 2.6k Jan 4, 2023
Tachiyomi 20.4k Jan 9, 2023
Kickstarter for Android. Bring new ideas to life, anywhere.

Welcome to Kickstarter's open source Android app! Come on in, take your shoes off, stay a while—explore how Kickstarter's native squad has built and c

Kickstarter 5.7k Jan 2, 2023