Exemplo n.º 1
0
  protected View prepareView(Modificator item, int position, View convertView, ViewGroup parent) {
    ModifierViewHolder holder = (ModifierViewHolder) convertView.getTag();

    if (item instanceof AbstractModificator) {
      AbstractModificator modificator = (AbstractModificator) item;
      holder.active.setVisibility(View.VISIBLE);
      holder.active.setChecked(modificator.isActive());
      holder.active.setClickable(false);
      holder.active.setFocusable(false);
      holder.active.setTag(modificator);
    } else {
      holder.active.setVisibility(View.GONE);
    }

    holder.flip.setBackgroundResource(0);
    holder.flip.setScaleType(ScaleType.CENTER);
    if (item instanceof WoundModificator) {
      if (item.isActive()) holder.flip.setImageResource(R.drawable.icon_wound_selected);
      else holder.flip.setImageResource(R.drawable.icon_wound_normal);
    } else if (item instanceof RulesModificator) {
      holder.flip.setImageResource(Util.getThemeResourceId(getContext(), R.attr.imgSettings));
    } else if (item instanceof CustomModificator) {
      holder.flip.setImageResource(Util.getThemeResourceId(getContext(), R.attr.imgModifier));
    }

    if (item != null) {
      holder.text1.setText(item.getModificatorName());
      holder.text2.setText(item.getModificatorInfo());
    } else {
      holder.text1.setText(null);
      holder.text2.setText(null);
    }

    return convertView;
  }
Exemplo n.º 2
0
  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;
  }
Exemplo n.º 3
0
 @Override
 public void setValue(Integer value) {
   if (!Util.equalsOrNull(this.value, value)) {
     this.value = value;
     being.fireValueChangedEvent(this);
   }
 }
Exemplo n.º 4
0
  public Uri getIconUri() {

    if (iconUri != null) {
      return iconUri;
    } else {
      if (getSpecifications().isEmpty()) return null;
      else return Util.getUriForResourceId(DsaUtil.getResourceId(getSpecifications().get(0)));
    }
  }
Exemplo n.º 5
0
  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;
  }
Exemplo n.º 6
0
  protected View prepareView(
      Attribute attribute, int position, View convertView, ViewGroup parent) {
    if (attribute.getType() == AttributeType.Ausweichen) {
      return prepareAusweichenView(attribute, position, convertView, parent);
    } else {
      SeekViewHolder viewHolder = (SeekViewHolder) convertView.getTag();

      viewHolder.seek.setMax(attribute.getMaximum());
      viewHolder.seek.setMin(attribute.getMinimum());
      viewHolder.seek.setValue(attribute.getValue());
      viewHolder.seek.setLabel(viewHolder.value);
      viewHolder.seek.setTag(attribute);
      viewHolder.seek.setOnSeekBarChangeListener(this);

      viewHolder.text.setText(attribute.getType().code());
      Util.setLabel(viewHolder.text, attribute.getType(), probeListener, editListener);

      Util.setValue(hero, viewHolder.value, attribute, null, false, probeListener, editListener);

      return convertView;
    }
  }
