use of fr.free.nrw.commons.profile.ProfileActivity in project apps-android-commons by commons-app.
the class LeaderboardListAdapter method onBindViewHolder.
/**
* Overrides the onBindViewHolder Set the view at the specific position with the specific value
* @param holder
* @param position
*/
@Override
public void onBindViewHolder(@NonNull LeaderboardListAdapter.ListViewHolder holder, int position) {
TextView rank = holder.rank;
SimpleDraweeView avatar = holder.avatar;
TextView username = holder.username;
TextView count = holder.count;
rank.setText(getItem(position).getRank().toString());
avatar.setImageURI(Uri.parse(getItem(position).getAvatar()));
username.setText(getItem(position).getUsername());
count.setText(getItem(position).getCategoryCount().toString());
/*
Now that we have our in app profile-section, lets take the user there
*/
holder.itemView.setOnClickListener(view -> {
if (view.getContext() instanceof ProfileActivity) {
((Activity) (view.getContext())).finish();
}
ProfileActivity.startYourself(view.getContext(), getItem(position).getUsername(), true);
});
}
Aggregations