Skip to content
Snippets Groups Projects
Select Git revision
  • f55633bad0503ecf844c3a10072aaf1d9e92e2f8
  • master default protected
  • overlaps_tags_and_distributed_export
  • overlaps_tags_and_distributed_export_rebased
  • relaying
  • alphashapes
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

GModelIO_MAIL.cpp

Blame
  • ModelArrayAdapter.java 1.54 KiB
    package org.geuz.onelab;
    
    import java.util.List;
    import java.util.ArrayList;
    
    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;
    
    public class ModelArrayAdapter extends ArrayAdapter<Model> {
        private List<Model> _models;
    
        public ModelArrayAdapter(Context c)
            {
            super(c, R.layout.model);
            _models = new ArrayList<Model>();
        }
    
        @Override
        public void add(Model model)
        {
            super.add(model);
            _models.add(model);
        }
    
        public Model getModel(int pos) { return _models.get(pos); }
    
        @Override
        public View getView(int position, View convertView, final ViewGroup parent)
        {
            LayoutInflater inflater = (LayoutInflater) parent.getContext()
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            final Model m = _models.get(position);
            View rowView = inflater.inflate(R.layout.model, parent, false);
            TextView title = (TextView) rowView.findViewById(R.id.title);
            TextView description = (TextView) rowView.findViewById(R.id.description);
            ImageView icon = (ImageView) rowView.findViewById(R.id.icon);
            if(m.getName() != null) title.setText(m.getName());
            if(m.getSummary() != null) description.setText(m.getSummary());
            if(m.getBitmap() != null) icon.setImageBitmap(m.getBitmap());
            else icon.setImageResource(R.drawable.ic_launcher);
            return rowView;
        }
    }