Giter Site home page Giter Site logo

yzp531 / slidepager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from omadahealth/slidepager

0.0 1.0 0.0 2.21 MB

Provides a way to display progress through a nice day-by-day UI using a ViewPager for switching views

License: MIT License

Java 100.00%

slidepager's Introduction

SlidePager Android Arsenal

A ViewPager implementation that is useful for navigating through views that can be grouped, such as days in a week (API 14+).

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

   //SlidePager
   compile 'com.github.omadahealth.slidepager:slidepager:1.9.2@aar'

Demo

========

By

Developers: Olivier Goutay and Stoyan Dimitrov

Designers: Yassine Bentaieb

Usage

Look at the example app for a live example on how to use the library. If you want to use the classic SlidePager, use the SlidePagerAdapter to populate your views. If you want to use the chart SlidePager, use the SlideChartPagerAdapter to populate your views.

In XML:

  <com.github.omadahealth.slidepager.lib.SlidePager
      android:id="@+id/slidepager1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      style="@style/SlidePagerStyle"/>

In styles.xml

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

        <item name="slide_start_at_end">true</item>
        <item name="slide_show_streaks">true</item>
        <item name="slide_show_week">true</item>
        <item name="slide_show_date">true</item>
    </style>

========

Customization

You can change several attributes in the XML file:

  • app:slide_progress_completed_fill_color [color hex] --> The fill color when the progress is at 100%
  • app:slide_progress_completed_reach_color [color hex] --> The reach color(border) when the progress == 100%
  • app:slide_progress_not_completed_reach_color [color hex] --> The reach color(border) when the progress < 100%
  • app:slide_progress_not_completed_outline_color [color hex] --> The outline color(border) when the progress < 100%
  • app:slide_progress_not_completed_outline_size [dimension] --> The outline size(border) when the progress < 100%
  • app:slide_progress_not_completed_future_outline_size [dimension] --> The outline size(border) when the progress is in the future
  • app:slide_progress_not_completed_fill_color [color hex] --> The fill color(border) when the progress < 100%
  • app:slide_progress_special_reach_color [color hex] --> The reach color(border) when the progress < 100%
  • app:slide_progress_special_outline_color [color hex] --> The outline color(border) when the progress < 100%
  • app:slide_progress_special_fill_color [color hex] --> The fill color(border) when the progress < 100%
  • app:slide_progress_reached_width [dimension] --> The size of the reached progress on the CircularBar
  • app:slide_start_at_end [boolean] --> True if you want the pager to start at the last page instead of 0
  • app:slide_show_streaks [boolean] --> True if you want the connecting streaks to appear between consecutive 100% progress views
  • app:slide_shake_if_not_selectable [boolean] --> True if you want the SlidePager to shake when a day not selectable is clicked
  • app:slide_show_progress_text [boolean] --> True if you want to display the text below the CircularBar
  • app:slide_show_progress_plusmark [boolean] --> True if you want to display the plus mark on an empty special day
  • app:slide_show_week [boolean] --> True if you want to show the left text view
  • app:slide_show_date [boolean] --> True if you want to show the right text view
  • app:sp_slide_show_circular_bars [boolean] --> True if you want to show the circular bars, false otherwise
  • app:slide_progress_chart_bar_top_text_color [color hex] --> The top text color of the SlideChartView
  • app:slide_progress_chart_bar_bottom_text_color [color hex] --> The bottom text color of the SlideChartView
  • app:slide_progress_chart_bar_bottom_special_text_color [color hex] --> The bottom text color of the SlideChartView (special progress)
  • app:slide_progress_chart_color [color hex] --> The color of the bars in SlideChartView
  • app:slide_progress_chart_bar_size [dimension] --> The size of the bars in SlideChartView

========

Credits

========

License

The MIT License (MIT)

Copyright (c) 2015 Omada Health, Inc

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.

slidepager's People

Contributors

oliveeyay avatar stoyand avatar

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.