A beautiful Android custom View that works similar to a range or seekbar. With animations.

Related tags

UI/UX ValueBar
Overview

ValueBar

A beautiful Android custom View that works similar to a range or seekbar. Selection by gesture. With animations. Supporting API level 11+.

alt tag

Demo

For a short demonstration, please download the demo application from the Google PlayStore. The corresponding code for the demo application can be found in the ValueBarExample folder.

Usage

For using ValueBar, there are various possibilities:

1. Gradle dependency

  • Add the following to your build.gradle:
repositories {
       maven { url "https://jitpack.io" }
}

dependencies {
       compile 'com.github.PhilJay:ValueBar:v1.0.2'
}

2. Maven

  • Add the following to your pom.xml:
<repository>
      	<id>jitpack.io</id>
       <url>https://jitpack.io</url>
</repository>

<dependency>
       <groupId>com.github.PhilJay</groupId>
       <artifactId>ValueBar</artifactId>
       <version>v1.0.2</version>
</dependency>

3. jar file

  • download the latest .jar file from the release-section and copy it into the libs folder of your Android application project.

4. clone repo

  • clone this repository and add the library folder to your Android application project

Create a ValueBar in .xml:

<com.philjay.valuebar.ValueBar
        android:id="@+id/valueBar"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:layout_margin="5dp" />

or in code, and then add it to a layout:

 ValueBar bar = new ValueBar(Context);

Apply styling, and display values:

 bar.setMinMax(0, 1000);
 bar.setInterval(1f); // interval in which can be selected
 bar.setDrawBorder(false);
 bar.setValueTextSize(14f);
 bar.setMinMaxTextSize(14f);
 bar.setValueTextTypeface(...);
 bar.setMinMaxTextTypeface(...);
 bar.setOverlayColor(...);
 
 // create your custom color formatter by using the BarColorFormatter interface
 bar.setColorFormatter(new RedToGreenFormatter());
 
 // add your custom text formatter by using the ValueTextFormatter interface
 bar.setValueTextFormatter(...);
            
 bar.setValue(800f); // display a value
 
 // or animate from a specific value to a specific value
 bar.animate(from, to, animationDuration);
            
 bar.setValueBarSelectionListener(...); // add a listener for callbacks when touching

Donations

If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, feel free to donate. Your donation is highly appreciated.

PayPal

Donate

