Android Open Source - ReqDroid List View Projetos Adapter






From Project

Back to project page ReqDroid.

License

The source code is released under:

GNU General Public License

If you think the Android project ReqDroid 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

/*
 * Este arquivo esta sujeito aos termos e condicoes definidos
 * no arquivo 'LICENSE.txt, o qual e parte deste pacote de codigo fonte.
 *//*from   w w  w .j  a  v  a 2  s .c  o m*/

package com.vrs.reqdroid.util;

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

import com.vrs.reqdroid.R;
import com.vrs.reqdroid.models.Projeto;

import java.util.ArrayList;

/**
 * Classe que define o layout customizado da lista de projetos a serem abertos.
 *
 * @author Vinicius Rodrigues Silva <vinicius.rodsilva@gmail.com>
 * @version 1.0
 */

public class ListViewProjetosAdapter extends BaseAdapter {
    private final ArrayList<Projeto> projetosArrayList;

    private final LayoutInflater mInflater;

    public ListViewProjetosAdapter(Context context, ArrayList<Projeto> projetos) {
        projetosArrayList = projetos;
        mInflater = LayoutInflater.from(context);
    }

    public int getCount() {
        return projetosArrayList.size();
    }

    public Object getItem(int position) {
        return projetosArrayList.get(position);
    }

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

    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolderProjetos holder;
        if (convertView == null) {
            convertView = mInflater.inflate(R.layout.projeto_item, null);
            holder = new ViewHolderProjetos();
            holder.textoTitulo = (TextView) convertView.findViewById(R.id.tituloProjeto);
            holder.textoData = (TextView) convertView.findViewById(R.id.dataProjeto);

            convertView.setTag(holder);
        } else {
            holder = (ViewHolderProjetos) convertView.getTag();
        }

        holder.textoTitulo.setText(projetosArrayList.get(position).getTitulo());
        holder.textoData.setText(projetosArrayList.get(position).getData());
        return convertView;
    }
}
/**
 * Classe auxiliar para definir os itens customizados da lista
 * de projetos a serem abertos.
 *
 * @author Vinicius Rodrigues Silva
 * @version 1.0
 */
class ViewHolderProjetos {
    TextView textoTitulo;
    TextView textoData;
}




Java Source Code List

com.vrs.reqdroid.activities.DrawerPrincipalActivity.java
com.vrs.reqdroid.activities.MainActivity.java
com.vrs.reqdroid.activities.TelaAbrirProjetoActivity.java
com.vrs.reqdroid.activities.TelaEditarEscopoActivity.java
com.vrs.reqdroid.activities.TelaEscopoActivity.java
com.vrs.reqdroid.activities.TelaHipoteseDetalhadaActivity.java
com.vrs.reqdroid.activities.TelaNovoProjetoActivity.java
com.vrs.reqdroid.activities.TelaPrincipalActivity.java
com.vrs.reqdroid.activities.TelaRequisitoAtrasadoDetalhadoActivity.java
com.vrs.reqdroid.activities.TelaRequisitoDetalhadoActivity.java
com.vrs.reqdroid.activities.TelaSobreActivity.java
com.vrs.reqdroid.dao.BDGerenciador.java
com.vrs.reqdroid.dao.IOperacoesBD.java
com.vrs.reqdroid.fragments.CaracteristicasUsuarioFragment.java
com.vrs.reqdroid.fragments.DependenciasFragment.java
com.vrs.reqdroid.fragments.HipotesesEDependenciasFragment.java
com.vrs.reqdroid.fragments.HipotesesFragment.java
com.vrs.reqdroid.fragments.ProjetosListFragment.java
com.vrs.reqdroid.fragments.RequisitosAtrasadosFragment.java
com.vrs.reqdroid.fragments.RequisitosFragment.java
com.vrs.reqdroid.models.Dependencia.java
com.vrs.reqdroid.models.Projeto.java
com.vrs.reqdroid.util.AlertsUtil.java
com.vrs.reqdroid.util.DependenciasUtils.java
com.vrs.reqdroid.util.DrawerPrincipalAdapter.java
com.vrs.reqdroid.util.HipotesesUtils.java
com.vrs.reqdroid.util.IRequisito.java
com.vrs.reqdroid.util.ListViewDependenciasAdapter.java
com.vrs.reqdroid.util.ListViewHipotesesAdapter.java
com.vrs.reqdroid.util.ListViewProjetosAdapter.java
com.vrs.reqdroid.util.ListViewRequisitosAdapter.java
com.vrs.reqdroid.util.ListViewRequisitosAtrasadosAdapter.java
com.vrs.reqdroid.util.ProjetoUtils.java
com.vrs.reqdroid.util.RequisitosAtrasadosUtils.java
com.vrs.reqdroid.util.RequisitosUtils.java