Search in sources :

Example 1 with LabelValueDetailListItem

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);
}
Also used : LabelValueListItem(com.thebluealliance.androidclient.listitems.LabelValueListItem) LabelValueDetailListItem(com.thebluealliance.androidclient.listitems.LabelValueDetailListItem) LabelValueListItem(com.thebluealliance.androidclient.listitems.LabelValueListItem) ListItem(com.thebluealliance.androidclient.listitems.ListItem) LabelValueDetailListItem(com.thebluealliance.androidclient.listitems.LabelValueDetailListItem) Test(org.junit.Test)

Example 2 with LabelValueDetailListItem

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));
}
Also used : ActionBarTitleEvent(com.thebluealliance.androidclient.eventbus.ActionBarTitleEvent) Event(com.thebluealliance.androidclient.models.Event) LabelValueDetailListItem(com.thebluealliance.androidclient.listitems.LabelValueDetailListItem)

Aggregations

LabelValueDetailListItem (com.thebluealliance.androidclient.listitems.LabelValueDetailListItem)2 ActionBarTitleEvent (com.thebluealliance.androidclient.eventbus.ActionBarTitleEvent)1 LabelValueListItem (com.thebluealliance.androidclient.listitems.LabelValueListItem)1 ListItem (com.thebluealliance.androidclient.listitems.ListItem)1 Event (com.thebluealliance.androidclient.models.Event)1 Test (org.junit.Test)1