{"id":13790542,"url":"https://github.com/MackHartley/DashedView","last_synced_at":"2025-05-12T09:32:48.378Z","repository":{"id":51097085,"uuid":"367531707","full_name":"MackHartley/DashedView","owner":"MackHartley","description":"Easily create views with a background of repeating dashes 🐝","archived":false,"fork":false,"pushed_at":"2024-01-28T23:56:42.000Z","size":285,"stargazers_count":69,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-18T05:38:07.398Z","etag":null,"topics":["android","android-library","dashed","rounded-corners","view"],"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/MackHartley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-05-15T03:34:09.000Z","updated_at":"2024-08-27T11:11:04.000Z","dependencies_parsed_at":"2024-08-03T22:13:28.723Z","dependency_job_id":null,"html_url":"https://github.com/MackHartley/DashedView","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/MackHartley%2FDashedView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MackHartley%2FDashedView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MackHartley%2FDashedView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MackHartley%2FDashedView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MackHartley","download_url":"https://codeload.github.com/MackHartley/DashedView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253709358,"owners_count":21951124,"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","dashed","rounded-corners","view"],"created_at":"2024-08-03T22:00:46.339Z","updated_at":"2025-05-12T09:32:48.367Z","avatar_url":"https://github.com/MackHartley.png","language":"Kotlin","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L244-L255\"\u003e\u003cimg width=\"182\" src=\"https://user-images.githubusercontent.com/10659285/119302791-51165b00-bc2a-11eb-8fb3-60e12629e188.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eDashedView\u003c/h1\u003e\n\u003cp align=\"center\"\u003eThe easiest way to create a dashed or striped background on Android\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://android-arsenal.com/api?level=21\"\u003e\u003cimg src=\"https://img.shields.io/badge/API-21%2B-blue.svg?style=flat\" height=\"20\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://jitpack.io/#MackHartley/DashedView\"\u003e\u003cimg src=\"https://jitpack.io/v/MackHartley/DashedView.svg\" height=\"20\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/MackHartley/DashedView/actions/workflows/buildAndTest.yml\"\u003e\u003cimg src=\"https://github.com/MackHartley/DashedView/actions/workflows/buildAndTest.yml/badge.svg\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://ktlint.github.io/\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg\" alt=\"ktlint\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://androidweekly.net/issues/issue-474\"\u003e\u003cimg alt=\"Featured in Android Weekly\" src=\"https://img.shields.io/badge/Featured%20in%20Android%20Weekly-%23474-orange\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThe `DashedView` library allows you to create views with a dashed (or striped) background. Below are some examples of views created with this library. You can click on any example to see its code.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L81-L118\"\u003e\u003cimg width=\"204\" alt=\"Screen Shot 2021-05-21 at 11 42 53 PM\" src=\"https://user-images.githubusercontent.com/10659285/119214704-550d7600-ba8e-11eb-9a88-b26f75d971c4.png\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L23-L72\"\u003e\u003cimg width=\"203\" alt=\"Screen Shot 2021-05-21 at 11 42 18 PM\" src=\"https://user-images.githubusercontent.com/10659285/119214702-52128580-ba8e-11eb-993a-65f5859c0312.png\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L127-L165\"\u003e\u003cimg width=\"367\" alt=\"card1\" src=\"https://user-images.githubusercontent.com/10659285/119276770-8b0f3f00-bbe1-11eb-9519-0f5eef08b9ec.png\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L167-L221\"\u003e\u003cimg width=\"367\" alt=\"card2\" src=\"https://user-images.githubusercontent.com/10659285/119276772-8ea2c600-bbe1-11eb-990b-671e321bb391.png\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n\u003c/p\u003e\n\nThere is also a demo app for this library which allows you to see the look and feel of the `DashedView` on your own device:\n\n\u003cp align=\"center\"\u003e\n  \u003ca href='https://play.google.com/store/apps/details?id=com.mackhartley.dashedviewexample\u0026pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'\u003e\u003cimg height=\"100\" alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/\u003e\u003c/a\u003e\n\u003c/p\u003e\n  \n\u003ch1\u003eQuick Start Guide \u003ca href=\"https://jitpack.io/#MackHartley/DashedView\"\u003e\u003cimg src=\"https://jitpack.io/v/MackHartley/DashedView.svg\" height=\"20\"/\u003e\u003c/a\u003e\u003c/h1\u003e\n\nIf you don't have this already, add it to your **root** build.gradle file:\n```\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\nThen you can add the dependency to your **app** build.gradle file:\n```\ndependencies {\n    ...\n    implementation 'com.github.MackHartley:DashedView:1.0.0'\n}\n```\n\nOnce that's finished you can declare a `DashedView` via XML:\n```\n\u003ccom.mackhartley.dashedview.DashedView\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:dvDashAngle=\"45\"\n    app:dvDashColor=\"#777\"\n    app:dvDashWidth=\"4dp\"\n    app:dvSpaceBetweenDashes=\"4dp\"\n    app:dvViewCornerRadius=\"0dp\" /\u003e\n```\n\n\u003ch1\u003eUsage ⚙️\u003c/h1\u003e\n\nThe table below explains the 5 XML attributes you can set on the `DashedView` class:\n\u003cbr\u003e\n\n| XML Attribute | Use |\n|---|---|\n| `dvDashAngle` | Sets the angle of the dashes. The angle is measured from the X axis of the view. |\n| `dvDashColor` | Sets the color of the dashes. |\n| `dvDashWidth` | Sets the width of the dashes. |\n| `dvSpaceBetweenDashes` | Sets the width of the space between each dash. |\n| `dvViewCornerRadius` | Sets the corner radius value for the `DashedView`. Useful when working with other views that have rounded corners. |\n\u003cbr\u003e\n\nThe `DashedView` also has a public method that allows you to set custom coloring for individual dashes:\n\u003cbr\u003e\n\n| Public Method | Use |\n|---|---|\n| `setDashColorGenerator(...)` | This method takes a `DashColorGenerator` instance as a parameter which gives you access to the index of the current dash being drawn. Using that information you can specify logic for how each dash should be colored. |\n\n```\ninterface DashColorGenerator {\n    @ColorInt fun getPaintColor(curIndex: Int, numDashes: Int): Int\n}\n```\nTo see an example of the `DashColorGenerator` click \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/java/com/mackhartley/dashedviewexample/MainActivity.kt#L18-L24\"\u003ehere\u003c/a\u003e.\n\n\u003ch1\u003eMore Examples 🖼️ \u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  Click on any example to see it's code (You also need to look at \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/java/com/mackhartley/dashedviewexample/MainActivity.kt#L15-L104\"\u003eMainActivity\u003c/a\u003e which sets custom dash coloring)\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L230-L242\"\u003e\u003cimg height=\"200\" alt=\"heropic\" src=\"https://user-images.githubusercontent.com/10659285/119214644-07910900-ba8e-11eb-88b8-1afc5afa8421.png\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L244-L255\"\u003e\u003cimg height=\"200\" alt=\"hero2\" src=\"https://user-images.githubusercontent.com/10659285/119214622-e0d2d280-ba8d-11eb-9ff7-5ac4e23d8d23.png\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L270-L281\"\u003e\u003cimg height=\"200\" alt=\"Screen Shot 2021-05-21 at 11 44 19 PM\" src=\"https://user-images.githubusercontent.com/10659285/119214724-85edab00-ba8e-11eb-8c01-f6da75fda938.png\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L283-L294\"\u003e\u003cimg height=\"200\" alt=\"Screen Shot 2021-05-23 at 3 48 04 PM\" src=\"https://user-images.githubusercontent.com/10659285/119276083-6cf40f80-bbde-11eb-8337-9433408fdc14.png\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/app/src/main/res/layout/activity_main.xml#L257-L268\"\u003e\u003cimg width=\"300\" alt=\"Screen Shot 2021-05-23 at 3 47 38 PM\" src=\"https://user-images.githubusercontent.com/10659285/119276077-6a91b580-bbde-11eb-94a8-8848d3e77edd.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Contributing 🤝\nFeel free to open issues on this repo to report bugs or request features. Additionally if you'd like to contribute you can create a pull request (make sure to read \u003ca href=\"https://github.com/MackHartley/DashedView/blob/master/CONTRIBUTING.md\"\u003econtributing.mk\u003c/a\u003e).\n\n**Special thanks to all those who have supported this repo thus far!**\n\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://github.com/MackHartley/DashedView/stargazers\"\u003e\u003cimg src=\"http://reporoster.com/stars/MackHartley/DashedView\"/\u003e\u003c/a\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://github.com/MackHartley/DashedView/network/members\"\u003e\u003cimg src=\"http://reporoster.com/forks/MackHartley/DashedView\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# License 📄\n```\nCopyright 2021 Mack Hartley\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":["Index"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMackHartley%2FDashedView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMackHartley%2FDashedView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMackHartley%2FDashedView/lists"}