{"id":15034158,"url":"https://github.com/aritraroy/pinlockview","last_synced_at":"2025-05-16T07:07:16.279Z","repository":{"id":42186854,"uuid":"60957572","full_name":"aritraroy/PinLockView","owner":"aritraroy","description":"A clean, minimal, highly customizable pin lock view for Android","archived":false,"fork":false,"pushed_at":"2020-02-12T04:05:28.000Z","size":357,"stargazers_count":1398,"open_issues_count":49,"forks_count":259,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-08T17:17:44.005Z","etag":null,"topics":["android","dialpad","lock","lockscreen","pin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aritraroy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-12T09:02:44.000Z","updated_at":"2025-01-21T20:47:58.000Z","dependencies_parsed_at":"2022-08-05T08:00:11.421Z","dependency_job_id":null,"html_url":"https://github.com/aritraroy/PinLockView","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aritraroy%2FPinLockView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aritraroy%2FPinLockView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aritraroy%2FPinLockView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aritraroy%2FPinLockView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aritraroy","download_url":"https://codeload.github.com/aritraroy/PinLockView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485065,"owners_count":22078767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dialpad","lock","lockscreen","pin"],"created_at":"2024-09-24T20:24:06.322Z","updated_at":"2025-05-16T07:07:14.848Z","avatar_url":"https://github.com/aritraroy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PinLockView\nA clean, minimalistic, easy-to-use and highly customizable pin lock custom view for Android.\n\n### Specs\n[ ![Download](https://api.bintray.com/packages/aritraroy/maven/pin-lock-view/images/download.svg) ](https://bintray.com/aritraroy/maven/pin-lock-view/_latestVersion) [![API](https://img.shields.io/badge/API-11%2B-orange.svg?style=flat)](https://android-arsenal.com/api?level=11) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-PinLockView-green.svg?style=true)](https://android-arsenal.com/details/1/3706)\n\n![PinLockView](https://github.com/aritraroy/PinLockView/blob/master/screens/logo.png)\n\nThis library allows you to implement a pin lock mechanism in your app **easily and quickly**. There are **plenty of customization options** available to change the look-and-feel of this view to match your app's theme.\n\nYou can also use it as a dial pad to dial numbers. There are several other use cases of this library and is not restricted to only pin locking.\n\n![PinLockView](https://github.com/aritraroy/PinLockView/blob/master/screens/promo.png)\n\n# Download\n\nThis library is available in **jCenter** which is the default Maven repository used in Android Studio.\n\n## Gradle \n```gradle\ndependencies {\n    // other dependencies here\n    \n    implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'\n}\n```\n\n## Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.andrognito.pinlockview\u003c/groupId\u003e\n  \u003cartifactId\u003epinlockview\u003c/artifactId\u003e\n  \u003cversion\u003e2.1.0\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n# Usage\nWe recommend you to **check the sample app** to get a complete understanding of the library. The step-by-step implementation guide is as follows.\n\n### Step 1\n\nPlace the view in your XML layout file.\n\n```xml\n    \u003ccom.andrognito.pinlockview.PinLockView\n        android:id=\"@+id/pin_lock_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" /\u003e\n```\n\n### Step 2\n\nReference the view in code and add a listener to it.\n\n```java\n    mPinLockView = (PinLockView) findViewById(R.id.pin_lock_view);\n    mPinLockView.setPinLockListener(mPinLockListener);\n```\n\nImplement the listener interface as follows,\n\n```java\nprivate PinLockListener mPinLockListener = new PinLockListener() {\n    @Override\n    public void onComplete(String pin) {\n        Log.d(TAG, \"Pin complete: \" + pin);\n     }\n\n    @Override\n    public void onEmpty() {\n        Log.d(TAG, \"Pin empty\");\n    }\n\n    @Override\n    public void onPinChange(int pinLength, String intermediatePin) {\n         Log.d(TAG, \"Pin changed, new length \" + pinLength + \" with intermediate pin \" + intermediatePin);\n    }\n};\n```\n\nAnd that's it! Your PinLockView is ready to rock.\n\nBut the good thing is that the ```PinLockView``` comes with a whole lot of customization options which you can use to customize the view in any way you want.\n\n# Customization\n\n## IndicatorDots (Addon)\nPinLockView comes bundled with an addon view, ```IndicatorDots``` which can be optionally attached with the PinLockView to indicate pin changes visually to the user.\n\nThis **view has been decoupled from the PinLockView** so that you can optionally add it, if necessary. Suppose you are implementing a dial pad, then you will certainly not need this IndicatorView.\n\nAdd the view to you XML layout, generally placed above your PinLockView,\n\n```xml\n \u003ccom.andrognito.pinlockview.IndicatorDots\n        android:id=\"@+id/indicator_dots\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\" /\u003e\n```\nthen find a reference to the view and attach it to the parent PinLockView,\n\n```java\nmIndicatorDots = (IndicatorDots) findViewById(R.id.indicator_dots);\nmPinLockView.attachIndicatorDots(mIndicatorDots);\n```\n\nYou **MUST** attach it to the PinLockView, otherwise it will be simply ignored.\n\n## Theming\n\nThere are several theming options available through XML attributes which you can use to completely change the look-and-feel of this view to match the theme of your app.\n\n```xml\n  app:pinLength=\"6\"                                       // Change the pin length\n  app:keypadTextColor=\"#E6E6E6\"                           // Change the color of the keypad text\n  app:keypadTextSize=\"16dp\"                               // Change the text size in the keypad\n  app:keypadButtonSize=\"72dp\"                             // Change the size of individual keys/buttons\n  app:keypadVerticalSpacing=\"24dp\"                        // Alters the vertical spacing between the keypad buttons\n  app:keypadHorizontalSpacing=\"36dp\"                      // Alters the horizontal spacing between the keypad buttons\n  app:keypadButtonBackgroundDrawable=\"@drawable/bg\"       // Set a custom background drawable for the buttons\n  app:keypadDeleteButtonDrawable=\"@drawable/ic_back\"      // Set a custom drawable for the delete button\n  app:keypadDeleteButtonSize=\"16dp\"                       // Change the size of the delete button icon in the keypad\n  app:keypadShowDeleteButton=\"false\"                      // Should show the delete button, default is true\n  app:keypadDeleteButtonPressedColor=\"#C8C8C8\"            // Change the pressed/focused state color of the delete button\n  \n  app:dotEmptyBackground=\"@drawable/empty\"                // Customize the empty state of the dots\n  app:dotFilledBackground\"@drawable/filled\"               // Customize the filled state of the dots\n  app:dotDiameter=\"12dp\"                                  // Change the diameter of the dots\n  app:dotSpacing=\"16dp\"                                   // Change the spacing between individual dots\n  app:indicatorType=\"fillWithAnimation\"                   // Choose between \"fixed\", \"fill\" and \"fillWithAnimation\"\n```\n\n# Contribution\n\nThis library is quite exhaustive and offers a lot of customization options. If you find a bug or would like to improve any aspect of it, feel free to contribute with pull requests.\n\n# About The Author\n\n### Aritra Roy\n\nAndroid \u0026 Backend Developer. Blogger. Designer. Fitness Enthusiast.\n\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.codexapps.andrognito\u0026hl=en\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/play-store-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e \u003ca href=\"https://blog.aritraroy.in/\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/medium-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e\n\u003ca href=\"http://stackoverflow.com/users/2858654/aritra-roy\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/stackoverflow-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e\n\u003ca href=\"https://twitter.com/aritraroy\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/twitter-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e\n\u003ca href=\"http://linkedin.com/in/aritra-roy\"\u003e\u003cimg src=\"https://github.com/aritraroy/social-icons/blob/master/linkedin-icon.png?raw=true\" width=\"60\"\u003e\u003c/a\u003e\n\n\n# License\n\n```\nCopyright 2017 aritraroy\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faritraroy%2Fpinlockview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faritraroy%2Fpinlockview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faritraroy%2Fpinlockview/lists"}