use of com.thebluealliance.androidclient.listitems.LabelValueDetailListItem in project the-blue-alliance-android by the-blue-alliance.
the class TeamAtDistrictSummarySubscriberTest method testParsedData.
@Test
public void testParsedData() {
List<ListItem> data = DatafeedTestDriver.getParsedData(mSubscriber, mDistrictTeam);
assertEquals(5, data.size());
LabelValueListItem rank = getItemAtPosition(0, data);
LabelValueDetailListItem event1 = getDetailItemAtPoistion(1, data);
LabelValueDetailListItem event2 = getDetailItemAtPoistion(2, data);
LabelValueDetailListItem cmp = getDetailItemAtPoistion(3, data);
LabelValueListItem total = getItemAtPosition(4, data);
String event1Key = EventTeamHelper.generateKey("2015nhnas", "frc1519");
String event2Key = EventTeamHelper.generateKey("2015manda", "frc1519");
String cmpKey = EventTeamHelper.generateKey("2015necmp", "frc1519");
assertEquals(new LabelValueListItem("District Rank", "1st"), rank);
assertEquals(new LabelValueDetailListItem("2015nhnas", "73 Points", event1Key), event1);
assertEquals(new LabelValueDetailListItem("2015manda", "73 Points", event2Key), event2);
assertEquals(new LabelValueDetailListItem("2015necmp", "219 Points", cmpKey), cmp);
assertEquals(new LabelValueListItem("Total Points", "365 Points"), total);
}
use of com.thebluealliance.androidclient.listitems.LabelValueDetailListItem in project the-blue-alliance-android by the-blue-alliance.
the class TeamAtDistrictSummarySubscriber method renderEventPoints.
private static LabelValueDetailListItem renderEventPoints(String teamKey, IDistrictEventPoints points, EventsTable eventsTable, Resources resources) {
Event event = eventsTable.get(points.getEventKey());
String event1Name = event != null ? event.getShortName() : points.getEventKey();
return new LabelValueDetailListItem(event1Name, String.format(resources.getString(R.string.district_points_format), points.getTotal()), EventTeamHelper.generateKey(points.getEventKey(), teamKey));
}
Aggregations