TicketView

An Android Library used to implement TicketView in android with normal, rounded and scallop corners.

Download

TicketView on Google Play

Quick Setup

1. Include library

Using Gradle

dependencies {
    compile 'com.vipulasri:ticketview:1.0.5'
}

Using Maven

<dependency>
    <groupId>com.vipulasri</groupId>
    <artifactId>ticketview</artifactId>
    <version>1.0.5</version>
    <type>pom</type>
</dependency>

What's New

See the project's Releases page for a list of versions with their change logs.

View Releases

If you Watch this repository, GitHub will send you an email every time I publish an update.

2. Usage

  • In XML Layout :
<com.vipulasri.ticketview.TicketView
        android:layout_width="match_parent"
        android:layout_height="160dp"
        android:layout_marginTop="60dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:id="@+id/ticketView"
        app:orientation="vertical"
        app:scallopRadius="10dp"
        app:showBorder="false"
        app:scallopPositionPercent="50"
        app:showDivider="true"
        app:dividerType="dash"
        app:dividerPadding="0dp"
        app:ticketElevation="14dp"/>
  • Configure using xml attributes or setters in code:

    Attribute Name Default Value Description
    app:orientation="vertical" horizontal sets orientation of divider and scallop
    app:backgroundColor="@android:color/black" white sets background color
    app:scallopRadius="10dp" 20dp sets scallop radius
    app:scallopPositionPercent="50" 50 sets position of scallop and divider
    app:showBorder="false" false shows border if `true`
    app:borderWidth="4dp" 2dp sets border width
    app:borderColor="@color/grey" black sets border color
    app:showDivider="true" false shows divider if `true`
    app:dividerType="dash" normal sets type of divider ie `normal` or `dash`
    app:dividerColor="@color/colorAccent" dark gray sets divider color
    app:dividerWidth="2dp" 2dp sets divider width
    app:dividerPadding="0dp" 10dp sets divider padding
    app:dividerDashGap="4dp" 4dp sets divider dash gap
    app:dividerDashLength="8dp" 8dp sets divider dash length
    app:cornerType="rounded" normal sets type of corner ie `normal` or `rounded` or `scallop`
    app:cornerRadius="15dp" 4dp sets corner radius if corner rounder or scallop
    app:ticketElevation="14dp" 0dp sets elevation to ticket view on android jellybean and above

GitHub