Exemplo n.º 7
0
  protected View prepareView(Spell spell, int position, View convertView, ViewGroup parent) {
    TalentViewHolder holder = (TalentViewHolder) convertView.getTag();

    holder.text1.setText(spell.getName());

    Util.setVisibility(holder.text2, false, holder.text1);
    holder.text3.setText(spell.getProbeInfo().getAttributesString());

    if (spell.getValue() != null) {
      int modifier = hero.getModifier(spell);
      Util.setText(holder.text4, spell.getValue(), modifier, null);
    } else {
      Debug.warning(spell.getName() + " has no value");
    }
    Util.setVisibility(holder.text5, false, holder.text1);

    if (holder.indicator != null) {
      if (spell.hasFlag(Spell.Flags.ZauberSpezialisierung)
          || !TextUtils.isEmpty(spell.getZauberSpezialisierung())) {
        holder.indicator.setVisibility(View.VISIBLE);
        holder.indicator.setImageBitmap(indicatorFlash);
      } else if (spell.hasFlag(Spell.Flags.ÜbernatürlicheBegabung)) {
        holder.indicator.setVisibility(View.VISIBLE);
        holder.indicator.setImageBitmap(indicatorStar);
      } else if (spell.hasFlag(Spell.Flags.Hauszauber)) {
        holder.indicator.setVisibility(View.VISIBLE);
        holder.indicator.setImageBitmap(indicatorHouseGray);
      } else if (spell.hasFlag(Spell.Flags.Begabung)) {
        holder.indicator.setVisibility(View.VISIBLE);
        holder.indicator.setImageBitmap(indicatorStarGray);
      } else {
        holder.indicator.setVisibility(View.INVISIBLE);
      }
    }
    Util.applyRowStyle(spell, convertView, position);

    return convertView;
  }
Exemplo n.º 8
0
  protected View prepareView(FileListable file, int position, View convertView, ViewGroup parent) {
    EventViewHolder holder = (EventViewHolder) convertView.getTag();

    String fileName = file.getFile().getName();
    long fileSize = file.getFile().length();

    holder.text1.setText(fileName);
    holder.text2.setText(null);
    holder.text3.setText(Util.readableFileSize(fileSize));
    holder.flip.setImageResource(file.getIcon());
    holder.icon2.setVisibility(View.GONE);

    return convertView;
  }
Exemplo n.º 9
0
  public boolean checkValue(Integer newRefValue) {
    boolean changed = false;

    if (!Util.equalsOrNull(getReferenceValue(), newRefValue)) {
      setReferenceValue(newRefValue);
      changed = true;
    }
    Integer value = getValue();
    if (value != null) {
      int max = getMaximum();
      int min = getMinimum();
      if (value > max) {
        setValue(max);
        changed = true;
      } else if (value < min) {
        setValue(min);
        changed = true;
      }
    }
    return changed;
  }
Exemplo n.º 10
0
  protected View prepareView(NotesItem e, int position, View convertView, ViewGroup parent) {
    EventViewHolder holder = (EventViewHolder) convertView.getTag();

    if (e.getCategory() != null) {

      if (holder.flip != null) {
        holder.flip.setImageResource(e.getCategory().getDrawableId());
      }

      if (holder.icon2 != null) {
        if (e instanceof Event) {
          if (((Event) e).getAudioPath() != null) {
            holder.icon2.setVisibility(View.VISIBLE);
            holder.icon2.setImageResource(
                Util.getThemeResourceId(getContext(), R.attr.imgActionMicrophone));
          } else {
            holder.icon2.setVisibility(View.GONE);
          }
        } else {
          holder.icon2.setVisibility(View.GONE);
        }
      }
    }

    if (e.getCategory().hasName() && !TextUtils.isEmpty(e.getName())) {
      holder.text1.setText(e.getName().trim());
      holder.text2.setText(e.getComment().trim());
      holder.text2.setVisibility(View.VISIBLE);
    } else {
      holder.text1.setText(e.getComment().trim());
      holder.text2.setVisibility(View.GONE);
    }

    holder.text3.setText(e.getCategory().name());

    return convertView;
  }
