RecyclerView_Divider

you can use it to add an divider to RecyclerView

default aglie LinearLayoutManager


default GridLayoutManager aglie GridLayoutManager

Gradle

repositories {
    jcenter()
}

dependencies {
    compile 'com.choices.divider:RecyclerView_Divider:1.0.0'
}

Usage

class AgileDividerLookup extends DividerItemDecoration.SimpleDividerLookup {

 @Override
 public Divider getVerticalDivider(int position) {
      return super.getVerticalDivider(position);
 }

 @Override
 public Divider getHorizontalDivider(int position) {
     return super.getHorizontalDivider(position);
 }

}

- **Add divider for each ItemViewType**
- 
You can also add VerticalDivider or HorizontalDivider for each ItemViewType.

class AgileDividerLookup extends DividerItemDecoration.SimpleDividerLookup {

 @Override
    public Divider getVerticalDivider(int position) {
        int type = adapter.getItemViewType(position);
        switch (type) {
            case 0:
                return new Divider.Builder()
                        .size(2)
                        .color(Color.DKGRAY)
                        .build();
            case 2:
                return new Divider.Builder()
                        .size(4)
                        .color(Color.GREEN)
                        .build();
            case 3:
                return new Divider.Builder()
                        .size(10)
                        .color(Color.LTGRAY)
                        .build();
        }
        return null;
    }

}


## License

Copyright 2015 choices

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.