use of fr.neamar.lolgamedata.pojo.ChampionInGame in project teamward-client by Neamar.
the class PremadeTipHolder method drawChampions.
private void drawChampions(Team team) {
LinearLayout linearLayout = team.teamId == 100 ? blueTeamLayout : redTeamLayout;
int dpConversion = (int) itemView.getResources().getDimension(R.dimen.tip_premade_champion_thumbnail);
int spConversion = (int) itemView.getResources().getDimension(R.dimen.tip_premade_champion_text_separator);
// Clean up old views
linearLayout.removeAllViews();
for (List<Integer> subPremade : team.premades) {
for (int summonerId : subPremade) {
Player p = findPlayerById(team, summonerId);
if (p == null) {
continue;
}
ChampionInGame champion = p.champion;
ImageView imageview = new ImageView(itemView.getContext());
imageview.setImageResource(R.drawable.default_champion);
imageview.setLayoutParams(new LinearLayout.LayoutParams(dpConversion, dpConversion));
linearLayout.addView(imageview);
ImageLoader.getInstance().displayImage(champion.imageUrl, imageview);
imageview.setContentDescription(champion.name);
}
if (subPremade != team.premades.get(team.premades.size() - 1)) {
TextView textView = new TextView(itemView.getContext());
textView.setText("—");
textView.setGravity(Gravity.CENTER);
textView.setTextSize(spConversion);
linearLayout.addView(textView);
}
}
}
Aggregations