Android Open Source - hacktoolkit-android_lib H T K Contacts Adapter






From Project

Back to project page hacktoolkit-android_lib.

License

The source code is released under:

MIT License

If you think the Android project hacktoolkit-android_lib 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.hacktoolkit.android.adapters;
/*from   ww w .j  av a2 s  . c o  m*/
import java.util.ArrayList;

import android.app.Activity;
import android.widget.ArrayAdapter;

import com.hacktoolkit.android.models.HTKContact;

public class HTKContactsAdapter extends ArrayAdapter<HTKContact> {
  private boolean loaded = false;
  protected final Activity context;
  protected final ArrayList<HTKContact> contacts;

  public HTKContactsAdapter(Activity context, int layoutId, ArrayList<HTKContact> contacts) {
    super(context, layoutId, contacts);
    this.context = context;
    this.contacts = contacts;
  }

  public void setItemSelected(int position, boolean isSelected) {
    HTKContact contact = this.getItem(position);
    contact.setSelected(isSelected);
  }

  public ArrayList<HTKContact> getSelectedContacts() {
    ArrayList<HTKContact> selectedContacts = new ArrayList<HTKContact>();
    for (int i=0; i < this.getCount(); ++i) {
      HTKContact contact = this.getItem(i);
      if ((Boolean) contact.getMetaData("selected")) {
        selectedContacts.add(contact);
      }
    }
    return selectedContacts;
  }

  public void loadContacts(ArrayList<HTKContact> contacts) {
    for (HTKContact contact : contacts) {
      this.add(contact);
    }
    this.loadComplete();    
  }

  public void loadComplete() {
    loaded = true;
  }

  public boolean isLoaded() {
    return loaded;
  }
}




Java Source Code List

com.hacktoolkit.android.activities.HTKSplashScreenActivity.java
com.hacktoolkit.android.adapters.HTKContactsAdapter.java
com.hacktoolkit.android.api_helpers.FacebookHelper.java
com.hacktoolkit.android.api_helpers.HTKCallback.java
com.hacktoolkit.android.api_helpers.ParseHelper.java
com.hacktoolkit.android.constants.GeoConstants.java
com.hacktoolkit.android.constants.StringConstants.java
com.hacktoolkit.android.constants.TimeConstants.java
com.hacktoolkit.android.constants.UnitConstants.java
com.hacktoolkit.android.fragments.ContactsFragment.java
com.hacktoolkit.android.maps.MapUtils.java
com.hacktoolkit.android.maps.Mapper.java
com.hacktoolkit.android.models.HTKContact.java
com.hacktoolkit.android.user.HTKUser.java
com.hacktoolkit.android.utils.BitmapUtils.java
com.hacktoolkit.android.utils.ContactsUtils.java
com.hacktoolkit.android.utils.FileUtils.java
com.hacktoolkit.android.utils.HTKUtils.java
com.hacktoolkit.android.utils.SystemUiHiderBase.java
com.hacktoolkit.android.utils.SystemUiHiderHoneycomb.java
com.hacktoolkit.android.utils.SystemUiHider.java