@Test public void testRenderTeamCarded() { Award award = ModelMaker.getModel(Award.class, AWARD_TEAM); ListItem rendered = mRenderer.renderFromModel(award, new AwardRenderer.RenderArgs(new HashMap<>(), null)); assertNotNull(rendered); assertTrue(rendered instanceof CardedAwardListElement); }
@Override public @Nullable ListElement renderFromModel(Award award, RenderArgs args) { switch (args.renderType) { case RENDER_CARDED: return new CardedAwardListElement( mDatafeed, award.getName(), award.getEventKey(), award.getRecipientList(), args.teams, args.selectedTeamKey); } return null; }
AwardRenderer implements ModelRenderer<Award, AwardRenderer.RenderArgs> { @Override public @Nullable ListElement renderFromModel(Award award, RenderArgs args) { switch (args.renderType) { case RENDER_CARDED: return new CardedAwardListElement( mDatafeed, award.getName(), award.getEventKey(), award.getRecipientList(), args.teams, args.selectedTeamKey); } return null; } }
AwardRenderer implements ModelRenderer<Award, AwardRenderer.RenderArgs> { @Override public @Nullable ListElement renderFromModel(Award award, RenderArgs args) { switch (args.renderType) { case RENDER_CARDED: return new CardedAwardListElement( mDatafeed, award.getName(), award.getEventKey(), award.getRecipientList(), args.teams, args.selectedTeamKey); } return null; } @Inject  AwardRenderer(APICache datafeed); }
AwardRenderer implements ModelRenderer<Award, AwardRenderer.RenderArgs> { @Override public @Nullable ListElement renderFromModel(Award award, RenderArgs args) { switch (args.renderType) { case RENDER_CARDED: return new CardedAwardListElement( mDatafeed, award.getName(), award.getEventKey(), award.getRecipientList(), args.teams, args.selectedTeamKey); } return null; } @Inject  AwardRenderer(APICache datafeed); @Override @Nullable ListElement renderFromKey(String key, ModelType type, RenderArgs args); @Override @Nullable ListElement renderFromModel(Award award, RenderArgs args); }
AwardRenderer implements ModelRenderer<Award, AwardRenderer.RenderArgs> { @Override public @Nullable ListElement renderFromModel(Award award, RenderArgs args) { switch (args.renderType) { case RENDER_CARDED: return new CardedAwardListElement( mDatafeed, award.getName(), award.getEventKey(), award.getRecipientList(), args.teams, args.selectedTeamKey); } return null; } @Inject  AwardRenderer(APICache datafeed); @Override @Nullable ListElement renderFromKey(String key, ModelType type, RenderArgs args); @Override @Nullable ListElement renderFromModel(Award award, RenderArgs args); static final int RENDER_CARDED; }