Android Open Source - TextSpam Contact List Adapter






From Project

Back to project page TextSpam.

License

The source code is released under:

Apache License

If you think the Android project TextSpam 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.andrew749.textspam.Adapters;
//from  w ww . j av a2 s  . c o  m
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.andrew749.textspam.Custom;
import com.andrew749.textspam.R;

import java.util.ArrayList;

/**
 * Created by andrew on 25/06/13.
 */
public class ContactListAdapter extends ArrayAdapter<Custom> {
    private ArrayList<Custom> entries;
    private Activity ac;

    public ContactListAdapter(Activity a, int textViewResourceId, ArrayList<Custom> list) {
        super(a, textViewResourceId, list);
        entries = list;
        ac = a;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        ViewHolder holder = null;
        if (v == null) {
            LayoutInflater vi =
                    (LayoutInflater) ac.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.listitem, parent, false);
            holder = new ViewHolder();
            holder.tv = (TextView) v.findViewById(R.id.numberoption);
            v.setTag(holder);
        } else {
            holder = (ViewHolder) v.getTag();

        }
        Custom numbers = entries.get(position);
        if (numbers != null) {
            holder.tv.setText("" + numbers.getPhoneNumber());
        }
        return v;
    }

    public class ViewHolder {
        TextView tv;
    }
}




Java Source Code List

com.andrew749.textspam.Custom.java
com.andrew749.textspam.MainActivity.java
com.andrew749.textspam.MessageReciever.java
com.andrew749.textspam.Messager.java
com.andrew749.textspam.SwipeDismissListViewTouchListener.java
com.andrew749.textspam.Adapters.AutoCompleteCursorAdapter.java
com.andrew749.textspam.Adapters.ContactListAdapter.java
com.andrew749.textspam.Database.ConversationModel.java
com.andrew749.textspam.Database.DataSource.java
com.andrew749.textspam.Database.DatabaseHelper.java
com.andrew749.textspam.Fragments.Conversations.java
com.andrew749.textspam.Fragments.QuickMessageFragment.java
com.andrew749.textspam.Fragments.TutorialActivity.java
com.inscription.ChangeLogDialog.java
com.inscription.WhatsNewDialog.java