Comments
  • Gradle fetching  problem

    Gradle fetching problem

    Hi, first of all thank you for the library. Is very handy and I'm using it successfully in my app.

    Recently I tried to switch though from the jar included in /libs to the gradle dependency fetched from jitpack.io but I get the following error:

    Error:Could not find ValueBar.jar (com.github.PhilJay:ValueBar:v1.0.2).
    Searched in the following locations:
        https://jitpack.io/com/github/PhilJay/ValueBar/v1.0.2/ValueBar-v1.0.2.jar
    

    Could there be a naming problem with the jar file?

    That's the error that jitpack returns. Log https://jitpack.io/com/github/PhilJay/ValueBar/v1.0.2/build.log

    opened by emanuelet 6
  • java.lang.NullPointerException

    java.lang.NullPointerException

    E/AndroidRuntime: FATAL EXCEPTION: main Process: com.voris.yara, PID: 31028 java.lang.NullPointerException at com.philjay.valuebar.Utils.calcTextHeight(Utils.java:102) at com.philjay.valuebar.ValueBar.drawValueText(ValueBar.java:212) at com.philjay.valuebar.ValueBar.onDraw(ValueBar.java:197) at android.view.View.draw(View.java:14681) at android.view.View.getDisplayList(View.java:13575) at android.view.View.getDisplayList(View.java:13617) at android.view.View.draw(View.java:14395) at android.view.ViewGroup.drawChild(ViewGroup.java:3237) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3074) at android.view.View.draw(View.java:14684) at android.widget.FrameLayout.draw(FrameLayout.java:472) at android.view.View.getDisplayList(View.java:13575) at android.view.View.getDisplayList(View.java:13617) at android.view.View.draw(View.java:14395) at android.view.ViewGroup.drawChild(ViewGroup.java:3237) at android.support.v7.widget.RecyclerView.drawChild(RecyclerView.java:3820) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3074) at android.view.View.draw(View.java:14684) at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:3290) at android.view.View.getDisplayList(View.java:13575) at android.view.View.getDisplayList(View.java:13617) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3211) at android.view.View.getDisplayList(View.java:13512) at android.view.View.getDisplayList(View.java:13617) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3211) at android.view.View.getDisplayList(View.java:13512) at android.view.View.getDisplayList(View.java:13617) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3211) at android.view.View.getDisplayList(View.java:13512) at android.view.View.getDisplayList(View.java:13617) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3211) at android.view.View.getDisplayList(View.java:13512) at android.view.View.getDisplayList(View.java:13617) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3211) at android.view.View.getDisplayList(View.java:13512) at android.view.View.getDisplayList(View.java:13617) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3211) at android.view.View.getDisplayList(View.java:13512) at android.view.View.getDisplayList(View.java:13617) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3211) at android.view.View.getDisplayList(View.java:13512) at android.view.View.getDisplayList(View.java:13617) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3211) at android.view.View.getDisplayList(View.java:13512) at android.view.View.getDisplayList(View.java:13617) at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1577) at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1451) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2551) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2417) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2006) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1063) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5993) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at android.view.Choreographer.doFrame(Choreographer.java:544) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) 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:5584) 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:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(Native Method)

    opened by riyase 1
  • ValueBar in ViewPager

    ValueBar in ViewPager

    I have a ViewPager in which I can swipe between different fragments and integrated the ValueBar in one of these Fragments. Now when I try to drag the ValueBar, the ViewPager always catches the motion-event and swipes to the next or previous fragment :(

    opened by MaxBatt 1
  • Build is working but error when running the app

    Build is working but error when running the app

    Hi, I imported the library directly via the Gradle build file: compile 'com.github.PhilJay:ValueBar:v1.0.2'

    The project builds, but when I start running the app, I get the following errors:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: 
    Landroid/support/v4/widget/SearchViewCompatIcs$MySearchView;
    
    Error:Execution failed for task ':app:dexDebug'.
    

    com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:
    Process 'command 'C:\Program Files\Java\jdk1.8.0_20\bin\java.exe'' finished with non-zero exit value 1

    I already tried to add the following options to the android section of the build file, but nothing works:

     dexOptions {
        preDexLibraries = false
     }
    
    packagingOptions {
        exclude 'support-v4'
    }
    

    Thanks in advance!

    Edit: At the moment I do not have any other maven dependencies in my gradle build file than the ValueBar dependency.

    opened by MaxBatt 1
  • How to cancel an ongoing animate?

    How to cancel an ongoing animate?

    Hello,

    I have to stop the animate in specific conditions from the place where it was last, and than continue the animation at another specific point from where it was. Is there a way to achieve that? I'm not able to stop an animate if I've launched it.

    Best, mackqrenc

    opened by rencsaridogan 1
  • ValueBar with round edges

    ValueBar with round edges

    I am unable to use ValueBar with round edges, is it possible to use ValueBar with round edges? When i set the background to round edges with the progress within it still have straight edges Please help

    Thank you

    opened by yahya194 0
  • Ability to extend ValueBar?

    Ability to extend ValueBar?

    Would it be possible to make some of the ValueBar's methods protected in order to extend the class? There's a few tweaks and customizations I'd like to try out.

    opened by mitenko 0
Releases(v1.0.2)
Owner
Philipp Jahoda
Passionate developer. Startup guy. Tech lover.
Philipp Jahoda
A lovely snail,You can use it as a seekbar or progressbar.

SnailBar A lovely ,you can use it as a seekbar or progressbar. Helixbar design by Davlikanoff.This is his words: Hi Guys! This 18 seconds long animati

CJJ 527 Jun 10, 2022
Highly customized vertical Seekbar with segments

SegmentedVerticalSeekBar It is an Android Vertical Seekbar with segments develop

smartSense Solutions 15 Dec 31, 2022
Android library implementing a poppy view on scroll, similar to the one found in the Google Plus app

PoppyView PoppyView is a library which implements view on the bottom which come and go relative to the user scroll. It can be seen in the Google plus

Flavien Laurent 409 Nov 23, 2022
Provides 9-patch based drop shadow for view elements. Works on API level 9 or later.

Material Shadow 9-Patch This library provides 9-patch based drop shadow for view elements. Works on API level 14 or later. Target platforms API level

Haruki Hasegawa 481 Dec 19, 2022
Android View for displaying and selecting values in a circle-shaped View, with animations and touch gestures.

CircleDisplay Android View for displaying and selecting (by touch) values / percentages in a circle-shaped View, with animations. Features Core featur

Philipp Jahoda 287 Nov 18, 2022
Android widget for selecting a range of values.

RangeBar The RangeBar is similar to an enhanced SeekBar widget, though it doesn't make use of the SeekBar. It provides for the selection of a range of

Edmodo 715 Nov 14, 2022
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Dec 6, 2022
A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in Flutter.

Red Screen Of Death What A simple screen that is shown when your app gets crashed instead of the normal crash dialog. It's very similar to the one in

Ahmad Melegy 178 Dec 9, 2022
A backport of the SwitchPreference component that was introduced on Android 4 (ICS / level 14). This port works on Android 2.1+ (Eclair MR1 / level 7).

Android Switch Preference Backport A backport of the SwitchPreference component that was introduced on Android 4 (ICS / level 14). This port works on

Benoit Lubek 498 Dec 29, 2022
A backport of the Android 4.2 GlowPadView that works on the SDK on API levels 4+

GlowPadBackport A backport of the Android 4.2 GlowPadView that works on the SDK on API levels 4+. It is heavily based upon Google's own internal imple

Frakbot 246 Dec 9, 2022
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Tan Jun Rong 2.6k Jan 5, 2023
Android layout decorators : Injecting custom attributes in layout files, Using decorators to get rid of unnecessary class explosion with custom views

Decor Decor is a library that applies decorators to Android layout with additional attributes without the need to extend and create a custom View for

Mouna Cheikhna 304 Nov 25, 2022
Custom android music player view.

InteractivePlayerView Custom android music player view. Screen Check it on youtube Usage(XML) Define it in your xml file. <co.mobiwise.library.Intera

Mert Şimşek 744 Dec 25, 2022
An android custom view that displays a circle with a colored arc given a mark

MarkView An android custom view that displays a circle with a colored arc given a mark. Usage Add as a dependency compile 'com.github.xiprox.markv

İhsan Işık 200 Nov 25, 2022
This is a android custom view , like a scratch card effect!

ScratchView This is a android custom view , like a scratch card effect! Last Update 采纳DearZack童鞋的优化思路,把计算擦除面积比例的操作放在手指离开屏幕时,以降低对CPU的占用。 Articles Scrat

D_clock爱吃葱花 316 Nov 29, 2022
An Android custom view to display digits rendered as dots in a grid, with a style like a 1970s LED clock.

#DotMatrixView This is an Android library project providing a custom view that can display things on a grid of dots. When the displayed value changes,

Mark Roberts 48 Apr 21, 2022
NumberPickerView - Custom Android View to provide a user friendly way of picking numbers. 🧪

?? Custom view for Android which provides a modern design and gestures for picking numbers in a user friendly way.

Mirkamal 6 Feb 16, 2022
(Deprecated) A custom view component that mimics the new Material Design Bottom Navigation pattern.

BottomBar (Deprecated) I don't have time to maintain this anymore. I basically wrote the whole library in a rush, without tests, while being a serious

Iiro Krankka 8.4k Dec 29, 2022