{"id":13645312,"url":"https://github.com/GoodieBag/Pinview","last_synced_at":"2025-04-21T14:30:27.860Z","repository":{"id":46311091,"uuid":"78631270","full_name":"GoodieBag/Pinview","owner":"GoodieBag","description":"A pinview library for android. :sparkles:","archived":false,"fork":false,"pushed_at":"2024-02-20T13:14:10.000Z","size":288,"stargazers_count":786,"open_issues_count":41,"forks_count":119,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-04-29T07:21:29.216Z","etag":null,"topics":["android","android-library","java","library","otp","otpview","pinview","pinview-library","xml"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodieBag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-01-11T11:10:31.000Z","updated_at":"2024-06-15T06:44:06.391Z","dependencies_parsed_at":"2024-06-15T06:44:05.412Z","dependency_job_id":"51602b41-2030-4a06-b519-78711c16be29","html_url":"https://github.com/GoodieBag/Pinview","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodieBag%2FPinview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodieBag%2FPinview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodieBag%2FPinview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodieBag%2FPinview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodieBag","download_url":"https://codeload.github.com/GoodieBag/Pinview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223780158,"owners_count":17201283,"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","java","library","otp","otpview","pinview","pinview-library","xml"],"created_at":"2024-08-02T01:02:33.388Z","updated_at":"2024-11-09T18:30:52.621Z","avatar_url":"https://github.com/GoodieBag.png","language":"Kotlin","funding_links":[],"categories":["PinCode"],"sub_categories":[],"readme":"# Pinview\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Pinview-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5394)\n[![Release](https://jitpack.io/v/GoodieBag/Pinview.svg)](https://jitpack.io/#GoodieBag/Pinview)\n[![API](https://img.shields.io/badge/API-15%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=15)\n\n Pinview library for android :pouting_cat:\n \n![alt tag](https://media.giphy.com/media/U5BP5gk9zQaqs/giphy.gif)       ![alt_tag](https://media.giphy.com/media/CnCvLh9NT6Hio/giphy.gif)\n\n## Gradle Dependency\n\nAdd this in your root build.gradle file at the end of repositories:\n```java\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\nAdd dependency:\n\nLatest Version:\n\nHas improvements and bug fixes - [Release notes](https://github.com/GoodieBag/Pinview/releases/tag/v1.5)\n```java\ndependencies {\n\t   implementation 'com.github.GoodieBag:Pinview:v1.5'\n\t}\n```\nOR \n\nStable version : \n \n```java\ndependencies {\n\t   implementation 'com.github.GoodieBag:Pinview:v1.4'\n\t}\n```\nSync the gradle and that's it! :+1:\n\n### Features : \n * Flawless focus change to the consecutive pin box when the text is entered/deleted.\n * When the user taps on the Pinview, the first empty box available is focused automatically (when the cursor is hidden).\n * Listeners for onDataEntered ( To call an API when the pin is entered) and touch exists.\n * Customisations are available for pin box sizes, background(drawables, selectors), inputType etc.\n \n## Usage\n\n### XML : \n```xml\n\u003ccom.goodiebag.pinview.Pinview\n        android:id=\"@+id/pinview\"\n        app:pinBackground=\"@drawable/example_drawable\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        app:pinWidth=\"40dp\"\n        app:pinHeight=\"40dp\"\n        app:pinLength=\"4\"\n        app:cursorVisible=\"false\"\n\tapp:forceKeyboard=\"true\"\n        app:hint=\"0\"\n        app:inputType=\"text\"\n        app:password=\"false\"/\u003e\n```\nThis can be referenced in the java class by the ```findViewById``` method.\n\n##### Available xml attributes and explanations : \n\n```app:pinBackground``` : Sets the pin box's background, accepts a drawable or a selector drawable. When a ```selector``` is used, the focused pin box is highlighted. \u003cbr /\u003e\n```app:pinWidth``` and ```app:pinHeight``` : Sets the width and height of the pinbox. \u003cbr /\u003e\n```app:pinLength``` : number of pin boxes to be displayed.\u003cbr /\u003e\n```app:forceKeyboard``` : forces the keyboard when the pinview is activity/fragment is opened.\n```app:cursorVisibility``` : Toggles cursor visibility.\u003cbr /\u003e\n```app:hint``` : Pin box hint. \u003cbr /\u003e\n```app:inputType``` : Accepts ```number``` or ```text``` as values. \u003cbr /\u003e\n```app:password``` : Masks the pin value with ```*``` when true. \u003cbr /\u003e\n```app:splitWidth``` : Determines the width between two pin boxes.\n\n### Kotlin :\n\nTo create the view programmatically : \n```kotlin\nval pin = Pinview(this)\n```\nOr reference it from findViewById\n```kotlin\nval pin = findViewById\u003cPinview\u003e(R.id.pinview)\npin.apply {\n    setPinBackgroundRes(R.drawable.sample_background);\n    pinHeight = 40\n    pinWidth = 40\n    setInputType(Pinview.InputType.NUMBER);\n    value = \"1235\"\n       }\nmyLayout.addView(pin)\n```\n\n### Java :\n\nTo create the view programmatically :\n```java\nPinview pin = new Pinview(this);\n```\nOr reference it from findViewById\n```java\npin = (Pinview) findViewById(R.id.pinview);\npin.setPinBackgroundRes(R.drawable.sample_background);\npin.setPinHeight(40);\npin.setPinWidth(40);\npin.setInputType(Pinview.InputType.NUMBER);\npin.setValue(\"1234\");\nmyLayout.addView(pin);    \n```\n\n##### To get and set the pin values use the ```pin.getValue()``` and ```pin.setValue()``` methods respectively.\n\nThere is an event listener which is triggered when the user is done entering the otp which can be used as follows : \n```kotlin\n pin.setPinViewEventListener(object : PinViewEventListener {\n            override fun onDataEntered(pinview: Pinview?, fromUser: Boolean) {\n                Toast.makeText(this@MainActivity, pinview!!.value, Toast.LENGTH_SHORT).show()\n            }\n        })\n```\n#### Note : \nThis library cannot be assured to work on 3rd party keyboards (especially when the cursor is off). It works as expected on google keyboards.\nWe will be adding a work-around in the future releases.\n\n## LICENSE\n```\nMIT License\n\nCopyright (c) 2017 GoodieBag\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoodieBag%2FPinview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGoodieBag%2FPinview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGoodieBag%2FPinview/lists"}