Android Open Source - UniApp Esame Adapter






From Project

Back to project page UniApp.

License

The source code is released under:

MIT License

If you think the Android project UniApp 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 it.nic.uniapp.adapters;
//from   w w  w. j  a va  2  s .  c o m
import it.nic.uniapp.cmp.EsameRowControl;
import it.nic.uniapp.db.EsameEntity;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class EsameAdapter extends BaseAdapter {

  private Context context = null;
  private ArrayList<EsameEntity> esami = null;

  public EsameAdapter(Context context, List<EsameEntity> objects) {
    super();

    this.context = context;
    this.esami = new ArrayList(objects);
  }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    if (esami != null && context != null) {

      View itemView;

      if (convertView == null) {

        itemView = new EsameRowControl(this.context);

      } else {
        itemView = (EsameRowControl) convertView;
      }

      EsameEntity currentRow = esami.get(position);

      ((EsameRowControl) itemView).LoadEntity(currentRow);

      return itemView;
    }
    
    return null;
  }

  @Override
  public Object getItem(int position) {

    if (this.esami != null) {
      return this.esami.get(position);
    }
    return null;
  }

  @Override
  public long getItemId(int position) {
    return position;
  }

  @Override
  public int getCount() {
    if (this.esami != null) {
      return this.esami.size();
    }

    return 0;
  }
}




Java Source Code List

it.nic.uniapp.AddEsame.java
it.nic.uniapp.CalendarioEsami.java
it.nic.uniapp.FunzioniEsami.java
it.nic.uniapp.ListaEsami.java
it.nic.uniapp.MainActivity.java
it.nic.uniapp.PopUpWindow.java
it.nic.uniapp.UpdateEsame.java
it.nic.uniapp.adapters.EsameAdapter.java
it.nic.uniapp.adapters.GridCellAdapter.java
it.nic.uniapp.cmp.EsameRowControl.java
it.nic.uniapp.core.Constants.java
it.nic.uniapp.core.PageLoader.java
it.nic.uniapp.db.DBHandler.java
it.nic.uniapp.db.DatabaseConfigUtil.java
it.nic.uniapp.db.DatabaseHelper.java
it.nic.uniapp.db.EsameEntity.java
it.nic.uniapp.db.IDBHandler.java
it.nic.uniapp.util.Util.java