Exemplo n.º 11
0
  protected View prepareView(
      EquippedItem equippedItem, int position, View convertView, ViewGroup parent) {

    ViewHolder holder = (ViewHolder) convertView.getTag();

    Item item = equippedItem.getItem();
    ItemSpecification itemSpecification = equippedItem.getItemSpecification();

    // if (equippedItem.getSecondaryItem() != null
    // &&
    // (equippedItem.getSecondaryItem().getItem().hasSpecification(Shield.class)
    // || (equippedItem
    // .getSecondaryItem().getItem().hasSpecification(Weapon.class) &&
    // equippedItem.getHand() == Hand.rechts))) {
    //
    // } else {
    // fightItemsOdd = !fightItemsOdd;
    // }

    StyleableSpannableStringBuilder title = new StyleableSpannableStringBuilder();
    if (!TextUtils.isEmpty(item.getTitle())) title.append(item.getTitle());

    holder.text2.setText(itemSpecification.getInfo());
    holder.text3.setText(null);

    holder.icon1.setImageResource(DsaUtil.getResourceId(itemSpecification));
    holder.icon1.setVisibility(View.VISIBLE);

    if (itemSpecification instanceof DistanceWeapon) {
      DistanceWeapon distanceWeapon = (DistanceWeapon) itemSpecification;

      holder.icon2.setImageResource(R.drawable.icon_target);
      holder.icon2.setVisibility(View.VISIBLE);

      if (equippedItem.getTalent() != null) {
        CombatProbe probe = equippedItem.getCombatProbeAttacke();
        Util.appendValue(hero, title, probe, null, getFilter().getSettings().isIncludeModifiers());
        holder.icon2.setEnabled(true);
        holder.icon1.setEnabled(true);
        holder.icon2.setTag(equippedItem);
        holder.icon2.setOnClickListener(targetListener);
        holder.icon1.setTag(probe);
        holder.icon1.setOnClickListener(probeListener);
      } else {
        holder.icon2.setEnabled(false);
        holder.icon2.setTag(null);
        holder.icon2.setOnClickListener(null);

        holder.icon1.setEnabled(false);
        holder.icon1.setTag(null);
        holder.icon1.setOnClickListener(null);
      }

      holder.text2.setText(distanceWeapon.getInfo(hero.getModifierTP(equippedItem)));

      if (hero.getHuntingWeapon() != null && hero.getHuntingWeapon().equals(equippedItem)) {
        holder.text3.setText(" Jagdwaffe");
      }

    } else if (itemSpecification instanceof Shield) {
      holder.icon1.setVisibility(View.INVISIBLE);
      holder.icon1.setTag(null);
      holder.icon1.setOnClickListener(null);

      if (equippedItem.getUsageType() == UsageType.Paradewaffe)
        holder.icon2.setImageURI(item.getIconUri());
      else holder.icon2.setImageResource(R.drawable.icon_shield);

      holder.icon2.setVisibility(View.VISIBLE);
      if (equippedItem.getTalent() != null) {
        holder.icon2.setEnabled(true);
        CombatProbe probe = equippedItem.getCombatProbeDefense();
        Util.appendValue(hero, title, probe, null, getFilter().getSettings().isIncludeModifiers());
        holder.icon2.setTag(probe);
        holder.icon2.setOnClickListener(probeListener);

        holder.text3.setText(equippedItem.getTalent().getName());
      } else {
        holder.icon2.setEnabled(false);
        holder.icon2.setTag(null);
        holder.icon2.setOnClickListener(null);
      }

    } else if (itemSpecification instanceof Weapon) {
      Weapon weapon = (Weapon) itemSpecification;

      holder.icon2.setImageResource(R.drawable.icon_shield);
      holder.icon2.setVisibility(View.VISIBLE);
      if (equippedItem.getTalent() != null) {

        CombatProbe pa = null, at = null;

        if (weapon.isAttackable()) {
          holder.icon1.setEnabled(true);
          holder.icon1.setVisibility(View.VISIBLE);
          at = equippedItem.getCombatProbeAttacke();
          holder.icon1.setTag(at);
          holder.icon1.setOnClickListener(probeListener);
        } else {
          holder.icon1.setVisibility(View.INVISIBLE);
          holder.icon1.setTag(null);
          holder.icon1.setOnClickListener(null);
        }

        if (weapon.isDefendable()) {
          holder.icon2.setEnabled(true);
          holder.icon2.setVisibility(View.VISIBLE);
          pa = equippedItem.getCombatProbeDefense();
          holder.icon2.setTag(pa);
          holder.icon2.setOnClickListener(probeListener);
        } else {
          holder.icon2.setVisibility(View.INVISIBLE);
          holder.icon2.setTag(null);
          holder.icon2.setOnClickListener(null);
        }

        String talentName = null;
        if (equippedItem.getTalent() != null) {
          talentName = equippedItem.getTalent().getName();
        }

        SpannableStringBuilder sb = new SpannableStringBuilder();

        if (!TextUtils.isEmpty(weapon.getName())) {
          sb.append(weapon.getName());
          sb.append("/");
        }
        if (!TextUtils.isEmpty(equippedItem.getItemSpecification().getSpecificationLabel())) {
          sb.append(equippedItem.getItemSpecification().getSpecificationLabel());
          sb.append("/");
        }
        sb.append(talentName);

        if (equippedItem.getHand() == Hand.links) {
          sb.append(" (Links)");
        }

        if (equippedItem.isBeidhändigerKampf()) {
          sb.append(" - BK");
        }

        holder.text3.setText(sb);

        Util.appendValue(hero, title, at, pa, getFilter().getSettings().isIncludeModifiers());
      } else {
        holder.icon2.setEnabled(false);
        holder.icon2.setTag(null);
        holder.icon2.setOnClickListener(null);

        holder.icon1.setEnabled(false);
        holder.icon1.setTag(null);
        holder.icon1.setOnClickListener(null);
      }
      if (getFilter().getSettings().isIncludeModifiers()) {
        holder.text2.setText(
            weapon.getInfo(
                hero.getModifiedValue(AttributeType.Körperkraft, true, true),
                hero.getModifierTP(equippedItem)));
      } else {
        holder.text2.setText(weapon.getInfo());
      }
    } else if (itemSpecification instanceof Armor) {
      // Armor armor = (Armor) itemSpecification;
      holder.icon2.setVisibility(View.GONE);
      holder.icon2.setTag(null);
      holder.icon2.setOnClickListener(null);
    }

    if (holder.icon_chain_top != null && holder.icon_chain_bottom != null) {
      if (equippedItem.getSecondaryItem() != null) {
        if (position > 0 && getItem(position - 1).equals(equippedItem.getSecondaryItem())) {
          holder.icon_chain_bottom.setVisibility(View.VISIBLE);
          holder.icon_chain_top.setVisibility(View.GONE);
        } else if (position < getCount()
            && getItem(position + 1).equals(equippedItem.getSecondaryItem())) {
          holder.icon_chain_top.setVisibility(View.VISIBLE);
          holder.icon_chain_bottom.setVisibility(View.GONE);
        }
      } else {
        holder.icon_chain_top.setVisibility(View.GONE);
        holder.icon_chain_bottom.setVisibility(View.GONE);
      }
    }

    holder.text1.setText(title);

    return convertView;
  }
