Coder Social home page Coder Social logo

circularbarpager's Introduction

CircularBarPager Android Arsenal

A Lollipop material design styled CircularBarPager library (API 10+).

To include in your project, add this to your build.gradle file:

   //CircularBarPager
   compile 'com.github.orangegangsters:library:1.3.4@aar'
   //CirclePageIndicator
   compile 'com.viewpagerindicator:library:2.4.1@aar'
   //Animations and progress value easing
   compile 'com.daimajia.easing:library:2.1@aar'

Starting from version 1.3.10, we are moving to a new package name (we skipped from 1.3.4 to 1.3.10):

   //CircularBarPager
   compile 'com.github.omadahealth:library:1.3.11@aar'
   //CirclePageIndicator
   compile 'com.viewpagerindicator:library:2.4.1@aar'
   //Animations and progress value easing
   compile 'com.daimajia.easing:library:2.1@aar'

Demo

========

By

Developers: Olivier Goutay and Stoyan Dimitrov

Designers: Daniel Waldron

Usage

Look at the example app for a live example on how to use the library.

Preparing dependencies

In order to use the CirclePageIndicator by Square, you need to add a repo to your main build.gradle file:

allprojects {
    repositories {
        maven { url 'http://dl.bintray.com/populov/maven/' }
        jcenter()
    }
}

In XML:

<com.github.omadahealth.circularbarpager.library.CircularBarPager
        android:id="@+id/circularBarPager"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:paddingLeft="30dp"
        android:paddingRight="30dp"
        android:layout_centerInParent="true"
        style="@style/CircularBarPagerStyle"/>

In styles.xml

 <style name="CircularBarPagerStyle">
        <item name="android:layout_height">match_parent</item>
        <item name="android:layout_width">match_parent</item>

        <item name="progress_arc_max">100</item>
        <item name="arc_progress">0</item>



        <item name="progress_arc_clockwise_outline_width">0.75dp</item>
        <item name="progress_arc_counter_clockwise_outline_width">0.75dp</item>
        <item name="progress_arc_clockwise_width">8dp</item>
        <item name="progress_arc_counter_clockwise_width">8dp</item>
        
        <item name="progress_start_line_enabled">true</item>
        <item name="progress_pager_on_click_enabled">true</item>
        <item name="progress_pager_fill_circle_color">#00000000</item>
</style>

========

Customization

You can change several attributes in the XML file:

  • app:arc_progress [integer def:0 0-100] --> The default arc progress when start up
  • app:progress_arc_max [integer def:100 0-100] --> The maximum arc progress
  • app:progress_arc_clockwise_color [color hex] --> The main color in clockwise mode
  • app:progress_arc_clockwise_outline_color [color hex] --> The outline color in clockwise mode
  • app:progress_arc_counter_clockwise_color [color hex] --> The outline color in counter-clockwise mode
  • app:progress_arc_counter_clockwise_outline_color [color hex] --> The outline color in counter-clockwise mode
  • app:progress_arc_clockwise_width [integer dp] --> The width size of the main color in clockwise mode
  • app:progress_arc_clockwise_outline_width [integer dp] --> The width size of the outline color in clockwise mode
  • app:progress_arc_counter_clockwise_width [integer dp] --> The width size of the color in counter-clockwise mode
  • app:progress_arc_counter_clockwise_outline_width [integer dp] --> The width size of the outline color in counter-clockwise mode
  • app:progress_pager_on_click_enabled [boolean] --> The boolean that enables or disables the click enabled (on click, changes page)
  • app:progress_start_line_enabled [boolean] --> The boolean that enables the line that displays the starting position of the pager
  • app:progress_pager_on_click_enabled [boolean] --> The boolean that enables the user to change pages with a click as well as a slide
  • app:progress_pager_fill_circle_color [color hex] --> The color to fill the circle, transparent as default
  • app:progress_pager_fill_mode [enum int] --> The mode to fill the circle, "default_mode" or "pie_mode"

You can access every components programmatically by getting the CircularBarPager object:

CircularBarPager mCircularBarPager = (CircularBarPager) findViewById(R.id.circularBarPager);
CircularBar circularBar = mCircularBarPager.getCircularBar();
ViewPager viewPager = mCircularBarPager.getViewPager();
CirclePageIndicator circlePageIndicator = mCircularBarPager.getCirclePageIndicator();

========

Credits

========

License

The MIT License (MIT)

Copyright (c) 2017 Omada Health

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

circularbarpager's People

Contributors

ccorrado avatar cmpsoares91 avatar daespark avatar jagrutdesaioh avatar oliveeyay avatar stoyand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

circularbarpager's Issues

how could this CircularBarPager be used in Fragment?

Hi,friend.

When I use CircularBarPager in activity like the sample, it is ok. But when it is used in Fragment, the AndroidStduio logcat shows the message: I/System.out: Binary XML file line #9: Binary XML file line #9: Error inflating class xx.xxx.xxx.xxx.CircleBarPagerLib.CircularBarPager

Thanks Firstly!

Gradle error

Gradle did not work as well as readme. It works by adding it like this.

compile 'com.github.orangegangsters:library:1.3.4@aar'   //CircularBarPager    
//this line returns error -> compile 'com.viewpagerindicator:library:2.4.1@aar'
compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'   // new line for PageIndicator
//Animations and progress value easing
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'`

Gradle Compile Error: Cannot Find v.1.3.11

Using Android Studio 3.0.1, gradle wrapper v4.4

app/build.gradle Config:

    //CircularBarPager
    implementation 'com.github.omadahealth:library:1.3.11@aar'
    //Animations and progress value easing
    implementation 'com.daimajia.easing:library:2.1@aar'

project/build.gradle Config:

allprojects {
    repositories {
        jcenter()
        maven { url 'http://dl.bintray.com/populov/maven/' }
    }
}

Looks like 1.3.11 isn't available yet, getting the following gradle error:

Unable to resolve dependency for ':mobile@debug/compileClasspath': Could not resolve com.github.omadahealth:library:1.3.11.

Switching to 1.3.10 is fine though. Issue with that is, it still depends on JW's nineoldandroids, which the easing library dropped support for and actually crashes when you try and call...

circularBar.animateProgress(start, end, len);

Error inflating the view

Hi,

When I try to use your library, I got the code compiled but got error at runtime. Below is the log:

12-10 16:24:18.671 2561-2561/? E/AndroidRuntime: FATAL EXCEPTION: main
android.view.InflateException: Binary XML file line #14: Error inflating class com.github.OrangeGangsters.circularbarpager.library.CircularBarPager

Can you give me some hints what went wrong? Thanks.

Best,
Yicheng

Importing Error Into Android Studio

Yes I already read the issue that you closed about this, I tried what you mentioned there, still doesnt work for me
here is my main gradle file
snap 2015-02-21 at 15 10 59
This is my app's gradle file
snap 2015-02-21 at 15 12 02
And this is the error I get
snap 2015-02-21 at 15 13 10]
Any help is highly appreciated, thanks,

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.