This is an Android library for a pin pad view.
Typical usage of this library is via Java code or in the XML layouts.
<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"/>
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.
Contributions are welcome. Contributions guide is coming soon.