Giter VIP home page Giter VIP logo

android-simpleprogressbar's Introduction

Simple Progress Bar for Android

SimpleProgressBar

This library provides an easy to use progress bar with a secondary progress on it, which is useful for displaying intermediate level progress.

How to use

Import with gradle

  1. Add jitpack.io in your root build.gradle at the end of repositories:

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
  2. Add SimpleProgressBar dependency:

    dependencies {
        implementation 'com.github.C0d3GGz:android-SimpleProgressBar:v1.0.0'
    }

Add manually

  1. Clone or download this repository
  2. Build library
  3. Copy files into libs directory in your app folder
    1. for *.jar files: add this code to dependency on your gradle file
    2. for *.aar files: try from projectstructure / new module/ import from aar/jar
compile files('libs/library.jar')

Create SimpleProgressBar

You can define the SimpleProgressBar both with xml and programmatic as in the following explained.

xml

Specify the app namespace for your layout by adding xmlns:app="http://schemas.android.com/apk/res-auto". Define the colors colorPrimary for primary, colorSecondary for secondary progress and backgroundDefault for the background color. You can as well change the inside padding with the app:padding element which in this example is set to 2dp. SimpleProgressBar

<de.thkoeln.simpleprogressbar.SimpleProgressBar
        android:id="@+id/myCustomProgressbar"
        app:progress_primary="10"
        app:progress_secondary="40"
        app:progress_max="100"
        android:layout_width="0dp"
        android:layout_height="30dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="8dp"
        android:layout_marginTop="8dp"
        app:corner_radius="3dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:padding="2dp" />

programmatic

myCustomProgressbar.bgColor = ContextCompat.getColor(this, R.color.colorAccent)
myCustomProgressbar.primaryColor = ContextCompat.getColor(this, android.R.color.holo_blue_bright)
myCustomProgressbar.secondaryColor = ContextCompat.getColor(this, android.R.color.holo_blue_dark)
myCustomProgressbar.primaryProgress = 10
myCustomProgressbar.secondaryProgress = 40
myCustomProgressbar.maxProgress = 100

android-simpleprogressbar's People

Contributors

c0d3ggz avatar schwedenmut avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.