Android Open Source - digital-ocean-swimmer Domain Adapter

From Project

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.

Java Source Code

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) {;
        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;
            vi = inflater.inflate(R.layout.domain_list_row, parent, false);

        final Domain domain = data.get(position);
        TextView domainTextView = (TextView)vi.findViewById(;
        TextView ttlTextView = (TextView)vi.findViewById(;
        ttlTextView.setText("ttl : " + domain.getTtl());
        return vi;

Java Source Code List