Code Monkey home page Code Monkey logo

breadcrumbsview's Introduction

BreadcrumbsView

A customizable Android view which shows the current step of a given series. Its main purpose is to provide a contextual reference for paginated forms.

Screenshots

SetUp

Add to top level gradle.build file

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

Add to app module gradle.build file

dependencies {
    compile 'com.github.VictorAlbertos:BreadcrumbsView:0.0.2'
}

Usage

XML inflation

Define a BreadcrumbsView in xml layout as follows:

  <io.victoralbertos.breadcumbs_view.BreadcrumbsView
      android:id="@+id/breadcrumbs"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:numberOfSteps="5"
      app:visitedStepBorderDotColor="@color/colorVisited"
      app:visitedStepFillDotColor="@color/colorVisited"
      app:nextStepBorderDotColor="@color/colorNext"
      app:nextStepFillDotColor="@color/colorNext"
      app:visitedStepSeparatorColor="@color/colorVisited"
      app:nextStepSeparatorColor="@color/colorNext"
      app:radiusDot="@dimen/radius_dot"
      app:sizeDotBorder="@dimen/size_dot_border"
      app:heightSeparator="@dimen/height_separator"/>

Among the previous custom attributes, only app:numberOfSteps is mandatory, requiring to be an integer value greater than 1.

Moving between steps

Once instantiated the instance of BreadcrumbsView, use breadcrumbs.nextStep() to move to the next step, and breadcrumbs.prevStep() to move to the previous one. If not steps are left to move backward or forward, an IndexOutOfBoundsException is thrown.

Survive config changes

In order to retain the current step between config changes, use breadcrumbs.setCurrentStep(int). You must call it before the view is measured. Otherwise, it throws an IllegalStateException.

Examples

The module test-sample contains both a minimal example and a UI test driven by Espresso.

breadcrumbsview's People

Contributors

victoralbertos avatar

Stargazers

Anant Shah avatar

Watchers

Michael jentsch 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.