use of com.thebluealliance.androidclient.interfaces.RenderableModel in project the-blue-alliance-android by the-blue-alliance.
the class MatchListAdapter method getChildView.
@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
if (groupPosition >= mGroups.size() || childPosition >= mGroups.get(groupPosition).children.size()) {
// Can't render due to bounds errors
return new LabelValueListItem("Match", "Unable to render").getView(mActivity, mInflater, convertView);
}
RenderableModel child = mGroups.get(groupPosition).children.get(childPosition);
if (child instanceof Match) {
((Match) child).setSelectedTeam(mTeamKey);
}
ListItem renderedChild = child.render(mRendererSupplier);
if (renderedChild != null) {
return renderedChild.getView(mActivity, mInflater, convertView);
} else {
return new LabelValueListItem("Match", "Unable to render").getView(mActivity, mInflater, convertView);
}
}
Aggregations