Handle bottom divider visibility

This commit is contained in:
Alexander Sytnyk 2017-11-17 14:35:28 +02:00
parent 7e1de273f5
commit c1dbd2c9e2

View file

@ -125,7 +125,7 @@ public class NotesAdapter extends ArrayAdapter<Object> {
holder.icon.setImageDrawable(app.getIconsCache().getIcon(iconRes, colorRes)); holder.icon.setImageDrawable(app.getIconsCache().getIcon(iconRes, colorRes));
} }
holder.bottomDivider.setVisibility(View.VISIBLE); holder.bottomDivider.setVisibility(hideBottomDivider(position) ? View.GONE : View.VISIBLE);
holder.icon.setVisibility(selectionMode ? View.GONE : View.VISIBLE); holder.icon.setVisibility(selectionMode ? View.GONE : View.VISIBLE);
holder.checkBox.setVisibility(selectionMode ? View.VISIBLE : View.GONE); holder.checkBox.setVisibility(selectionMode ? View.VISIBLE : View.GONE);
holder.options.setVisibility(selectionMode ? View.GONE : View.VISIBLE); holder.options.setVisibility(selectionMode ? View.GONE : View.VISIBLE);
@ -183,6 +183,10 @@ public class NotesAdapter extends ArrayAdapter<Object> {
return TYPE_COUNT; return TYPE_COUNT;
} }
private boolean hideBottomDivider(int pos) {
return pos == getCount() - 1 || !(getItem(pos + 1) instanceof Recording);
}
private boolean isSelectAllChecked() { private boolean isSelectAllChecked() {
for (int i = 0; i < getCount(); i++) { for (int i = 0; i < getCount(); i++) {
Object item = getItem(i); Object item = getItem(i);