{"id":21942014,"url":"https://github.com/malekkamel/formvalidator","last_synced_at":"2025-10-07T08:13:39.991Z","repository":{"id":27168399,"uuid":"110319898","full_name":"MalekKamel/FormValidator","owner":"MalekKamel","description":"A declarative Form Validation for Android, simple, clean, and customizable.","archived":false,"fork":false,"pushed_at":"2024-08-01T23:57:19.000Z","size":76644,"stargazers_count":88,"open_issues_count":3,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T17:51:43.287Z","etag":null,"topics":["android","android-library","android-sdk","edittext","rxandroid","rxandroid2","rxjava","validation"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/MalekKamel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-11-11T05:10:20.000Z","updated_at":"2024-08-28T11:49:59.000Z","dependencies_parsed_at":"2024-11-30T08:31:14.520Z","dependency_job_id":null,"html_url":"https://github.com/MalekKamel/FormValidator","commit_stats":null,"previous_names":["malekkamel/formvalidator"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/MalekKamel/FormValidator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FFormValidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FFormValidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FFormValidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FFormValidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MalekKamel","download_url":"https://codeload.github.com/MalekKamel/FormValidator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MalekKamel%2FFormValidator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278740852,"owners_count":26037482,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","android-sdk","edittext","rxandroid","rxandroid2","rxjava","validation"],"created_at":"2024-11-29T03:16:11.578Z","updated_at":"2025-10-07T08:13:39.968Z","avatar_url":"https://github.com/MalekKamel.png","language":"Kotlin","readme":"\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/ShabanKamell/FormValidator\"\u003e\u003cimg src=\"https://github.com/ShabanKamell/FormValidator/blob/master/blob/logo.png?raw=true\" alt=\"Gray shape shifter\" height=\"200\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eFormValidator\u003c/h1\u003e\n\u003cp align=\"center\"\u003eThe easiest, most clean Android form validation.\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://jitpack.io/#ShabanKamell/FormValidator\"\u003e \u003cimg src=\"https://jitpack.io/v/ShabanKamell/FormValidator.svg\" height=\"20\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://twitter.com/intent/tweet?text=FormValidator,%20a%20declarative%20form%20validation%20for%20Android,%20simple,%20clean,%20and%20customizable.\u0026url=https://github.com/ShabanKamell/FormValidator\u0026hashtags=android,kotlin,java,library,developers\"\u003e\u003cimg src=\"https://img.shields.io/twitter/url/http/shields.io.svg?style=social\" height=\"20\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\u003cbr/\u003e\u003cbr/\u003e\n\nA declarative Form Validation for Android, simple, clean, and customizable.\n\nEvery time you create a form, you need to declare fields and write code for for validating each field in the form, and this results in many ```if else``` and a lot of boilerplate. For these reasons **FormValidator** is here, just declare your fields in XML and its validation and all things will be done for you!\n\n\u003cimg src=\"https://github.com/ShabanKamell/FormValidator/blob/master/blob/master/raw/diagragm.png\" height=\"600\"\u003e\n\n# Table of contents\n\n- [Usage](#usage)\n- [Installation](#installation)\n- [Widgets](#widgets)\n  - [TextView Widgets](#textview-widgets)\n  - [Other Widgets](#other-widgets)\n- [Validatable interface](#validatable-interface)\n- [Form Layout](#form-layout)\n- [TextView Validation](#textview-validation)\n- [Credit](#credit)\n- [License](#-license)\n\n# Usage\n```xml\n\u003ccom.sha.formvalidator.Form \u003e\n    \u003ccom.sha.formvalidator.widget.FormEditText \n    \tapp:validationType=\"email\"\n     /\u003e\n    \n    \u003ccom.sha.formvalidator.widget.FormCheckBox \n    \tapp:checkBoxValidation=\"checked\"\n     /\u003e\n    \n    \u003ccom.sha.formvalidator.widget.FormToggleButton \n    \tapp:toggleButtonValidation=\"on\"\n     /\u003e\n    \n    \u003ccom.sha.formvalidator.widget.FormSwitch \n    \tapp:switchValidation=\"on\"\n     /\u003e\n\u003c/com.sha.formvalidator.Form\u003e\n```\n\nTo trigger validation:\n\n```kotlin\nval isFormValid = findViewById\u003cForm\u003e(R.id.form).validate()\n```\n\nIn case you don't need `Form`, you can use `FormEditText` just like any regular field and you can trigger validation using:\n\n```kotlin\nval isValid = emailFormEditText.validate()\n``` \n\n#### Note\nYou can nest the fields inside `Form` layout layout in any levels you need:\n\n```xml\n\u003ccom.sha.formvalidator.Form\u003e\n  \n    \u003cLinearLayout\u003e\n         \u003cRelativeLayout\u003e\n                 \u003ccom.sha.formvalidator.widget.FormEditText \n                \tapp:validationType=\"email\"\n                  /\u003e\n          \u003c/RelativeLayout\u003e\n    \u003c/LinearLayout\u003e\n\u003c/com.sha.formvalidator.Form\u003e\n```\n\n## Installation\n\n#### Gradle:\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url \"https://jitpack.io\" }\n    }\n}\n\ndependencies {\n        // Core\n        implementation 'com.github.ShabanKamell.FormValidator:core:x.y.z'\n        // RxJava\n        implementation 'com.github.ShabanKamell:FormValidator:x.y.z'\n}\n```\n\n(Please replace x, y and z with the latest version numbers: [![](https://jitpack.io/v/ShabanKamell/FormValidator.svg)](https://jitpack.io/#ShabanKamell/FormValidator))\n\n## Widgets\nFormValidator has a collection of different widgets that implement `Validatable`. There're `TextView` widgets and other widgets.\n\n### TextView Widgets\n\n|         **Widget**           |                **Required attributes**             |      **Default**       |\n| --------------------------   | -------------------------------------------------- | ---------------------  |\n| **FormEditText**             |  see [TextView Validation](#textview-validation)   |        -               |\n| **FormAutoCompleteTextView** |  see [TextView Validation](#textview-validation)   |        -               |\n\n### Other Widgets\n\n|         **Widget**           |                **Required attributes**             |      **Default**       |\n| --------------------------   | -------------------------------------------------- | ---------------------  |\n| **FormCheckBox**             |  checkBoxValidation                                |        checked         |\n| **FormRatingBar**            |  ratingBarValidation                               |        required        |\n| **FormSeekBar**              |  seekBarValidation                                 |        required        |\n| **FormSwitch**               |  switchValidation                                  |        on              |\n| **FormToggleButton**         |  toggleButtonValidation                            |        on              |\n\n## Validatable interface\n```Validatable``` is a fubctional interface implemented by widgets to support validation.\n\n``` kotlin\ninterface Validatable {\n    // return true if valid, false otherwise.\n    fun validate(): Boolean\n}\n```\n## Form Layout\n`Form` is a LinearLayout that warps all widgets and provides APIs for triggering validation with options.\n\nDeclare `Form` in XML\n``` kotlin\n\u003ccom.sha.formvalidator.Form\n        ..\n        android:id=\"@+id/form\"\n        app:shakeOnError=\"true\"\n        app:ignoreHiddenFields=\"true\"\n        \u003e\n    \u003ccom.sha.formvalidator.widget.FormEditText \n    \tapp:validationType=\"email\"\n    ... /\u003e\n    \n    \u003ccom.sha.formvalidator.widget.FormCheckBox \n    \tapp:checkBoxValidation=\"checked\"\n    ... /\u003e\n    \n    \u003ccom.sha.formvalidator.widget.FormToggleButton \n    \tapp:toggleButtonValidation=\"on\"\n    ... /\u003e\n    \n    \u003ccom.sha.formvalidator.widget.FormSwitch \n    \tapp:switchValidation=\"on\"\n    ... /\u003e\n\u003c/com.sha.formvalidator.Form\u003e\n   \n```\nSet options programmatically\n\n``` kotlin\nform.options = FormOptions.create {\n       validationInterceptor = { .. }\n       ignoreFieldsIds = listOf(R.id.etIgnoredId)\n       ignoreHiddenFields = true\n       shakeOnError = true\n}\n```\n\nTrigger Validation\n\n``` kotlin\nval isValid = form.validate()\n\n// OR\nform.validateOnClick(btnValidateForm) { isValid -\u003e ..}\n```\n\n## TextView Validation\nFormValidator contains rich validators for validating ```TextView```. There're are 2 predefined widgets that inherit from `TextView`: `FormEditText` and `FormAutoCompleteTextView`. see full documentation in  👉 👉 [TextView Validation](https://github.com/ShabanKamell/FormValidator/blob/dev/TEXTVIEW.md)\n\n\n### See 'sample' module for the full code.\n\n### Credit\n [Android Form EditText](https://github.com/vekexasia/android-edittext-validator).\n \n### 🛡 License\n\u003cdetails\u003e\n    \u003csummary\u003e\n        click to reveal License\n    \u003c/summary\u003e\n    \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\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalekkamel%2Fformvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalekkamel%2Fformvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalekkamel%2Fformvalidator/lists"}