protected View prepareView(Art art, int position, View convertView, ViewGroup parent) { TalentViewHolder holder = (TalentViewHolder) convertView.getTag(); Util.setVisibility(holder.text5, false, holder.text1); holder.text1.setText(art.getFullName()); ArtInfo artInfo = art.getInfo(); StringBuilder info = new StringBuilder(); if (artInfo != null && !TextUtils.isEmpty(artInfo.getTarget())) { info.append(artInfo.getTarget()); } if (artInfo != null && !TextUtils.isEmpty(artInfo.getRange())) { if (info.length() > 0) info.append(","); info.append(artInfo.getRange()); } if (artInfo != null && !TextUtils.isEmpty(artInfo.getCastDuration())) { if (info.length() > 0) info.append(","); info.append(artInfo.getCastDuration()); } holder.text2.setText(info); if (art.hasCustomProbe() && !TextUtils.isEmpty(art.getProbeInfo().getAttributesString())) { holder.text3.setText(art.getProbeInfo().getAttributesString()); } else if (!TextUtils.isEmpty(artInfo.getProbe()) && art.getProbeInfo().getAttributeTypes() == null) { holder.text3.setText(artInfo.getProbe()); } else { if (artInfo != null && !TextUtils.isEmpty(artInfo.getEffectDuration())) holder.text3.setText(artInfo.getEffectDuration()); else holder.text3.setText(null); } if (art.getProbeInfo().getErschwernis() != null) { holder.text4.setText(Util.toProbe(art.getProbeInfo().getErschwernis())); holder.text4.setVisibility(View.VISIBLE); } else holder.text4.setVisibility(View.INVISIBLE); if (holder.indicator != null) { if (art.hasFlag(Art.Flags.Begabung)) { holder.indicator.setVisibility(View.VISIBLE); holder.indicator.setImageBitmap(indicatorStarGray); } else { holder.indicator.setVisibility(View.INVISIBLE); } } Util.applyRowStyle(art, convertView, position); return convertView; }
protected View prepareAusweichenView( Attribute attribute, int position, View convertView, ViewGroup parent) { ViewHolder holder = (ViewHolder) convertView.getTag(); holder.icon1.setOnClickListener(getProbeListener()); holder.icon1.setOnLongClickListener(getEditListener()); holder.icon1.setImageResource(R.drawable.icon_ausweichen); holder.icon1.setVisibility(View.VISIBLE); holder.icon2.setImageResource(R.drawable.icon_target); holder.icon2.setVisibility(View.VISIBLE); holder.icon2.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (ausweichenModificationDialog == null) { ausweichenModificationDialog = new EvadeChooserDialog(main); } ausweichenModificationDialog.show(); } }); StyleableSpannableStringBuilder title = new StyleableSpannableStringBuilder(); title.append(attribute.getName()); Util.appendValue( hero, title, attribute, null, getFilter() != null ? getFilter().getSettings().isIncludeModifiers() : true); holder.text1.setText(title); holder.text2.setText("Modifikator " + Util.toProbe(attribute.getProbeInfo().getErschwernis())); holder.icon1.setTag(attribute); holder.icon_chain_top.setVisibility(View.GONE); holder.icon_chain_bottom.setVisibility(View.GONE); return convertView; }