{"id":13643021,"url":"https://github.com/nekocode/DividerDrawable","last_synced_at":"2025-04-20T21:32:29.883Z","repository":{"id":98385418,"uuid":"91108990","full_name":"nekocode/DividerDrawable","owner":"nekocode","description":"Help to layout and draw dividers on android views.","archived":false,"fork":false,"pushed_at":"2017-05-18T16:39:51.000Z","size":348,"stargazers_count":452,"open_issues_count":0,"forks_count":37,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-29T18:24:02.326Z","etag":null,"topics":["android","widget"],"latest_commit_sha":null,"homepage":"","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/nekocode.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-05-12T16:13:37.000Z","updated_at":"2024-10-05T17:12:07.000Z","dependencies_parsed_at":"2023-03-13T16:01:48.118Z","dependency_job_id":null,"html_url":"https://github.com/nekocode/DividerDrawable","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekocode%2FDividerDrawable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekocode%2FDividerDrawable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekocode%2FDividerDrawable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nekocode%2FDividerDrawable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nekocode","download_url":"https://codeload.github.com/nekocode/DividerDrawable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223839279,"owners_count":17211904,"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","widget"],"created_at":"2024-08-02T01:01:39.791Z","updated_at":"2024-11-09T14:31:25.636Z","avatar_url":"https://github.com/nekocode.png","language":"Java","readme":"# DividerDrawable\n[![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0.html) [![Release](https://jitpack.io/v/nekocode/DividerDrawable.svg)](https://jitpack.io/#nekocode/DividerDrawable)\n\nThis library can help you easily layout and draw dividers on existing views. For better performance, don't create new views for drawing dividers anymore, use drawable instead.\n\n## Install\n\n```gradle\nrepositories {\n    maven { url \"https://jitpack.io\" }\n}\ndependencies {\n    compile 'com.github.nekocode:DividerDrawable:{lastest-version}'\n}\n```\n\n\n## Usage\n\nObtain a new `DividerDrawable` instance. And you can set the color and stroke witdh of the divider.\n\n```java\nfinal DividerDrawable dividerDrawable = new DividerDrawable();\ndividerDrawable.setStrokeWidth(10)\n        .setColor(0xFFFFFFFF)\n```\n\nSimilar to the view layout, the `DividerDrawable` also has a layout that can help draw divider to the relative position of the container(view/drawable/canvas).\n\n```java\ndividerDrawable.getLayout()\n        .setOrientation(DividerLayout.ORIENTATION_VERTICAL)\n        .setAlign(DividerLayout.ALIGN_PARENT_BOTTOM)\n        .setCenter(DividerLayout.CENTER_HORIZONTAL)\n        .setMarginBottomDp(20);\n```\n\nYou can use `DividerUtils` to easily combine the divider drawable to your existing backgroud drawable.\n\n```java\nDividerUtils.addDividersTo(textView, dividerDrawable);\n```\n\nIf you changed the divider's layout params, don't forget to notify the changes.\n\n```java\ndividerDrawable.notifyLayoutChanged();\n```\n\n![Screenshot](art/screenshot.png)","funding_links":[],"categories":["Drawable"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekocode%2FDividerDrawable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnekocode%2FDividerDrawable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnekocode%2FDividerDrawable/lists"}