BreadcrumbsView

BreadcrumbsView

简介:A customizable Android view for paginated forms

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, andbreadcrumbs.prevStep() to move to the previous one. If not steps are left to move backward or forward, anIndexOutOfBoundsException 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值