Back to project page digital-ocean-swimmer.
The source code is released under:
MIT License
If you think the Android project digital-ocean-swimmer 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 com.yassirh.digitalocean.ui; // ww w .j a v a 2s. c o m import java.util.List; 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.yassirh.digitalocean.R; import com.yassirh.digitalocean.model.Domain; public class DomainAdapter extends BaseAdapter { private List<Domain> data; private static LayoutInflater inflater=null; public DomainAdapter(Context context, List<Domain> data) { this.data=data; inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } public int getCount() { return data.size(); } public Object getItem(int position) { return data.get(position); } public long getItemId(int position) { return (long)position; } public View getView(int position, View convertView, ViewGroup parent) { View vi=convertView; if(convertView==null) vi = inflater.inflate(R.layout.domain_list_row, parent, false); final Domain domain = data.get(position); TextView domainTextView = (TextView)vi.findViewById(R.id.domainTextView); TextView ttlTextView = (TextView)vi.findViewById(R.id.ttlTextView); domainTextView.setText(domain.getName()); ttlTextView.setText("ttl : " + domain.getTtl()); return vi; } }