Skip to content

Instantly share code, notes, and snippets.

@kmdupr33
Created June 5, 2015 13:05
Show Gist options
  • Save kmdupr33/49428a2fcaf71df555f0 to your computer and use it in GitHub Desktop.
Save kmdupr33/49428a2fcaf71df555f0 to your computer and use it in GitHub Desktop.
public class SessionDetailActivity {
public void renderTags(List<TagMetadata.Tag> tags) {
mTagsContainer.setVisibility(View.VISIBLE);
mTags.removeAllViews();
LayoutInflater inflater = LayoutInflater.from(this);
for (final TagMetadata.Tag tag : tags) {
TextView chipView = (TextView) inflater.inflate(
R.layout.include_session_tag_chip, mTags, false);
SessionTagViewTranslator sessionTagViewTranslator = new SessionTagViewTranslator(chipView);
final TagPresenter tagPresenter = new TagPresenter(sessionTagViewTranslator, this);
tagPresenter.presentTag(tag);
chipView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
tagPresenter.onTagClicked(tag);
}
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment