Search in sources :

Example 6 with EventTypeHeader

use of com.thebluealliance.androidclient.listitems.EventTypeHeader in project the-blue-alliance-android by the-blue-alliance.

the class SubscriptionListSubscriber method parseData.

@Override
public void parseData() {
    mDataToBind.clear();
    Collections.sort(mAPIData, mComparator);
    int lastModel = -1;
    for (int i = 0; i < mAPIData.size(); i++) {
        Subscription subscription = mAPIData.get(i);
        ListItem item = mRenderer.renderFromKey(subscription.getModelKey(), subscription.getModelType(), null);
        if (item != null) {
            if (lastModel != subscription.getModelEnum()) {
                mDataToBind.add(new EventTypeHeader(subscription.getModelType().getTitle()));
            }
            mDataToBind.add(item);
        }
        lastModel = subscription.getModelEnum();
    }
}
Also used : ListItem(com.thebluealliance.androidclient.listitems.ListItem) EventTypeHeader(com.thebluealliance.androidclient.listitems.EventTypeHeader) Subscription(com.thebluealliance.androidclient.models.Subscription)

Example 7 with EventTypeHeader

use of com.thebluealliance.androidclient.listitems.EventTypeHeader in project the-blue-alliance-android by the-blue-alliance.

the class FavoriteListSubscriber method parseData.

@Override
public void parseData() {
    mDataToBind.clear();
    int lastModel = -1;
    Collections.sort(mAPIData, mComparator);
    for (int i = 0; i < mAPIData.size(); i++) {
        Favorite favorite = mAPIData.get(i);
        ListItem item = mRenderer.renderFromKey(favorite.getModelKey(), favorite.getModelType(), null);
        if (item != null) {
            if (lastModel != favorite.getModelEnum()) {
                mDataToBind.add(new EventTypeHeader(favorite.getModelType().getTitle()));
            }
            mDataToBind.add(item);
        }
        lastModel = favorite.getModelEnum();
    }
}
Also used : Favorite(com.thebluealliance.androidclient.models.Favorite) ListItem(com.thebluealliance.androidclient.listitems.ListItem) EventTypeHeader(com.thebluealliance.androidclient.listitems.EventTypeHeader)

Example 8 with EventTypeHeader

use of com.thebluealliance.androidclient.listitems.EventTypeHeader in project the-blue-alliance-android by the-blue-alliance.

the class EventInsights2016Renderer method generate2016MatchInsights.

private void generate2016MatchInsights(JsonObject quals, JsonObject elims) {
    mEventStats.add(new EventTypeHeader(mResources.getString(R.string.breakdown_match_stats)));
    addHighScore(quals, elims, "high_score");
    addQualVsElimInsights(quals, elims, matchTitles, matchKeys);
}
Also used : EventTypeHeader(com.thebluealliance.androidclient.listitems.EventTypeHeader)

Example 9 with EventTypeHeader

use of com.thebluealliance.androidclient.listitems.EventTypeHeader in project the-blue-alliance-android by the-blue-alliance.

the class EventInsights2016Renderer method generate2016DefenseInsights.

private void generate2016DefenseInsights(JsonObject quals, JsonObject elims) {
    mEventStats.add(new EventTypeHeader(mResources.getString(R.string.breakdown2016_defense_stats)));
    addQualVsElimInsightsWithPercentage(quals, elims, defenseName, defenseTitle);
}
Also used : EventTypeHeader(com.thebluealliance.androidclient.listitems.EventTypeHeader)

Example 10 with EventTypeHeader

use of com.thebluealliance.androidclient.listitems.EventTypeHeader in project the-blue-alliance-android by the-blue-alliance.

the class EventInsights2017Renderer method generate2017MatchInsights.

private void generate2017MatchInsights(JsonObject quals, JsonObject elims) {
    mEventStats.add(new EventTypeHeader(mResources.getString(R.string.breakdown_match_stats)));
    addHighScore(quals, elims, "high_score");
    addQualVsElimInsights(quals, elims, matchTitles, matchKeys);
}
Also used : EventTypeHeader(com.thebluealliance.androidclient.listitems.EventTypeHeader)

Aggregations

EventTypeHeader (com.thebluealliance.androidclient.listitems.EventTypeHeader)15 ListItem (com.thebluealliance.androidclient.listitems.ListItem)2 Favorite (com.thebluealliance.androidclient.models.Favorite)1 Subscription (com.thebluealliance.androidclient.models.Subscription)1