ZPHRVItemDecoration 简体中文
-
Full Wrap:
LinearLayoutManagerDivider divider = new LinearLayoutManagerDivider(color, dividerWidth); // if you have header view or footer view. // it will not influence layout, only use for calculate. divider.addHeaderView(headerView); divider.addFooterView(footerView); // rv.addItemDecoration(divider);
-
Not Full Wrap:
LinearLayoutManagerDivider divider = new LinearLayoutManagerDivider(color, dividerWidth, false); // if you have header view or footer view. // it will not influence layout, only use for calculate. divider.addHeaderView(headerView); divider.addFooterView(footerView); // rv.addItemDecoration(divider);
-
Full Wrap:
GridLayoutManagerDivider divider = new GridLayoutManagerDivider(color, dividerWidth, true); // if you want to set a different size of divider: GridLayoutManagerDivider divider = new GridLayoutManagerDivider(color, horizontalDividerHeight, horizontalDividerHeight, true); // if you have header view or footer view. // it will not influence layout, only use for calculate. divider.addHeaderView(headerView); divider.addFooterView(footerView); // rv.addItemDecoration(divider);
-
Not Full Wrap:
GridLayoutManagerDivider divider = new GridLayoutManagerDivider(color, dividerWidth, false); // if you want to set a different size of divider: GridLayoutManagerDivider divider = new GridLayoutManagerDivider(color, horizontalDividerHeight, verticalDividerWidth, false); // if you have header view or footer view. // it will not influence layout, only use for calculate. divider.addHeaderView(headerView); divider.addFooterView(footerView); // rv.addItemDecoration(divider);
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency in your module's build.gradle:
dependencies {
// For android compat version
implementation 'com.github.zeropercenthappy:ZPHRVItemDecoration:1.0.9'
// For androidX version
implementation 'com.github.zeropercenthappy:ZPHRVItemDecoration:1.1.0'
}
-
1.1.0
Migrate to AndroidX.
-
1.0.9
Support different size of horizontal and vertical divider for GridLayoutManager.
-
1.0.8
fix draw way of not full wrap style.
-
1.0.7
Use kotlin to rewrite, rewrite all calculate logic, support to set header view and footer view.
-
1.0.6
Downgrade minSdkVersion to 14
-
1.0.4
Add sources jar
-
1.0.3
Fix build error
-
1.0.2
Support RecycleView set padding now.