{"id":13611422,"url":"https://github.com/santalu/maskara","last_synced_at":"2025-04-12T14:58:52.415Z","repository":{"id":41093546,"uuid":"99812382","full_name":"santalu/maskara","owner":"santalu","description":"A simple way to format text fields without getting affected by input filters","archived":false,"fork":false,"pushed_at":"2022-09-12T16:43:34.000Z","size":2399,"stargazers_count":603,"open_issues_count":10,"forks_count":68,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-12T14:58:47.348Z","etag":null,"topics":["android","edittext","filters","formatter","input-mask","inputmask","kotlin","mask","mask-edittext","maskededittext","maskedinput","maskedtextfield","widget"],"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/santalu.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":"2017-08-09T13:37:46.000Z","updated_at":"2025-03-19T06:15:35.000Z","dependencies_parsed_at":"2023-01-18T05:01:13.974Z","dependency_job_id":null,"html_url":"https://github.com/santalu/maskara","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santalu%2Fmaskara","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santalu%2Fmaskara/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santalu%2Fmaskara/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santalu%2Fmaskara/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santalu","download_url":"https://codeload.github.com/santalu/maskara/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586249,"owners_count":21128997,"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","edittext","filters","formatter","input-mask","inputmask","kotlin","mask","mask-edittext","maskededittext","maskedinput","maskedtextfield","widget"],"created_at":"2024-08-01T19:01:55.109Z","updated_at":"2025-04-12T14:58:52.392Z","avatar_url":"https://github.com/santalu.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# Maskara\n\n[![](https://www.jitpack.io/v/santalu/maskara.svg)](https://www.jitpack.io/#santalu/maskara)\n[![Build Status](https://travis-ci.org/santalu/maskara.svg?branch=master)](https://travis-ci.org/santalu/maskara)\n[![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14)\n\nA simple way to format text fields without getting affected by input filters.\n\n| Normal        | Completable   | Persistent    |\n| ------------- | ------------- | ------------- |\n| \u003cimg src=\"./media/normal.gif\" alt=\"maskara\" title=\"Normal\" /\u003e  | \u003cimg src=\"./media/completable.gif\" alt=\"maskara\" title=\"Completable\" /\u003e | \u003cimg src=\"./media/persistent.gif\" alt=\"maskara\" title=\"Persistent\" /\u003e  |\n\n## How It Works\n\n#### [Mask](./library/src/main/java/com/santalu/maskara/Mask.kt)\n\nUsed to define how to format the text.\n\n* `value` is used to define the format string. E.g. `+90 (___) ___ __ __`\n\nThere's no limitation here. You can use any type of characters with any type of input filters.\n\n* `maskCharacter` is used to define which characters in the format string user can edit. E.g. `_`\n\nIt's not mandatory to define this explicitly. Mask will set the character with most occurences in the format string as `maskCharacter` by default.\n\nYou should use non alphanumeric characters here.\n\n#### [MaskStyle](./library/src/main/java/com/santalu/maskara/MaskStyle.kt)\n\nUsed to define mask visibility and cursor behaviour.\n\n* `Normal` Mask is never visible. Cursor is not limited.\n\n* `Completable` Mask becomes visible right after the user started typing until the user deleted everything. Cursor is not limited.\n\n* `Persistent` Mask becomes visible right after the user started typing and never becomes hidden. Cursor is limited between mask characters.\n\n#### [MaskResult](./library/src/main/java/com/santalu/maskara/MaskResult.kt)\n\nYou can retrieve these from both the widget and the listener.\n\n* `masked` Masked version of input text.\n\n* `unMasked` Raw version of input text.\n\n* `isDone` Validity of input text.\n\n## Usage\n\n#### With Widget\n\n```\n\u003ccom.santalu.maskara.widget.MaskEditText\n    android:id=\"@+id/input\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:inputType=\"number\"\n    app:mask=\"+90 (___) ___ __ __\"\n    app:maskCharacter=\"_\"\n    app:maskStyle=\"completable\" /\u003e\n```\n\nTo get the result:\n```\nval masked = input.masked\nval raw = input.unMasked\nval isDone = input.isDone\n```\n\n#### Without Widget\n\n```\nval mask = Mask(\n    value = \"+90 (___) ___ __ __\",\n    character = '_',\n    style = MaskStyle.COMPLETABLE\n)\nval listener = MaskChangedListener(mask)\ntextField.addTextChangedListener(listener)\n```\n\nTo get the result:\n```\nval masked = listener.masked\nval raw = listener.unMasked\nval isDone = listener.isDone\n```\n\n## Dependencies\n\n```\nallprojects {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n```\ndependencies {\n    implementation 'com.github.santalu:maskara:1.0.0'\n}\n```\n\n## License\n\n```\nCopyright 2020 Fatih Santalu\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%2Fsantalu%2Fmaskara","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsantalu%2Fmaskara","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantalu%2Fmaskara/lists"}