Pin-view - A Kotlin library that integrates a customized Pin code View to your project

Related tags

App pin-view
Overview

languages jitpack lastcommit codesize

PinView - Kotlin library

A customizable Pin Code entry view that can be used as a user login authentication method in your project.

Installation

  1. in project's build.gradle , add jitPack.io as following
	allprojects {
	   repositories {
           .....
           .....
	      maven { url "https://jitpack.io" }
	   }
	}
  1. in module's build.gradle , add the implementation as following
dependencies {
        .....
        .....
        implementation 'com.github.khaled2252:pin-view:1.0.0'
    }

Usage

  1. Add PinView to your acivity/fragment.xml
 <com.khaledahmedelsayed.pinview.PinView
        android:id="@+id/pinView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:errorMessageText="Invalid Pin Code"
        app:dotProgressColor="@android:color/holo_purple"
        app:titleName="Enter Pin Code">
    </com.khaledahmedelsayed.pinview.PinView>
  1. Reference it in your activity/fragment class

    pinView.clearPin()
    pinView.deleteLastPin()

    Methods

    pinView.clearPin() -> clears current pin progress

    pinView.deletePin() -> deletes last pin code number

    pinView.showError(true) -> displays an error message

    pinView.showError(false) -> hides the error message

    pinView.isErrorVisible() -> returns true if the error message is visible

    Listeners

    There are 2 listeners that can be used as following :-

    1. OnCompletedListener() which is called when user enters the 4th pin number
    pinView.setOnCompletedListener = { pinCode ->
    
            if(pinCode == "1234")
                startActivity(Intent(this,HomeActivity::class.java))
    
            else
                pinView.showError(true)
    
            pinView.clearPin()
        }
    1. onPinKeyClickedListener() which is called when user clicks on any key in the pin keyboard (except for the 4th pin number)
        pinView.setOnPinKeyClickListener = { keyPressed ->
            Toast.makeText(this,"Key pressed was $keyPressed",Toast.LENGTH_SHORT).show()
        }

Customization

You can customize PinView's attributes using app namespace in xml as following :-

app:titleTextColor=""

app:titleTextSize=""

app:dotProgressColor=""

app:dotUnProgressColor=""

app:dotRadius=""

app:numbersTextColor=""

app:numbersTextSize=""

app:deleteButtonColor=""

app:clearButtonColor=""

app:errorMessageText=""

app:errorMessageTextSize=""

app:errorMessageColor=""

Changelog

Version: 1.0

  • Initial Build

License

Copyright 2020 Khaled

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Taskify - An app to manage your daily tasks and boost your productivity. Taskify is built using kotlin and follows all modern android Development practices and hence is a good learning resource for beginners
Taskify - An app to manage your daily tasks and boost your productivity. Taskify is built using kotlin and follows all modern android Development practices and hence is a good learning resource for beginners

Taskify Taskify is an app to manage your daily tasks and boost your productivity Video Introduction 📹 This is a small introduction video about Taskif

Healthify - An app to track your daily water intake and sleep and boost your work efficiency. Healthify is built using Kotlin and follows all modern android Development practices and hence is a good learning resource for beginners
Healthify - An app to track your daily water intake and sleep and boost your work efficiency. Healthify is built using Kotlin and follows all modern android Development practices and hence is a good learning resource for beginners

Healthify Healthify is an app to track your daily water intake and sleep and boost your work efficiency. Video Introduction 📹 This is a small introdu

This project shows trending github repositories using MVI (Model View Intent) using kotlin flows and multi module clean architecture

GithubTrendingMVIFlow Build Architecture: This project shows trending github repositories using MVI (Model View Intent) using kotlin flows and multi m

Forage-project - This is a project given by Google Android Developers team. It's specifically created for data persistance.

Forage - Starter Code Starter code for the fifth independent project for Android Basics in Kotlin. This project pairs with Unit 5 of Android Basics in

Civihelper-project - This is our first android project .

Civihelper-project Problem-- Time taking and cumbersome conventional way to submit your civil problems. Proposed soln--- A platform to provide the sub

Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project
Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project

Connect is an Android Application to connect people for a project and can then work on the application to efficiently complete the project

Shot is an Android project you can use to write screenshot for your apps in a simple and friendly way
Shot is an Android project you can use to write screenshot for your apps in a simple and friendly way

Shot is an Android project you can use to write screenshot for your apps in a simple and friendly way. What is this? Shot is a Gradle plugin and

Easy app for managing your files without ads, respecting your privacy & security
Easy app for managing your files without ads, respecting your privacy & security

Simple File Manager Can also be used for browsing root files and SD card content. You can easily rename, copy, move, delete and share anything you wis

Releases(1.0.0)
Owner
Khaled Ahmed
Khaled Ahmed
Source code of JekyllEx Android App which can manage your Jekyll blog directly from your Android device!

JekyllEx Android App Built with ❤︎ by Gourav Khunger ?? Introduction JekyllEx is an Android App that allows you to manage a Jekyll Blog directly from

JekyllEx 24 Nov 8, 2022
📱 Android Library to implement Rich, Beautiful, Stylish 😍 Material Navigation View for your project with Material Design Guidelines. Easy to use.

Material NavigationView for Android ?? ?? Android Library to implement Rich, Beautiful Material Navigation View for your project with Material Design

Shreyas Patil 198 Dec 17, 2022
Idaesbasic - An all in one project manager that stores everything in files directly into your project! 🤯

Idaesbasic - Project-Managment redefined Idaesbasic Everything is a file ?? With this project managment tool, everything is a file. Your todolists are

Ben Herbst 123 Nov 11, 2022
Advent of Code template project for Kotlin

Advent of Code Kotlin Template Advent of Code – an annual event in December since 2015. Every year since then, with the first day of December, a progr

Kotlin Hands-On Labs 336 Dec 23, 2022
Android + Kotlin Project for the 2022 edition of the Open Source Contribution competition, JGEC Winter of Code aka JWoC.

QuotesApp-JWoC Android + Kotlin Project for the 2022 edition of the Open Source Contribution competition, JGEC Winter of Code aka JWoC. ?? Project Obj

null 4 Feb 16, 2022
Cody Engel 2 Apr 20, 2022
Starter code for the fourth independent project for Android Basics in Kotlin

Amphibians - Starter Code Starter code for the fourth independent project for Android Basics in Kotlin. This project pairs with Unit 4 of Android Basi

Philipp 0 Apr 11, 2022
Advent of Code project 2021!

aoc-2021 Welcome to the Advent of Code1 Kotlin project created by goddabuzz using the Advent of Code Kotlin Template delivered by JetBrains. In this r

Daniel Kloosterman 2 Dec 14, 2022
Auto-pipeline: a source code generator, it will generate your component's pipeline

auto-pipeline ?? auto-pipeline is a source code generator, it will generate your

Zava 106 Dec 20, 2022