Android Open Source - HorizontalListView Compatible Array Adapter






From Project

Back to project page HorizontalListView.

License

The source code is released under:

Apache License

If you think the Android project HorizontalListView 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.example.horizontallistview;
//w  w w  .j a  v a2  s.c  om
import java.util.Collection;
import java.util.List;

import android.content.Context;
import android.widget.ArrayAdapter;

public class CompatibleArrayAdapter<T> extends ArrayAdapter<T> {

  public CompatibleArrayAdapter(Context context, int resource,
      int textViewResourceId, List<T> objects) {
    super(context, resource, textViewResourceId, objects);
  }

  public CompatibleArrayAdapter(Context context, int resource,
      int textViewResourceId, T[] objects) {
    super(context, resource, textViewResourceId, objects);
  }

  public CompatibleArrayAdapter(Context context, int resource,
      int textViewResourceId) {
    super(context, resource, textViewResourceId);
  }

  public CompatibleArrayAdapter(Context context, int textViewResourceId,
      List<T> objects) {
    super(context, textViewResourceId, objects);
  }

  public CompatibleArrayAdapter(Context context, int textViewResourceId,
      T[] objects) {
    super(context, textViewResourceId, objects);
  }

  public CompatibleArrayAdapter(Context context, int textViewResourceId) {
    super(context, textViewResourceId);
  }
  
  public void addAll(Collection<? extends T> collection) {
    setNotifyOnChange(false);
    for(T item : collection){
      add(item);
    }
    setNotifyOnChange(true);
    notifyDataSetChanged();
  }

}




Java Source Code List

android.widgetx.HorizontalListView.java
com.example.horizontallistview.CompatibleArrayAdapter.java
com.example.horizontallistview.SampleActivity.java