Android Open Source - Amppercent7 List View_ X User






From Project

Back to project page Amppercent7.

License

The source code is released under:

GNU General Public License

If you think the Android project Amppercent7 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 my.amppercent.adapters;
//www .  j  a v  a 2 s  .co m
import java.util.LinkedList;
import java.util.List;

import my.amppercent.remoteservice.XUser;

import android.util.Log;
import android.widget.ListView;
import android.app.Activity;

/**
 * Implementa la visualizzazione della lista degli utenti.  stato necessario
 * distinguerlo da ListViewAdapting, in quando era necessario ottenere da
 * AdapterUStatus delle informazioni aggiuntive (quali i wantchatxuser)
 * 
 * @author giacomo
 * 
 */
public class ListView_XUser {
  private ListView listview;
  private AdapterUStatus da;
  private Activity ma;

  /**
   * Restituisce gli elementi selezionati dall'utente, ai fini di insaurare
   * con loro una chat
   * 
   * @return
   */
  public List<XUser> getWanttochat() {
    return this.da.wantchatxuser;
  }

  /**
   * 
   * @param id_listview
   *            Id della lista da visualizzare
   * @param id_mainview
   *            Id del layout per la visualizzazione dell'item
   * @param toview
   *            Activity di destinazione
   * @param list
   *            Elementi di inizializzazione della lista
   */
  public ListView_XUser(int id_listview, int id_mainview, Activity toview,
      XUser... list) {
    this.ma = toview;
    this.listview = (ListView) toview.findViewById(id_listview);
    List<XUser> tmp = new LinkedList<XUser>();
    for (XUser x : list) {
      tmp.add(x);
    }
    this.da = new AdapterUStatus(toview, id_mainview, 0, tmp);
    if (this.listview == null) {
      Log.e("listview null", "null list view");
      return;
    }
    this.listview.setTranscriptMode(ListView.TRANSCRIPT_MODE_ALWAYS_SCROLL);
    this.listview.setStackFromBottom(true);
    this.listview.setAdapter(this.da);

  }

  public void add_and_update(XUser... messages) {
    for (XUser x : messages) {
      add_and_update(x);
    }
  }

  public void add_and_update(List<XUser> messages) {
    for (XUser x : messages) {
      add_and_update(x);
    }
  }

  public boolean checkExistance(XUser x) {
    for (XUser t : this.da.getList()) {
      if (t.getJid().equals(x.getJid()))
        return true;
    }
    return false;
  }

  public void add_and_update(XUser x) {
    this.da.add(x);
    this.da.notifyDataSetChanged();
  }

  public void clear() {
    this.da.clear();
    this.da.notifyDataSetChanged();
  }

  public Activity getActivity() {
    return this.ma;
  }

  public List<XUser> getChatWith() {
    return this.da.getChatWith();
  }

}




Java Source Code List

my.amppercent.adapters.AdapterChat.java
my.amppercent.adapters.AdapterElems.java
my.amppercent.adapters.AdapterIM.java
my.amppercent.adapters.AdapterUStatus.java
my.amppercent.adapters.ListViewAdapting.java
my.amppercent.adapters.ListView_XUser.java
my.amppercent.chatrequest.AvailabilitySettings.java
my.amppercent.chatrequest.SelectConnActivity.java
my.amppercent.chatrequest.connActivity.java
my.amppercent.chatrequest.serverActivity.java
my.amppercent.chattables.UberChat.java
my.amppercent.chattables.XConnect.java
my.amppercent.chattables.XRoster.java
my.amppercent.chattables.myChat.java
my.amppercent.project.Amppercent4Activity.java
my.amppercent.project.DownloadManager.java
my.amppercent.project.IBindRemoteService.java
my.amppercent.project.LaunchMe.java
my.amppercent.project.PrefActive.java
my.amppercent.project.TabFragment.java
my.amppercent.project.TextEntryActivity.java
my.amppercent.remoteservice.IFMessage.java
my.amppercent.remoteservice.IntentManage.java
my.amppercent.remoteservice.XUser.java
my.amppercent.remoteservice.chatAdapter.java
my.amppercent.types.Couple.java
my.amppercent.types.State.java
my.amppercent.types.myATask.java
my.amppercent.types.myNotification.java
my.amppercent.types.myYesNoDialog.java
my.amppercent.types.newActivity.java
org.jivesoftware.smackx.filetransfer.myOutgoingFileTransfer.java