{"id":13611236,"url":"https://github.com/raheemadamboev/pin-lock-compose","last_synced_at":"2025-04-13T01:35:29.889Z","repository":{"id":119075184,"uuid":"606022058","full_name":"raheemadamboev/pin-lock-compose","owner":"raheemadamboev","description":"🔐 Light library that is beautiful Pin Lock screen for Jetpack Compose","archived":false,"fork":false,"pushed_at":"2023-03-08T17:24:24.000Z","size":9450,"stargazers_count":17,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-01T19:57:00.374Z","etag":null,"topics":["android","android-library","compose-pin-lock","jetpack-compose","jetpack-compose-library","library","lock-compose","pin-compose","pin-lock","pin-lock-compose"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/raheemadamboev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-24T12:25:34.000Z","updated_at":"2024-07-27T16:22:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"9ce9da21-76d1-4ef9-b3ee-3853a4693677","html_url":"https://github.com/raheemadamboev/pin-lock-compose","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fpin-lock-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fpin-lock-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fpin-lock-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raheemadamboev%2Fpin-lock-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raheemadamboev","download_url":"https://codeload.github.com/raheemadamboev/pin-lock-compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223558645,"owners_count":17165163,"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","android-library","compose-pin-lock","jetpack-compose","jetpack-compose-library","library","lock-compose","pin-compose","pin-lock","pin-lock-compose"],"created_at":"2024-08-01T19:01:53.198Z","updated_at":"2025-04-13T01:35:29.877Z","avatar_url":"https://github.com/raheemadamboev.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePin Lock\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://developer.android.com/index.html\"\u003e\u003cimg alt=\"Android\" src=\"https://img.shields.io/badge/platform-android-green.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://jitpack.io/#raheemadamboev/pin-lock-compose\"\u003e\u003cimg alt=\"Version\" src=\"https://jitpack.io/v/raheemadamboev/pin-lock-compose.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://android-arsenal.com/api?level=21\"\u003e\u003cimg alt=\"API\" src=\"https://img.shields.io/badge/API-21%2B-brightgreen.svg?style=flat\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n🔐 \u003cb\u003ePinLock\u003c/b\u003e is a light library to display Pin Lock screen in Jetpack Compose. The library handles saving pin in encrypted file. Integration is very easy and fast.\n\u003c/p\u003e\n\n# Setup\n\nAdd the maven library bucket to the `dependencyResolutionManagement.repositories` block in `settings.gradle.kts` file as follows:\n```kotlin\ndependencyResolutionManagement {\n  ...\n  repositories {\n    ...\n    maven(\"https://jitpack.io\")\n  }\n}\n```\n\nInstall the library to the project in desired module's `build.gradle.kts` file. Replace `\u003ccurrent_version\u003e` with the actual version:\n```kotlin\nimplementation(\"com.github.raheemadamboev:pin-lock-compose:\u003ccurrent_version\u003e\")\n```\n\n# Implementation\n\nFirstly, initialize the library on your `onCreate` of Application class:\n```kotlin\nPinManager.initialize(this)\n```\n\n---\n\nTo add Pin Lock screen, add the `PinLock` composable to your compose area:\n```kotlin\nPinLock(\n  title = { pinExists -\u003e\n    Text(text = if (pinExists) \"Enter your pin\" else \"Create pin\")\n  },\n  color = MaterialTheme.colorScheme.primary,\n  onPinCorrect = {\n    // pin is correct, navigate or hide pin lock\n  },\n  onPinIncorrect = {\n     // pin is incorrect, show error\n  },\n  onPinCreated = {\n     // pin created for the first time, navigate or hide pin lock\n  }\n)\n```\n\nIf there is no saved pin yet, it promtps the user to create pin. If there is saved pin, it promts the user to enter its pin:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"296\" height=\"600\" src=\"https://github.com/raheemadamboev/pin-lock-compose/blob/master/extra/banner_1.gif\" /\u003e\n  \u003cimg width=\"296\" height=\"600\" src=\"https://github.com/raheemadamboev/pin-lock-compose/blob/master/extra/banner_2.gif\" /\u003e\n\u003c/p\u003e\n\n---\n\nIt is also possible to change pin. Just add `ChangePinLock` composable to your compose area:\n```kotlin\nChangePinLock(\n  title = { authenticated -\u003e\n    Text(text = if (authenticated) \"Enter new pin\" else \"Enter your pin\")\n  },\n  color = MaterialTheme.colorScheme.primary,\n  onPinIncorrect = {\n    // pin is incorrect, show error\n  },\n  onPinChanged = {\n    // pin changed, navigate or hide pin lock\n  }\n)\n```\nUse this only if there is already saved pin. If there is no saved pin, use simple `PinLock` instead for creating pin for the first time. When using `ChangePinLock`, firstly it prompts the user to enter original pin. After user succesfully authenticates using his original pin, it prompts the user to creat a new pin:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"296\" height=\"600\" src=\"https://github.com/raheemadamboev/pin-lock-compose/blob/master/extra/banner_3.gif\" /\u003e\n\u003c/p\u003e\n\n---\n\nTo check if saved pin exists:\n```kotlin\nval pinExists = PinManager.pinExists()\n```\n\nTo clear saved pin so user can create brand new pin:\n```kotlin\nPinManager.clearPin()\n```\n\n# Features\n\n- pin lock screen very easily\n- handles encryption and saving pin internally\n- change pin lock screen\n- customizable background color\n- robust to configuration changes\n- backspace to remove last entered pin number\n- incorrect indicator animation\n\n# Demo\n\nYou can install and try demo app. All the features are implemented in the demo from creating pin to changing pin.\n\n\u003ca href=\"https://github.com/raheemadamboev/pin-lock-compose/blob/master/extra/app-debug.apk\"\u003eDownload demo\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"296\" height=\"600\" src=\"https://github.com/raheemadamboev/pin-lock-compose/blob/master/extra/screenshot_1.jpg\" /\u003e\n  \u003cimg width=\"296\" height=\"600\" src=\"https://github.com/raheemadamboev/pin-lock-compose/blob/master/extra/screenshot_2.jpg\" /\u003e\n\u003c/p\u003e\n\n# Projects using this library\n\n**Notepad**: 100 000+ downloads. \n\n\u003ca href=\"https://play.google.com/store/apps/details?id=xyz.teamgravity.notepad\"\u003eGoogle Play Store\u003c/a\u003e\n\n\u003ca href=\"https://github.com/raheemadamboev/notepad-app\"\u003eGithub\u003c/a\u003e\n\n# Licence\n\n```xml\nDesigned and developed by raheemadamboev (Raheem) 2023.\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%2Fraheemadamboev%2Fpin-lock-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraheemadamboev%2Fpin-lock-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraheemadamboev%2Fpin-lock-compose/lists"}