Setting divider for RecyclerView.
Java
Latest commit 2c4b4ca Jan 4, 2017 @laobie publish 1.0.1
Permalink
Failed to load latest commit information.
gradle/wrapper init project Dec 30, 2016
img update README Dec 30, 2016
library publish 1.0.1 Jan 4, 2017
sample publish 1.0.1 Jan 4, 2017
.gitignore init project Dec 30, 2016
README.md publish 1.0.1 Jan 4, 2017
build.gradle publish jcenter Jan 2, 2017
gradle.properties remove proxy setting Dec 30, 2016
gradlew init project Dec 30, 2016
gradlew.bat init project Dec 30, 2016
settings.gradle init project Dec 30, 2016

README.md

RecyclerViewDivider

Setting divider for RecyclerView.

Usage

  1. Add the dependencies to your build.gradle file, RecyclerViewDivider is avaiable in JCenter:

    compile 'com.jaeger.recyclerviewdivider:library:1.0.1'
    
  2. Use RecyclerViewDivider.Builder

    RecyclerViewDivider divider = new RecyclerViewDivider.Builder(this)
       .setStyle(RecyclerViewDivider.Style.BETWEEN)
       .setDrawableRes(R.drawable.divider)
       .setMarginLeft(72)
       .setMarginRight(8)
       .build();
    mRvList.addItemDecoration(divider);

Feature

  1. Style

    • START
    • END
    • BETWEEN
    • BOTH

  2. Set margin

    RecyclerViewDivider divider = new RecyclerViewDivider.Builder(this)
               .setOrientation(RecyclerViewDivider.VERTICAL)
               .setStyle(RecyclerViewDivider.Style.BETWEEN)
               .setColorRes(R.color.divider_gray)
               .setSize(1.5f)
               .setMarginLeft(72)
               .setMarginRight(8)
               .build();

  3. Set drawable

    RecyclerViewDivider divider = new RecyclerViewDivider.Builder(this)
       .setStyle(RecyclerViewDivider.Style.BETWEEN)
       .setDrawableRes(R.drawable.divider)
       .setMarginLeft(72)
       .setMarginRight(8)
       .build();
    mRvList.addItemDecoration(divider);

  4. Set skip count

    RecyclerViewDivider divider = new RecyclerViewDivider.Builder(this)
       .setOrientation(RecyclerViewDivider.VERTICAL)
       .setStyle(RecyclerViewDivider.Style.BETWEEN)
       .setColorRes(R.color.divider_gray)
       .setSize(1.5f)
       .setStartSkipCount(2)
       .setMarginLeft(72)
       .setMarginRight(8)
       .build();