Giter VIP home page Giter VIP logo

library-android-pinpad's Introduction

Android Pinpad

Maven Central

This is an Android library for a pin pad view.

Usage

Typical usage of this library is via Java code or in the XML layouts.

Installation

Android Studio (using Gradle)

You do not need to clone this repository or download the files. Just add the following lines to your app's build.gradle:

dependencies {
  compile 'co.paystack.android.design.widget:pinpad:1.0.8'
}

XML layout usage:

    <co.paystack.android.design.widget.PinPadView xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/pinpadView"
            android:layout_width="match_parent"
            app:auto_submit="true"
            android:layout_height="0dp"
            android:layout_weight="5"
            android:background="#292929"
            app:pin_indicator_spacing="25dp"
            app:prompt_text="To confirm you're the owner of this card, please enter your card pin"
            app:prompt_textsize="15sp"
            app:button_numeric_textsize="13sp"
            app:button_alpha_textsize="0sp"
            app:button_drawable_size="24dp"
            app:pin_length="4"
            app:pin_indicator_size="15sp"
            app:pin_indicator_stroke_width="1dp"/>

Java Usage

You can also make use of the PinPadView via Java code. Typical usage looks like:

pinPadView.setPromptText("Please enter your PIN");
pinPadView.setPromptTextColor(Color.WHITE);
pinPadView.setPinLength(4);
pinPadView.setOnPinChangedListener(new PinPadView.OnPinChangedListener() {
    @Override
    public void onPinChanged(String oldPin, String newPin) {
        // listen for pin changes
    }
});
pinPadView.onSubmitListener(new PinPadView.onSubmitListener() {
    @Override
    public void onCompleted(String pin) {
        // listen for when the "done" button is clicked
        // and the pin is complete
    }
    @Override
    public void onIncompleteSubmit(String pin) {
        // listen for when the "done" button is clicked
        // and the pin is incomplete
    }
});

You can ultimately combine both XML usage and Java usage to suit your use case.

Contributing

Contributions are welcome. Contributions guide is coming soon.

library-android-pinpad's People

Contributors

ibrahimlawal avatar segunfamisa avatar michael-paystack avatar eyitemi-paystack avatar blundell avatar jubril-paystack avatar loknan-paystack avatar peter-john-paystack 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.