use of cl.smartcities.isci.transportinspector.adapters.RankingAdapter in project androidApp by InspectorIncognito.
the class RankingActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account_user_ranking);
ArrayList<TranSappUser> topRanking = this.getIntent().getExtras().getParcelableArrayList(TOP_RANKING_KEY);
ArrayList<TranSappUser> tranSappUserRanking = this.getIntent().getExtras().getParcelableArrayList(USER_RANKING_KEY);
rcyList = findViewById(R.id.rcyList);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
rcyList.setLayoutManager(layoutManager);
rcyList.addItemDecoration(new InsetDecoration(this));
adapter = new RankingTopUsersAdapter(this, topRanking);
rcyList.setAdapter(adapter);
if (!TranSappAccountManager.isLoggedIn()) {
finish();
return;
}
RankingAdapter rankingAdapter = new RankingAdapter(this, tranSappUserRanking, TranSappAccountManager.getCurrentAccount().currentUser);
listView = findViewById(R.id.list_view);
listView.setLayoutManager(new LinearLayoutManager(this));
listView.setAdapter(rankingAdapter);
listView.getLayoutManager().scrollToPosition(getFixedUserPosition(getCurrentUserPosition(tranSappUserRanking)));
setResult(RESULT_OK);
}
Aggregations