use of com.thebluealliance.androidclient.itemviews.TeamRankingItemView in project the-blue-alliance-android by the-blue-alliance.
the class EventRankingsFragment method initializeAdapterCreator.
@Override
public void initializeAdapterCreator(SmartAdapter.MultiAdaptersCreator creator) {
creator.map(TeamRankingViewModel.class, TeamRankingItemView.class);
creator.listener((actionId, item, position, view) -> {
if (actionId == Interactions.TEAM_RANKING_CLICKED && item instanceof TeamRankingViewModel) {
TeamRankingViewModel ranking = (TeamRankingViewModel) item;
startActivity(TeamAtEventActivity.newInstance(getContext(), mEventKey, ranking.getTeamKey()));
/* Track the call */
AnalyticsHelper.sendClickUpdate(getActivity(), "team@event_click", "EventRankingsFragment", mEventKey);
} else if (actionId == Interactions.EXPAND_TEAM_RANKING && view instanceof TeamRankingItemView) {
TeamRankingItemView itemView = (TeamRankingItemView) view;
itemView.toggleRankingsExpanded();
}
});
}
Aggregations