Back to project page mitlocate.
The source code is released under:
MIT License
If you think the Android project mitlocate listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.mit.locate.alerts; /*from www . ja va 2s . c o m*/ import java.util.ArrayList; import edu.mit.locate.R; import android.content.Context; import android.graphics.Typeface; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; public class AlertsListAdapter extends BaseAdapter { private static ArrayList<Alert> searchArrayList; private LayoutInflater mInflater; public AlertsListAdapter(Context context, ArrayList<Alert> results) { searchArrayList = results; mInflater = LayoutInflater.from(context); } public int getCount() { return searchArrayList.size(); } public Object getItem(int position) { return searchArrayList.get(position); } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.row_alert, null); holder = new ViewHolder(); holder.txtName = (TextView) convertView.findViewById(R.id.alertName); holder.txtDesc = (TextView) convertView.findViewById(R.id.alertDesc); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } /*Typeface lumos = Typeface.createFromAsset(convertView.getContext().getAssets(), "lumos.ttf"); Typeface quint = Typeface.createFromAsset(convertView.getContext().getAssets(), "Quintessential.ttf"); holder.txtName.setTypeface(lumos); holder.txtLocation.setTypeface(quint);*/ holder.txtName.setText(searchArrayList.get(position).getName()); holder.txtDesc.setText(searchArrayList.get(position).getDesc()); return convertView; } static class ViewHolder { TextView txtName, txtDesc; } }