Android Open Source - mailinglistmoderator List Server Adapter






From Project

Back to project page mailinglistmoderator.

License

The source code is released under:

Copyright (c) 2010, Magnus Hagander All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:...

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

/*
 * ListServerAdapter.java - This class holds an ArrayAdapter for the main activity.
 * //  w  w  w. ja v a  2s.co m
 * Copyright (C) 2010 Magnus Hagander <magnus@hagander.net>
 * 
 * This software is released under the BSD license.
 */
package net.hagander.mailinglistmoderator.glue;

import java.util.Vector;

import net.hagander.mailinglistmoderator.R;
import net.hagander.mailinglistmoderator.backend.ListServer;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

/**
 * @author Magnus Hagander <magnus@hagander.net>
 * 
 */
public class ListServerAdapter extends ArrayAdapter<ListServer> {
  private Vector<ListServer> items;

  public ListServerAdapter(Context context, int textViewResourceId,
      Vector<ListServer> servers) {
    super(context, textViewResourceId, servers);

    items = servers;
  }

  /**
   * Create a view that contains the information we want to show about each
   * list.
   */
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    View v = convertView;

    if (v == null) {
      LayoutInflater vi = (LayoutInflater) getContext().getSystemService(
          Context.LAYOUT_INFLATER_SERVICE);
      v = vi.inflate(R.layout.main_item, null);
    }
    ListServer o = items.get(position);
    if (o != null) {
      TextView n = (TextView) v.findViewById(R.id.TextView_ServerName);
      TextView s = (TextView) v.findViewById(R.id.TextView_ServerStatus);

      n.setText(o.getName());
      s.setText(o.getStatus());
    }
    return v;
  }
}




Java Source Code List

net.hagander.mailinglistmoderator.MailinglistModerator.java
net.hagander.mailinglistmoderator.MessageViewActivity.java
net.hagander.mailinglistmoderator.QueueListActivity.java
net.hagander.mailinglistmoderator.ServerEditor.java
net.hagander.mailinglistmoderator.backend.ListServer.java
net.hagander.mailinglistmoderator.backend.MailMessage.java
net.hagander.mailinglistmoderator.backend.providers.Dummy.java
net.hagander.mailinglistmoderator.backend.providers.Mailman.java
net.hagander.mailinglistmoderator.backend.providers.Majordomo2.java
net.hagander.mailinglistmoderator.backend.providers.Unconfigured.java
net.hagander.mailinglistmoderator.glue.ListServerAdapter.java
net.hagander.mailinglistmoderator.glue.MailMessageAdapter.java
net.hagander.mailinglistmoderator.preferences.SSLCertDialogPreference.java