Android Open Source - GreenGear Array Veloc Adapter






From Project

Back to project page GreenGear.

License

The source code is released under:

MIT License

If you think the Android project GreenGear 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.bradleycurran.velocadapter;
/*www  .  j  a va2 s. com*/
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import android.content.Context;

public abstract class ArrayVelocAdapter<T> extends VelocAdapter {

    private List<T> mList;

    public ArrayVelocAdapter(Context context) {
        super(context);
        mList = new ArrayList<T>();
    }

    public ArrayVelocAdapter(Context context, List<T> list) {
        super(context);
        mList = list;
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public T getItem(int position) {
        return mList.get(position);
    }

    public void add(T object) {
        mList.add(object);
        notifyDataSetChanged();
    }

    public void addAll(Collection<? extends T> collection) {
        mList.addAll(collection);
        notifyDataSetChanged();
    }

    public void addAll(T... items) {
        Collections.addAll(mList, items);
        notifyDataSetChanged();
    }

    public void insert(T object, int index) {
        mList.add(index, object);
        notifyDataSetChanged();
    }

    public void setList(List<T> list) {
        mList = list;
        notifyDataSetChanged();
    }

    public void remove(T object) {
        mList.remove(object);
        notifyDataSetChanged();
    }

    public void clear() {
        mList.clear();
        notifyDataSetChanged();
    }
}




Java Source Code List

com.bradleycurran.droidprefs.DroidPrefs.java
com.bradleycurran.greengear.model.KeyValue.java
com.bradleycurran.greengear.util.AssetUtil.java
com.bradleycurran.greengear.util.Log.java
com.bradleycurran.greengear.util.ViewUtil.java
com.bradleycurran.velocadapter.ArrayVelocAdapter.java
com.bradleycurran.velocadapter.VelocAdapter.java
com.bradleycurran.velocadapter.ViewBinder.java
com.bradleycurran.viewquery.Operation.java
com.bradleycurran.viewquery.ViewQuery.java
com.bradleycurran.viewquery.animation.hc.BounceTouchListener.java