Skip to content

Commit 9324f52

Browse files
committed
Added addListDivider method to RecyclerView as etention function
1 parent 96b4414 commit 9324f52

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ A RecyclerView Adapter for general purpose simple lists. It supports all common
33

44
## Installation
55
```groovy
6-
implementation 'com.ishaquehassan:recyclerviewgeneraladapter:0.1.4'
6+
implementation 'com.ishaquehassan:recyclerviewgeneraladapter:0.1.5'
77
```
88

99
### There are two constructors for this adapter
@@ -132,6 +132,9 @@ adapterInstance.remove(position)
132132

133133
// To update item, just pass your index/position & data. View will be automatically updated
134134
adapterInstance.update(position,ItemModel("new item updated"))
135+
136+
//Add list item divider
137+
yourRecyclerViewInstance.addListDivider()
135138
```
136139

137140
## How to Contribute

recyclerviewgeneraladapter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ext {
1717
siteUrl = 'https://github.com/ishaquehassan/RecyclerViewGeneralAdapter'
1818
gitUrl = 'https://github.com/ishaquehassan/RecyclerViewGeneralAdapter.git'
1919

20-
libraryVersion = '0.1.4'
20+
libraryVersion = '0.1.5'
2121

2222
developerId = 'ishaquehassan'
2323
developerName = 'Ishaq Hassan'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.ishaquehassan.recyclerviewgeneraladapter
2+
3+
import android.support.v7.widget.DividerItemDecoration
4+
import android.support.v7.widget.RecyclerView
5+
6+
fun RecyclerView.addListDivider(){
7+
addItemDecoration(
8+
DividerItemDecoration(
9+
context,
10+
DividerItemDecoration.VERTICAL
11+
)
12+
)
13+
}

0 commit comments

Comments
 (0)