{"id":21130352,"url":"https://github.com/DavidPizarro/PinView","last_synced_at":"2025-07-09T01:33:22.569Z","repository":{"id":92008875,"uuid":"41357904","full_name":"DavidPizarro/PinView","owner":"DavidPizarro","description":"A Pin view widget for Android","archived":false,"fork":false,"pushed_at":"2016-01-08T11:36:28.000Z","size":9875,"stargazers_count":288,"open_issues_count":9,"forks_count":63,"subscribers_count":11,"default_branch":"master","last_synced_at":"2023-11-07T15:23:43.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/DavidPizarro.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":"2015-08-25T10:30:48.000Z","updated_at":"2023-06-19T00:38:38.000Z","dependencies_parsed_at":"2023-05-18T18:01:15.042Z","dependency_job_id":null,"html_url":"https://github.com/DavidPizarro/PinView","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidPizarro%2FPinView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidPizarro%2FPinView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidPizarro%2FPinView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidPizarro%2FPinView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidPizarro","download_url":"https://codeload.github.com/DavidPizarro/PinView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476370,"owners_count":17480215,"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":[],"created_at":"2024-11-20T05:32:38.582Z","updated_at":"2024-11-20T05:32:47.027Z","avatar_url":"https://github.com/DavidPizarro.png","language":"Java","readme":"# PinView \r\n\r\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-PinView-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2411) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.davidpizarro/pinview/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.davidpizarro/pinview) [![Android Gems](http://www.android-gems.com/badge/DavidPizarro/PinView.svg?branch=master)](http://www.android-gems.com/lib/DavidPizarro/PinView)\r\n\r\nA Pin view widget for Android. PinView has a feature that allows you to find out when they have completed all parameters. \r\nSupport for Android 3.0 and up. It supports portrait and landscape mode, saving the state.\r\n\r\n![Example screenshot](art/screenshots_framed.png)\r\n\r\nTry out the sample application on [Google Play][1].\r\n\r\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.dpizarro.libraries.pinview\"\u003e\r\n  \u003cimg alt=\"PinView Sample on Google Play\"\r\n         src=\"http://developer.android.com/images/brand/en_app_rgb_wo_45.png\" /\u003e\r\n\u003c/a\u003e\r\n\r\nDemo\r\n=========================\r\n\r\n![Example gif](art/demo.gif)\r\n\r\nIncluding in Your Project\r\n=========================\r\n\r\nLast version is 1.0.0\r\n\r\nJust add the following statement in your build.gradle\r\n\r\n    compile 'com.github.davidpizarro:pinview:VERSION'\r\n    \r\nYou may also add the library as an Android Library to your project. All the library files live in ```library```.\r\n\r\nUsage\r\n=====\r\n\r\nTo add the PinView to your layout, add this to your xml\r\n```xml\r\n\u003ccom.dpizarro.pinview.library.PinView\r\n        android:id=\"@+id/pinView\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"/\u003e\r\n```  \r\n\r\nYou can add custom attributes in your xml to customize: pin boxes number, splits, number of characters in pin boxes, styles, mask password, titles, drawables, sizes, colors, behaviors...\r\n```xml\r\n\r\n\u003ccom.dpizarro.pinview.library.PinView\r\n            android:id=\"@+id/pinView\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            pinview:titles=\"@array/small_titles\"\r\n            pinview:password=\"true\"\r\n            pinview:numberPinBoxes=\"4\"\r\n            pinview:split=\"-\"\r\n            pinview:numberCharacters=\"2\"\r\n            pinview:deleteOnClick=\"false\"\r\n            pinview:keyboardMandatory=\"false\"\r\n            pinview:nativePinBox=\"false\"\r\n            pinview:textSizePinBox=\"@dimen/size_text_pinbox\"\r\n            pinview:textSizeTitles=\"@dimen/size_titles\"\r\n            pinview:drawablePinBox=\"@drawable/custom_pinbox\"\r\n            pinview:sizeSplit=\"@dimen/size_split\"\r\n            pinview:colorSplit=\"@color/color_splits\"\r\n            pinview:colorTextPinBox=\"@android:color/black\"\r\n            pinview:colorTextTitles=\"@color/color_title\"/\u003e\r\n        \r\n```\r\nReview [attrs.xml][3] file to know the list of shapes ready to be used in the library.\r\n\r\n\r\nThis configuration can be also provided programmatically. You can use PinView programatically, using the Builder class to set the settings and the desired functionalities to make easy:\r\n```java\r\nPinView pinView = (PinView) view.findViewById(R.id.pinView);\r\n\r\nPinViewSettings pinViewSettings = new PinViewSettings.Builder()\r\n                                                     .withPinTitles(titlesAux)\r\n                                                     .withMaskPassword(true)\r\n                                                     .withDeleteOnClick(true)\r\n                                                     .withKeyboardMandatory(false)\r\n                                                     .withSplit(\"-\")\r\n                                                     .withNumberPinBoxes(5)\r\n                                                     .withNativePinBox(false)\r\n                                                     .build();\r\n\r\npinView.setSettings(pinViewSettings);\r\n```\r\n\r\nYou can set/get values programatically:\r\n```java\r\nmPinView.setPin(5);\r\nmPinView.setTitles(getResources().getStringArray(R.array.titles));\r\nmPinView.setMaskPassword(true);\r\nmPinView.setDeleteOnClick(true);\r\nmPinView.setNativePinBox(true);\r\nmPinView.setCustomDrawablePinBox(R.drawable.pin_box);\r\nmPinView.setKeyboardMandatory(false);\r\nmPinView.setSplit(\"**\");\r\nmPinView.setColorTitles(Color.rgb(255, 0, 128));\r\nmPinView.setColorTextPinBoxes(Color.rgb(200, 57, 222));\r\nmPinView.setColorSplit(Color.rgb(0, 0, 0));\r\nmPinView.setSizeSplit(getResources().getDimension(R.dimen.size_split));\r\nmPinView.setTextSizePinBoxes(getResources().getDimension(R.dimen.size_pinboxes));\r\nmPinView.setTextSizeTitles(getResources().getDimension(R.dimen.size_titles));\r\n```\r\n\r\nWe can use a Listener to notify us when we could do Login and the returned value. You will need to implement `OnCompleteListener` interface.\r\n```java\r\npinView.setOnCompleteListener(new PinView.OnCompleteListener() {\r\n            @Override\r\n            public void onComplete(boolean completed, final String pinResults) {\r\n                //Do what you want\r\n                if (completed) {\r\n                    doLogin(pinResults);\r\n                }\r\n            }\r\n        });\r\n```\r\n\r\nOr browse the [source code of the sample application][2] for a complete example of use.\r\n\r\nContribution\r\n============\r\n\r\n#### Pull requests are welcome!\r\n\r\nI'd like to improve this library with your help!\r\nIf you've fixed a bug or have a feature you've added, just create a pull request. Issues can be reported on the github issue tracker.\r\n\r\nAuthor\r\n-------\r\n\r\nDavid Pizarro (dpizarro89@gmail.com)\r\n\r\n\u003ca href=\"https://plus.google.com/u/0/110797503395500685158\"\u003e\r\n  \u003cimg alt=\"Follow me on Google+\"\r\n       src=\"https://raw.githubusercontent.com/DavidPizarro/android-live-templates/master/art/google.png\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://twitter.com/DavidPizarro89\"\u003e\r\n  \u003cimg alt=\"Follow me on Twitter\"\r\n       src=\"https://raw.githubusercontent.com/DavidPizarro/android-live-templates/master/art/twitter.png\" /\u003e\r\n\u003c/a\u003e\r\n\u003ca href=\"https://www.linkedin.com/in/davidpizarrodejesus\"\u003e\r\n  \u003cimg alt=\"Follow me on LinkedIn\"\r\n       src=\"https://raw.githubusercontent.com/DavidPizarro/android-live-templates/master/art/linkedin.png\" /\u003e\r\n\u003c/a\u003e\r\n\r\n\r\nLicense\r\n-------\r\n\r\n    Copyright 2015 David Pizarro\r\n\r\n    Licensed under the Apache License, Version 2.0 (the \"License\");\r\n    you may not use this file except in compliance with the License.\r\n    You may obtain a copy of the License at\r\n\r\n       http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n    Unless required by applicable law or agreed to in writing, software\r\n    distributed under the License is distributed on an \"AS IS\" BASIS,\r\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n    See the License for the specific language governing permissions and\r\n    limitations under the License.\r\n---\r\n\r\n[1]: https://play.google.com/store/apps/details?id=com.dpizarro.libraries.pinview\r\n[2]: https://github.com/DavidPizarro/PinView/tree/master/app\r\n[3]: https://github.com/DavidPizarro/PinView/blob/master/library/src/main/res/values/attrs.xml\r\n","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavidPizarro%2FPinView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDavidPizarro%2FPinView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavidPizarro%2FPinView/lists"}