Android Open Source - Qachee Character Adapter

From Project

Back to project page Qachee.


The source code is released under:

Apache License

If you think the Android project Qachee listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.qachee.sample.adapter;
/*w w  w.j a v  a  2  s .co  m*/
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.qachee.QacheeManager;
import com.qachee.sample.domain.Character;
import com.qachee.sample.view.CharacterItemView;

import java.util.List;

 * CharacterAdapter
public class CharacterAdapter extends BaseAdapter {

  private List<com.qachee.sample.domain.Character> list;

  public CharacterAdapter(List<Character> list) {
    this.list = list;

  public int getCount() {
    return this.list.size();

  public Character getItem(int i) {
    return this.list.get(i);

  public long getItemId(int i) {
    return i;

  public View getView(int position, View convertView, ViewGroup parent) {

    CharacterItemView itemView;
    Character character = QacheeManager.getInstance().get(getItem(position), Character.class, false);

    if (convertView != null) {
      itemView = (CharacterItemView) convertView;
    } else {
      itemView = new CharacterItemView(parent.getContext());

    return itemView;

Java Source Code List