Exemplo n.º 12
0
  protected View prepareView(Talent talent, int position, View convertView, ViewGroup parent) {
    TalentViewHolder holder = (TalentViewHolder) convertView.getTag();

    holder.text1.setText(talent.getName());

    String be = talent.getProbeInfo().getBe();

    if (TextUtils.isEmpty(be)) {
      Util.setVisibility(holder.text2, false, holder.text1);
      holder.text2.setText(null);
    } else {
      Util.setVisibility(holder.text2, true, holder.text1);
      holder.text2.setText(be);
    }
    if (talent.getComplexity() != null) {
      Util.setVisibility(holder.text2, true, holder.text1);
      if (holder.text2.length() > 0) holder.text2.append(" ");
      holder.text2.append(Util.toString(talent.getComplexity()));
    }
    holder.text3.setText(talent.getProbeInfo().getAttributesString());

    if (talent instanceof CombatMeleeTalent) {
      CombatMeleeTalent meleeTalent = (CombatMeleeTalent) talent;

      if (meleeTalent.getAttack() != null && meleeTalent.getAttack().getValue() != null) {
        int modifier = 0;
        if (filter.getSettings().isIncludeModifiers()) {
          modifier = hero.getModifier(meleeTalent.getAttack());
        }
        Util.setText(holder.text4, meleeTalent.getAttack().getValue(), modifier, null);
        holder.text4.setOnClickListener(probeListener);
        holder.text4.setOnLongClickListener(editListener);
        holder.text4.setTag(R.id.TAG_KEY_VALUE, meleeTalent);
        holder.text4.setTag(R.id.TAG_KEY_PROBE, meleeTalent.getAttack());
        Util.setVisibility(holder.text4, true, holder.text1);
      } else {
        Util.setVisibility(holder.text4, false, holder.text1);
      }

      if (meleeTalent.getDefense() != null && meleeTalent.getDefense().getValue() != null) {
        int modifier = 0;
        if (filter.getSettings().isIncludeModifiers()) {
          modifier = hero.getModifier(meleeTalent.getDefense());
        }
        Util.setText(holder.text5, meleeTalent.getDefense().getValue(), modifier, null);
        holder.text5.setOnClickListener(probeListener);
        holder.text5.setOnLongClickListener(editListener);
        holder.text5.setTag(R.id.TAG_KEY_VALUE, meleeTalent);
        holder.text5.setTag(R.id.TAG_KEY_PROBE, meleeTalent.getDefense());
        Util.setVisibility(holder.text5, true, holder.text1);
      } else {
        holder.text5.setVisibility(View.INVISIBLE);
      }

    } else if (talent instanceof CombatDistanceTalent) {

      CombatDistanceTalent distanceTalent = (CombatDistanceTalent) talent;

      if (distanceTalent.getValue() != null) {
        int modifier = 0;

        if (filter.getSettings().isIncludeModifiers()) {
          modifier = hero.getModifier(distanceTalent);
        }
        Util.setText(holder.text4, distanceTalent.getValue(), modifier, null);
        holder.text4.setOnClickListener(null);
        holder.text4.setClickable(false);
        Util.setVisibility(holder.text4, true, holder.text1);
      } else {
        Util.setVisibility(holder.text4, false, holder.text1);
      }
      Util.setVisibility(holder.text5, false, holder.text1);
    } else {
      int modifier = 0;
      if (filter.getSettings().isIncludeModifiers()) {
        modifier = hero.getModifier(talent);
      }
      Util.setText(holder.text4, talent.getValue(), modifier, null);
      holder.text4.setOnClickListener(null);
      holder.text4.setClickable(false); // hide text5 and expand text1
      // with its width
      Util.setVisibility(holder.text5, false, holder.text1);
    }

    if (holder.indicator != null) {
      if (talent.hasFlag(Talent.Flags.TalentSpezialisierung)
          || !TextUtils.isEmpty(talent.getTalentSpezialisierung())) {
        holder.indicator.setVisibility(View.VISIBLE);
        holder.indicator.setImageBitmap(indicatorFlash);
      } else if (talent.hasFlag(Flags.Meisterhandwerk)) {
        holder.indicator.setVisibility(View.VISIBLE);
        holder.indicator.setImageBitmap(indicatorHouse);
      } else if (talent.hasFlag(Flags.Talentschub)) {
        holder.indicator.setVisibility(View.VISIBLE);
        holder.indicator.setImageBitmap(indicatorStar);
      } else if (talent.hasFlag(Flags.Begabung)) {
        holder.indicator.setVisibility(View.VISIBLE);
        holder.indicator.setImageBitmap(indicatorStarGray);
      } else {
        holder.indicator.setVisibility(View.INVISIBLE);
      }
    }

    Util.applyRowStyle(talent, convertView, position);
    return convertView;
  }
