Skip to content
Snippets Groups Projects
Select Git revision
  • c4f25e5d9afa4709eeb17964850b2914de67f0f4
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

GModelIO_Mesh.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    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;
        }
    }