Skip to content

Commit

Permalink
Merge pull request #90 from sonique6784/patch-6
Browse files Browse the repository at this point in the history
Let user to set his own DividerItemDecoration (separators)
  • Loading branch information
evrencoskun authored Apr 27, 2018
2 parents 0aff430 + 2b007f7 commit 3980304
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public interface ITableView {
boolean isIgnoreSelectionColors();

boolean isShowHorizontalSeparators();

boolean isShowVerticalSeparators();

boolean isSortable();

Expand All @@ -74,6 +76,8 @@ public interface ITableView {
ColumnSortHandler getColumnSortHandler();

DividerItemDecoration getHorizontalItemDecoration();

DividerItemDecoration getVerticalItemDecoration();

SortState getSortingStatus(int column);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ public void setShowHorizontalSeparators(boolean showSeparators) {
this.mShowHorizontalSeparators = showSeparators;
}

@Override
public boolean isShowVerticalSeparators() {
return mShowVerticalSeparators;
}
Expand Down Expand Up @@ -599,14 +600,15 @@ public DividerItemDecoration getHorizontalItemDecoration() {
return mHorizontalItemDecoration;
}

private DividerItemDecoration getVerticalItemDecoration() {
@Override
public DividerItemDecoration getVerticalItemDecoration() {
if (mVerticalItemDecoration == null) {
mVerticalItemDecoration = createItemDecoration(DividerItemDecoration.VERTICAL);
}
return mVerticalItemDecoration;
}

private DividerItemDecoration createItemDecoration(int orientation) {
protected DividerItemDecoration createItemDecoration(int orientation) {
Drawable divider = ContextCompat.getDrawable(getContext(), R.drawable.cell_line_divider);

// That means; There is a custom separator color from user.
Expand Down

0 comments on commit 3980304

Please sign in to comment.