Back to project page PicPosterComplete.
The source code is released under:
Apache License
If you think the Android project PicPosterComplete listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ca.ualberta.cs.picposter.model; /*from w w w. j av a 2 s . c o m*/ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.List; import android.graphics.Bitmap; import android.widget.ArrayAdapter; import ca.ualberta.cs.picposter.network.ElasticSearchOperations; /** * Represents a list of all Pic Posts. * @author zjullion */ public class PicPosterModelList { private List<PicPostModel> list; private ArrayAdapter<PicPostModel> adapter; public PicPosterModelList() { this.list = new ArrayList<PicPostModel>(); } public void addPicPost(Bitmap pic, String text, Date timestamp) { PicPostModel picPost = new PicPostModel(pic, text, timestamp); this.list.add(picPost); this.adapter.notifyDataSetChanged(); ElasticSearchOperations.pushPicPostModel(picPost); } public void addPicPostCollection(Collection<PicPostModel> posts) { this.list.addAll(posts); this.adapter.notifyDataSetChanged(); } public void clear() { this.list.clear(); this.adapter.notifyDataSetChanged(); } public List<PicPostModel> getList() { return Collections.unmodifiableList(this.list); } public void setAdapter(ArrayAdapter<PicPostModel> adapter) { this.adapter = adapter; } }