Android Open Source - isidore Droplet List Adapter

From Project

Back to project page isidore.


The source code is released under:

GNU General Public License

If you think the Android project isidore 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.tbardici.isidore;
// w w w.  j a v a  2 s . c  om
import java.util.List;

import com.tbardici.isidore.droplet.MyDroplets;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

 * @author Teo
public class DropletListAdapter extends ArrayAdapter<MyDroplets.Droplet> {

  Context mContext;
  public DropletListAdapter(Context context,
      int textViewResourceId, List<MyDroplets.Droplet> objects) {
    super(context, textViewResourceId, objects);
    mContext = context;
  public View getView(int position, View convertView, ViewGroup parent) {
    /* This is the droplet for which we're drawing now */
    MyDroplets.Droplet droplet = (MyDroplets.Droplet) super.getItem(position);
    /* Inflating the row */
    LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View row = inflater.inflate(R.layout.row, parent, false);
      TextView label=(TextView)row.findViewById(;
      ImageView icon=(ImageView)row.findViewById(;
      /* Pick icon for the droplet, based on distro */
      if (droplet.image.distribution.equals(DOApi.DISTRO.Ubuntu)) {
      } else if (droplet.image.distribution.equals(DOApi.DISTRO.CentOS)){
      } else if (droplet.image.distribution.equals(DOApi.DISTRO.ArchLinux)){
      } else if (droplet.image.distribution.equals(DOApi.DISTRO.Debian)){
      } else if (droplet.image.distribution.equals(DOApi.DISTRO.Fedora)){
    return row;

Java Source Code List