Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let user to set his own DividerItemDecoration (separators) #90

Merged
merged 2 commits into from
Apr 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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