{"id":21702428,"url":"https://github.com/hamadakram/ratifier","last_synced_at":"2025-04-12T14:51:48.665Z","repository":{"id":107361308,"uuid":"84653211","full_name":"Hamadakram/Ratifier","owner":"Hamadakram","description":"Ratifier is a form validation library for Android. ","archived":false,"fork":false,"pushed_at":"2017-03-28T05:13:33.000Z","size":1853,"stargazers_count":122,"open_issues_count":1,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T09:21:33.269Z","etag":null,"topics":["android","easy-to-use","form","html","java","library","validation"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hamadakram.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}},"created_at":"2017-03-11T13:49:33.000Z","updated_at":"2024-09-25T05:54:33.000Z","dependencies_parsed_at":"2024-01-14T11:18:30.650Z","dependency_job_id":"1ce339ed-8498-4556-849d-2115ab4ea13c","html_url":"https://github.com/Hamadakram/Ratifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamadakram%2FRatifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamadakram%2FRatifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamadakram%2FRatifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hamadakram%2FRatifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hamadakram","download_url":"https://codeload.github.com/Hamadakram/Ratifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586261,"owners_count":21128995,"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","easy-to-use","form","html","java","library","validation"],"created_at":"2024-11-25T21:15:34.124Z","updated_at":"2025-04-12T14:51:48.637Z","avatar_url":"https://github.com/Hamadakram.png","language":"Java","readme":"\n# Ratifier\nRatifier is a form validation library for Android.\n![alt tag](https://raw.githubusercontent.com/Hamadakram/Ratifier/master/app/logo.jpeg)\n![](https://github.com/Hamadakram/Ratifier/blob/master/app/screencast.gif)\n## Download\nGrab via Gradle:\n```\ncompile 'com.irozon.ratifier:ratifier:1.0.0'\n```\nOr Maven:\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.irozon.ratifier\u003c/groupId\u003e\n  \u003cartifactId\u003eratifier\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n``` \n## How do i use Ratifier?\nTo use Ratifier as your form validator, use RatifierEditText and Ratifier will handle everything.\nExample for Email:\n```java\n \u003ccom.irozon.ratifier.RatifierEditText\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:inputType=\"textEmailAddress\"\n        app:emptyMessage=\"Enter email\"\n        app:invalidMessage=\"Enter valid email\"\n        app:required=\"true\" /\u003e\n```\nAnd to validate use\n```java\nRatifier.Valid result = Ratifier.getValidity(this);\nif (result.isValid()) { // Form is valid\n    Toast.makeText(this, \"Email is valid\", Toast.LENGTH_SHORT).show();\n} else { // Form is not valid\n    Toast.makeText(this, ratify.getErrorMsg(), Toast.LENGTH_SHORT).show();\n}\n```\n## Attributes\nFollowing are the attributes used by **RatifierEditText** for validation\n\n| Attribute | Descripion |\n| ------ | ------ |\n| required | If field is required for validation or not (true/false) |\n| emptyMessage | Message for empty field |\n| invalidMessage | Message for invalid field |\n| inputType | **textEmailAddress**, **textPassword** for email and password validation. Ratifier will validate for match password also if two fields with inputType **textPassword** are provided. In case of invalidation, Invalid message must be provided |\n| minCharacters | Minimum characters. Invalid message must be provided for this. |\n| regex | For validation using regex like valid phone number, credit card, IP address etc. Invalid message must be provided for this. |\n\n**Values can be set from activity by:**\n```java\nratifierEditText.setEmptyMessage(\"Filed is empty\");\nratifierEditText.setInvalidMessage(\"Password should be greater than 4 characters\");\nratifierEditText.setRegex(\"/^(\\+\\d{1,3}[- ]?)?\\d{10}$/\"); // Regex for valid mobile number\nratifierEditText.setMinCharacters(4);\n```\nRemember to give regex from **Strings.xml**\n\n## Ratifier Results\nRatifier validity result will give us:\n```java\n Ratifier.Valid result = Ratifier.getValidity(this);\n boolean isValid = result.isValid(); // boolean - If the result is valid or not.\n String errorMessage = result.getErrorMsg(); // String - Error Message if result is not valid.\n RatifierEditText ratifierEditText = result.getField(); // Will return RatifierEditText which is not valid.\n```\n - ***isValid()*** - boolean - If the result is valid or not.\n - ***getErrorMsg()*** - String - Error Message if result is not valid.\n - ***getField()*** - RatifierEditText - Will return **RatifierEditText** which is not valid\n\n\n## Some Regex examples:\n\n**Mobile Number**: /^(\\+\\d{1,3}[- ]?)?\\d{10}$/\n\n**Email Address**: /^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/\n\n**URL**: /^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/\n\n**IP Address**:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/\n\netc\n\n## Authors\n\n* **Hammad Akram** - (https://github.com/hamadakram)\n* **Shafqat Jamil** - (https://github.com/shafqatjamil)\n\n## Licence\n```\nCopyright 2017 Irozon, Inc.\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamadakram%2Fratifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamadakram%2Fratifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamadakram%2Fratifier/lists"}