segunfamisa / android-pinpad

A PinPad for android apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Pinpad

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.

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:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@android:color/black"
    app:pin_indicator_color="@android:color/white"
    app:pin_indicator_size="15dp"
    app:pin_indicator_stroke_width="4dp"
    app:pin_indicator_spacing="24dp"
    app:pin_length="4"
    app:text_color="@android:color/white"
    app:text_prompt="Please enter your PIN"
    app:prompt_textsize="15sp"
    app:button_numeric_textsize="18sp"
    app:button_alpha_textsize="8sp"
    app:button_drawable_size="32dp"/>

Java Usage

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

pinPadView.setPromptText("Please enter your PIN");
pinPadView.setTextColor(Color.WHITE);
pinPadView.setPinLength(4);
pinPadView.setOnPinChangedListener(new PinPadView.OnPinChangedListener() {
    @Override
    public void onPinChanged(String oldPin, String newPin) {
        // listen for pin changes
    }

    @Override
    public void onCompletedListener(String pin) {
        // listen for when the "done" button is clicked
    }
});

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

Contributing

Contributions are welcome. Contributions guide is coming soon.

About

A PinPad for android apps

License:Apache License 2.0


Languages

Language:Java 100.0%