Removed the separator from the last element in a list.
This commit is contained in:
parent
fd177e6604
commit
140f682ea2
5 changed files with 51 additions and 0 deletions
|
|
@ -95,6 +95,16 @@ public class PlaylistAdapter extends AbsMultiSelectAdapter<PlaylistAdapter.ViewH
|
|||
holder.title.setText(playlist.name);
|
||||
}
|
||||
|
||||
if (holder.getAdapterPosition() == getItemCount() - 1) {
|
||||
if (holder.shortSeparator != null) {
|
||||
holder.shortSeparator.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
if (holder.shortSeparator != null && !(dataSet.get(position) instanceof AbsSmartPlaylist)) {
|
||||
holder.shortSeparator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (holder.image != null) {
|
||||
holder.image.setImageDrawable(Util.getTintedDrawable(
|
||||
activity,
|
||||
|
|
|
|||
|
|
@ -95,6 +95,16 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
|||
holder.selectedIndicator.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
if (holder.getAdapterPosition() == getItemCount() - 1) {
|
||||
if (holder.shortSeparator != null) {
|
||||
holder.shortSeparator.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
if (holder.shortSeparator != null) {
|
||||
holder.shortSeparator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (holder.title != null) {
|
||||
holder.title.setText(getAlbumTitle(album));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,6 +98,16 @@ public class ArtistAdapter extends AbsMultiSelectAdapter<ArtistAdapter.ViewHolde
|
|||
holder.selectedIndicator.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
if (holder.getAdapterPosition() == getItemCount() - 1) {
|
||||
if (holder.shortSeparator != null) {
|
||||
holder.shortSeparator.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
if (holder.shortSeparator != null) {
|
||||
holder.shortSeparator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (holder.title != null) {
|
||||
holder.title.setText(artist.name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,17 @@ public class ArtistSongAdapter extends ArrayAdapter<Song> implements MaterialCab
|
|||
final TextView songTitle = (TextView) convertView.findViewById(R.id.title);
|
||||
final TextView songInfo = (TextView) convertView.findViewById(R.id.text);
|
||||
final ImageView albumArt = (ImageView) convertView.findViewById(R.id.image);
|
||||
final View shortSeparator = convertView.findViewById(R.id.short_separator);
|
||||
|
||||
if (position == getCount() - 1) {
|
||||
if (shortSeparator != null) {
|
||||
shortSeparator.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
if (shortSeparator != null) {
|
||||
shortSeparator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
songTitle.setText(song.title);
|
||||
songInfo.setText(song.albumName);
|
||||
|
|
|
|||
|
|
@ -95,6 +95,16 @@ public class SongAdapter extends AbsMultiSelectAdapter<SongAdapter.ViewHolder, S
|
|||
holder.selectedIndicator.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
if (holder.getAdapterPosition() == getItemCount() - 1) {
|
||||
if (holder.shortSeparator != null) {
|
||||
holder.shortSeparator.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
if (holder.shortSeparator != null) {
|
||||
holder.shortSeparator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
if (holder.title != null) {
|
||||
holder.title.setText(getSongTitle(song));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue