Created
August 7, 2018 18:25
-
-
Save anitaa1990/8fdb97a05cdd66b253a721be65e2bbde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onBindViewHolder(ViewHolder holder, int position) { | |
Movie movie = movies.get(position); | |
holder.title.setText(movie.getTitle()); | |
holder.rating.setText(movie.getRating()); | |
//SRP violation, onBindViewHolder has only the responsibility to display data | |
// & not make data formatting operations | |
String[] genres = song.getGenres(); | |
StringBuilder builder = new StringBuilder(); | |
foreach (String genre : genres){ | |
builder.append(genre).append(","); | |
} | |
holder.genres.setText(builder.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment