{"id":15486984,"url":"https://github.com/sakebook/multilinedivider","last_synced_at":"2025-06-17T05:33:23.068Z","repository":{"id":41786083,"uuid":"89155894","full_name":"sakebook/MultiLineDivider","owner":"sakebook","description":"Multi divider in RecyclerView on Android.","archived":false,"fork":false,"pushed_at":"2022-04-28T21:27:03.000Z","size":4605,"stargazers_count":13,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T07:17:09.841Z","etag":null,"topics":["android","android-library","android-ui","divide","divider","itemdecoration","java","kotlin","multi-divider","recyclerview"],"latest_commit_sha":null,"homepage":null,"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/sakebook.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-04-23T16:26:24.000Z","updated_at":"2022-04-28T21:26:58.000Z","dependencies_parsed_at":"2022-08-11T17:10:48.215Z","dependency_job_id":null,"html_url":"https://github.com/sakebook/MultiLineDivider","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/sakebook%2FMultiLineDivider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakebook%2FMultiLineDivider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakebook%2FMultiLineDivider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakebook%2FMultiLineDivider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sakebook","download_url":"https://codeload.github.com/sakebook/MultiLineDivider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250282474,"owners_count":21404980,"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","android-ui","divide","divider","itemdecoration","java","kotlin","multi-divider","recyclerview"],"created_at":"2024-10-02T06:20:41.501Z","updated_at":"2025-04-22T16:50:43.588Z","avatar_url":"https://github.com/sakebook.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"MultiLineDivider\n============\nMulti divider in RecyclerView on Android.\n\n[![Download](https://api.bintray.com/packages/sakebook/maven/MultiLineDivider/images/download.svg) ](https://bintray.com/sakebook/maven/MultiLineDivider/_latestVersion) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-MultiLineDivider-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5735)\n\n[![wercker status](https://app.wercker.com/status/7b5ad7fbfb97759c7d5ef14778e0539a/s/ \"wercker status\")](https://app.wercker.com/project/byKey/7b5ad7fbfb97759c7d5ef14778e0539a)\n\n|Vertical|Horizontal|\n|:---:|:---:|\n|![image](https://raw.githubusercontent.com/sakebook/MultiLineDivider/master/art/vertical.png)|![image](https://raw.githubusercontent.com/sakebook/MultiLineDivider/master/art/horizontal.png)|\n\n|Inset|Dash|\n|:---:|:---:|\n|![image](https://raw.githubusercontent.com/sakebook/MultiLineDivider/master/art/inset.png)|![image](https://raw.githubusercontent.com/sakebook/MultiLineDivider/master/art/dash.png)|\n\n|Grid|FullBleed|\n|:---:|:---:|\n|![image](https://raw.githubusercontent.com/sakebook/MultiLineDivider/master/art/grid.png)|![image](https://raw.githubusercontent.com/sakebook/MultiLineDivider/master/art/full_bleed.png)|\n\n|Position|Inverted|\n|:---:|:---:|\n|![image](https://raw.githubusercontent.com/sakebook/MultiLineDivider/master/art/position.png)|![image](https://raw.githubusercontent.com/sakebook/MultiLineDivider/master/art/position_inverted.png)|\n\n---\n\n\n- Requirement\n  - SDK Version __16+__\n  - (Use from Java)Kotlin Version __1.0.0+__\n\n\n## Usage\nAdd dependencies\n\n```gradle\ncompile 'com.github.sakebook:MultiLineDivider:0.2.0@aar'\n\n// Use from Java\ncompile \"org.jetbrains.kotlin:kotlin-stdlib:kotlin_version\"\n```\n\nAdd to RecyclerView like in addItemDecoration\n\n- Java\n\n```java\nMultiLineDivider multiLineDivider = new MultiLineDivider(this, LinearLayout.VERTICAL);\nrecyclerView.addItemDecoration(multiLineDivider);\n```\n\n- Kotlin\n\n```kotlin\nval multiLineDivider = MultiLineDivider(this)\nrecyclerView.addItemDecoration(multiLineDivider)\n```\n\nAnd Implement `VerticalDivider` in ViewHolder\n\n- Java\n\n```java\npublic class YourViewHolder extends RecyclerView.ViewHolder implements VerticalDivider {\n\n    public YourViewHolder(View itemView) {\n        super(itemView);\n    }\n\n    @Override\n    public int getHeight() {\n        return this.itemView.getContext().getResources()\n                .getDimensionPixelSize(R.dimen.small_margin);\n    }\n\n    @Override\n    public int getDrawableRes() {\n        return R.drawable.custom_divider;\n    }\n\n    @Nullable\n    @Override\n    // android.support.v4.util.Pair\n    public Pair\u003cInteger, Integer\u003e getVerticalInset() {\n        return null;\n    }\n}\n```\n\n- Kotlin\n\n```kotlin\nclass YourViewHolder(view: View): RecyclerView.ViewHolder(view), VerticalDivider {\n    override val height = view.context.resources.getDimensionPixelSize(R.dimen.small_margin)\n    override val drawableRes = R.drawable.custom_divider\n    override val verticalInset: Pair\u003cInt, Int\u003e? = null\n}\n```\n\n\n## Custom\n### If you want to draw Horizontal divider\n\n```java\nMultiLineDivider multiLineDivider = new MultiLineDivider(this, LinearLayout.HORIZONTAL);\n```\n\nand implements `HorizontalDivider`\n\n\n### If you __don't__ want to draw divider\n\nImplements `NoDivider`\n\n### If you want to inset in divider\n\n```\n@Nullable\n@Override\n// android.support.v4.util.Pair\npublic Pair\u003cInteger, Integer\u003e getVerticalInset() {\n    int insetLeft = (int) resources.getDimension(R.dimen.list_padding);\n    int insetRight = 0;\n    return Pair.create(insetLeft, insetRight);\n}\n\n```\n\n### If you want to padding in grid\n\n- Java\n\n```java\npublic class YourViewHolder extends RecyclerView.ViewHolder implements GridDivider {\n\n    public YourViewHolder(View itemView) {\n        super(itemView);\n    }\n\n    @Override\n    public int getPadding() {\n        return itemView.getContext().getResources().getDimensionPixelSize(R.dimen.tiny_margin);\n    }\n\n    @Override\n    public boolean getFullBleed() {\n        return false;\n    }\n}\n```\n\n- Kotlin\n\n```kotlin\nclass YourViewHolder(view: View): RecyclerView.ViewHolder(view), GridDivider {\n    override val padding = view.context.resources.getDimensionPixelSize(R.dimen.grid_padding)\n    override val fullBleed = true\n}\n```\n\n### If you want to draw divider in specific position\n\n- Java\n\n```java\npublic class YourViewHolder extends RecyclerView.ViewHolder implements PositionDivider {\n\n    public YourViewHolder(View itemView) {\n        super(itemView);\n    }\n\n    @NotNull\n    @Override\n    public List\u003cInteger\u003e getPositions() {\n        return Arrays.asList(2, 12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 42); // include \"2\"\n    }\n\n    @Override\n    public boolean getInverted() {\n        return false;\n    }\n}\n```\n\n- Kotlin\n\n```kotlin\nclass YourViewHolder(view: View): RecyclerView.ViewHolder(view), PositionDivider {\n    override val positions = listOf(2, 12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 42)\n    override val inverted = false\n}\n```\n\n### If you __don't__ want to draw divider in specific position\n\nImplements `PositionDivider` with `inverted` true\n\n### If you want to draw custom divider in specific position\n\nImplements `PositionDivider` and `VerticalDivider` or `HorizontalDivider`\n\n\n## ProGuard\n\nIf you are using ProGuard you might need to add the following option:\n\n```\n-keep class com.sakebook.android.library.multilinedevider.*{ *; }\n```\n\nSample in project [sample/](https://github.com/sakebook/MultiLineDivider/tree/master/sample)\n\n## LICENSE\n```\nCopyright (C) 2017 Shinya Sakemoto\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%2Fsakebook%2Fmultilinedivider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakebook%2Fmultilinedivider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakebook%2Fmultilinedivider/lists"}