Exemplo n.º 13
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {

    if (convertView == null) {

      switch (getItemViewType(position)) {
        case ITEM_TYPE_VIEW:
          {
            convertView =
                (ItemListItem) inflater.inflate(R.layout.item_listitem_view, parent, false);

            ViewHolder holder = new ViewHolder();
            holder.text1 = (TextView) convertView.findViewById(android.R.id.text1);
            holder.text2 = (TextView) convertView.findViewById(android.R.id.text2);
            holder.text3 = (TextView) convertView.findViewById(R.id.text3);
            holder.icon1 = (ImageView) convertView.findViewById(android.R.id.icon1);
            holder.flip = (FlipImageView) convertView.findViewById(android.R.id.icon1);

            holder.icon2 = (ImageView) convertView.findViewById(android.R.id.icon2);
            holder.icon_chain_bottom = (ImageView) convertView.findViewById(R.id.icon_chain_bottom);
            holder.icon_chain_top = (ImageView) convertView.findViewById(R.id.icon_chain_top);
            convertView.setTag(holder);
            break;
          }
        case ITEM_TYPE_EDIT:
          {
            convertView =
                (ItemListItem) inflater.inflate(R.layout.item_listitem_equippeditem, parent, false);
            ViewHolder holder = new ViewHolder();
            holder.text1 = (TextView) convertView.findViewById(android.R.id.text1);
            holder.text2 = (TextView) convertView.findViewById(android.R.id.text2);
            holder.text3 = (TextView) convertView.findViewById(R.id.text3);
            holder.icon1 = (ImageView) convertView.findViewById(android.R.id.icon1);
            holder.icon2 = (ImageView) convertView.findViewById(android.R.id.icon2);
            holder.icon_chain_bottom = (ImageView) convertView.findViewById(R.id.icon_chain_bottom);
            holder.icon_chain_top = (ImageView) convertView.findViewById(R.id.icon_chain_top);
            convertView.setTag(holder);
            break;
          }
        case ITEM_TYPE_SEEK:
          {
            convertView = (ViewGroup) inflater.inflate(R.layout.item_listitem_seek, parent, false);
            SeekViewHolder viewHolder = new SeekViewHolder();
            viewHolder.seek = (SeekBarEx) convertView.findViewById(R.id.wheel);
            viewHolder.text = (TextView) convertView.findViewById(R.id.wheel_label);
            viewHolder.value = (Button) convertView.findViewById(R.id.wheel_value);
            convertView.setTag(viewHolder);
            break;
          }
        case ITEM_TYPE_COMBAT_TALENT:
        case ITEM_TYPE_SIMPLE_TALENT:
          {
            convertView = inflater.inflate(R.layout.item_listitem_talent, parent, false);

            TalentViewHolder holder = new TalentViewHolder();
            // name
            holder.text1 = (TextView) convertView.findViewById(R.id.talent_list_item_text1);
            // be
            holder.text2 = (TextView) convertView.findViewById(R.id.talent_list_item_text2);
            // probe
            holder.text3 = (TextView) convertView.findViewById(R.id.talent_list_item_text3);
            // value / at
            holder.text4 = (TextView) convertView.findViewById(R.id.talent_list_item_text4);
            // pa
            holder.text5 = (TextView) convertView.findViewById(R.id.talent_list_item_text5);
            holder.indicator =
                (ImageView) convertView.findViewById(R.id.talent_list_item_indicator);
            convertView.setTag(holder);
            break;
          }
        case ITEM_TYPE_MODIFIER:
          {
            // We need the layoutinflater to pick up the view from xml
            // Pick up the TwoLineListItem defined in the xml file
            convertView = inflater.inflate(R.layout.item_listitem_modifier, parent, false);

            ModifierViewHolder holder = new ModifierViewHolder();
            holder.text1 = (TextView) convertView.findViewById(android.R.id.text1);
            holder.text2 = (TextView) convertView.findViewById(android.R.id.text2);
            holder.flip = (FlipImageView) convertView.findViewById(android.R.id.icon1);
            holder.active = (CheckBox) convertView.findViewById(R.id.active);
            convertView.setTag(holder);
            break;
          }
        case ITEM_TYPE_HEADER:
          {
            convertView = inflater.inflate(R.layout.item_listitem_header, parent, false);

            HeaderViewHolder holder = new HeaderViewHolder();
            holder.text1 = (TextView) convertView.findViewById(android.R.id.text1);
            convertView.setTag(holder);
            break;
          }
        case ITEM_TYPE_NOTES:
          {
            convertView = inflater.inflate(R.layout.item_listitem_event, parent, false);

            EventViewHolder holder = new EventViewHolder();
            holder.text1 = (TextView) convertView.findViewById(android.R.id.text1);
            holder.text2 = (TextView) convertView.findViewById(android.R.id.text2);
            holder.text3 = (TextView) convertView.findViewById(R.id.text3);
            holder.flip = (FlipImageView) convertView.findViewById(android.R.id.icon1);
            holder.icon2 = (ImageView) convertView.findViewById(android.R.id.icon2);

            convertView.setTag(holder);
            break;
          }
        case ITEM_TYPE_PURSE:
          convertView = inflater.inflate(R.layout.item_listitem_purse, parent, false);
          PurseViewHolder holder = new PurseViewHolder();

          holder.currencySpinner = (Spinner) convertView.findViewById(R.id.sp_currency);
          holder.header = (TextView) convertView.findViewById(R.id.tv_currency_header);

          holder.picker = new NumberPicker[4];
          holder.picker[0] = (NumberPicker) convertView.findViewById(R.id.popup_purse_dukat);
          holder.picker[1] = (NumberPicker) convertView.findViewById(R.id.popup_purse_silver);
          holder.picker[2] = (NumberPicker) convertView.findViewById(R.id.popup_purse_heller);
          holder.picker[3] = (NumberPicker) convertView.findViewById(R.id.popup_purse_kreuzer);

          holder.labels = new TextView[4];
          holder.labels[0] = (TextView) convertView.findViewById(R.id.tv_currency1);
          holder.labels[1] = (TextView) convertView.findViewById(R.id.tv_currency2);
          holder.labels[2] = (TextView) convertView.findViewById(R.id.tv_currency3);
          holder.labels[3] = (TextView) convertView.findViewById(R.id.tv_currency4);

          convertView.setTag(holder);
          break;
      }
    }

    FlippableViewHolder.prepare(position, convertView, (ListView) parent);

    Listable item = getItem(position);

    if (item instanceof EquippedItem) {
      convertView = prepareView((EquippedItem) item, position, convertView, parent);
    } else if (item instanceof Attribute) {
      convertView = prepareView((Attribute) item, position, convertView, parent);
    } else if (item instanceof Talent) {
      convertView = prepareView((Talent) item, position, convertView, parent);
    } else if (item instanceof Spell) {
      convertView = prepareView((Spell) item, position, convertView, parent);
    } else if (item instanceof Art) {
      convertView = prepareView((Art) item, position, convertView, parent);
    } else if (item instanceof Modificator) {
      convertView = prepareView((Modificator) item, position, convertView, parent);
    } else if (item instanceof HeaderListItem) {
      convertView = prepareView((HeaderListItem) item, position, convertView, parent);
    } else if (item instanceof FileListable) {
      convertView = prepareView((FileListable) item, position, convertView, parent);
    } else if (item instanceof NotesItem) {
      convertView = prepareView((NotesItem) item, position, convertView, parent);
    } else if (item instanceof PurseListable) {
      convertView = prepareView((PurseListable) item, position, convertView, parent);
    }

    if (item instanceof Markable) {
      Util.applyRowStyle((Markable) item, convertView, position);
    } else {
      Util.applyRowStyle(convertView, position);
    }

    return convertView;
  }