Giter VIP home page Giter VIP logo

iosprogressbar's Introduction

IOSProgressBar

IOSProgressBar is a progress-bar lib for android. And the progress-bar looks like iOS system style

Features:

  • Support horizontal and vertical orientation.
  • Support drag progress-bar and click progress-bar.
  • Support progress divider and custom your divider height or color.
  • Support show progress text
  • Support custom progress rect conner radius and style

Sample screenshots:

ios-progress-bar-1

ios-progrss-bar-2

Basic usage:

Gradle

Add maven repositories of jitpack in your project's build.gradle file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add dependence in your app's build.gradle file:

dependencies {		
	implementation 'com.github.hyy920109:IOSProgressBar:v1.2.0'
}

Code Sample

In .xml files:

		...
<com.hyy.iosprogressbar.IOSProgressBar
     android:id="@+id/ios_progress_bar_horizontal"
     android:layout_width="164dp"
     android:layout_height="56dp"
     app:ipb_conner_radius="8dp"
     app:ipb_progress_show_text="true"
     app:ipb_progress_bar_orientation="horizontal"
     app:layout_constraintTop_toTopOf="parent"
     app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
     android:layout_marginTop="@dimen/fab_margin"/>

<com.hyy.iosprogressbar.IOSProgressBar
     android:id="@+id/ios_progress_bar_vertical"
     android:layout_width="56dp"
     android:layout_height="164dp"
     app:ipb_conner_radius="8dp"
     app:ipb_progress_max="4"
     app:ipb_progress_show_divider="true"
     app:layout_constraintBottom_toBottomOf="parent"
     app:layout_constraintEnd_toEndOf="parent"
     app:layout_constraintStart_toStartOf="parent"
     app:layout_constraintTop_toTopOf="parent" />
...
   

And in activity or fragment:

view.findViewById<IOSProgressBar(R.id.ios_progress_bar_horizontal).setOnProgressChangeListener { iosProgressBar, progress, maxProgress, minProgress, actionUp ->
     //do some things
}
...
view.findViewById<IOSProgressBar>(R.id.ios_progress_bar_vertical)
    .setOnProgressChangeListener { iosProgressBar, progress, maxProgress, minProgress, actionUp ->
    //do some things
}

API doc

Attribute Description
ipb_conner_radius IOSProgressBar rect conner radius
ipb_background_color IOSProgressBar background color
ipb_progress_color IOSProgressBar progress color
ipb_progress_max IOSProgressBar max progress
ipb_progress_min IOSProgressBar min progress
ipb_progress IOSProgressBar current progress
ipb_progress_show_divider IOSProgressBar show divider or not
ipb_progress_divider_height IOSProgressBar divider height
ipb_progress_divider_color IOSProgressBar divider color
ipb_progress_show_text IOSProgressBar show progress text ot not
ipb_progress_text_color IOSProgressBar progress text color
ipb_progress_text_size IOSProgressBar progress text size
ipb_progress_bar_orientation IOSProgressBar progress orientation:vertical or horizontal
ipb_progress_conner_style IOSProgressBar progress rect conner style: round or cut.

End

Above we introduce all attributes of IOSProgressBar , if it helps you , thanks for your star. Or if you have some good advices, welcome commit a pull request. If IOSProgressBar has some bug in use, you can commit an issue to me, I will reply as soon as.

iosprogressbar's People

Watchers

 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.