use of greendroid.widget.ItemAdapter in project GreenDroid by cyrilmottier.
the class BasicItemActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
List<Item> items = new ArrayList<Item>();
items.add(new SeparatorItem("Class 1"));
items.add(new ThumbnailItem("Powered paragliding", "aka paramotoring", R.drawable.class1));
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
items.add(new SeparatorItem("Class 2"));
items.add(new DrawableItem("Trikes", R.drawable.class2));
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
items.add(new SeparatorItem("Class 3"));
items.add(new ThumbnailItem("Multi-axis", "Looks like a tiny plane", R.drawable.class3));
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
items.add(new SeparatorItem("Class 4"));
items.add(new ThumbnailItem("Auto-gyro", "A scary helicopter", R.drawable.class4));
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
items.add(new SeparatorItem("Class 5"));
items.add(new DrawableItem("Hot air baloon", R.drawable.class5));
items.add(new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in."));
final Item item1 = new SeparatorItem("Class 6");
final Item item2 = new TextItem("Airbus/Boeing planes");
final Item item3 = new DescriptionItem("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus consequat leo, et tincidunt justo tristique in.");
items.add(item1);
items.add(item2);
items.add(item3);
final ProgressItem progressItem = new ProgressItem("Removing intruders", true);
items.add(progressItem);
final ItemAdapter adapter = new ItemAdapter(this, items);
setListAdapter(adapter);
mHandler.postDelayed(new Runnable() {
public void run() {
adapter.remove(item1);
adapter.remove(item2);
adapter.remove(item3);
adapter.remove(progressItem);
adapter.insert(new ThumbnailItem("Ultralight aviation", "List of French 'ULM' classes", R.drawable.ic_gdcatalog), 0);
adapter.notifyDataSetChanged();
}
}, 8000);
}
use of greendroid.widget.ItemAdapter in project GreenDroid by cyrilmottier.
the class TweakedItemViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ItemAdapter adapter = new SectionedItemAdapter(this, CHEESES, SECTIONS);
getListView().setFastScrollEnabled(true);
setListAdapter(adapter);
}
use of greendroid.widget.ItemAdapter in project GreenDroid by cyrilmottier.
the class CatalogActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ItemAdapter adapter = new ItemAdapter(this);
adapter.add(createTextItem(R.string.basic_item_label, BasicItemActivity.class));
adapter.add(createTextItem(R.string.xml_item_label, XmlItemActivity.class));
adapter.add(createTextItem(R.string.tweaked_item_view_label, TweakedItemViewActivity.class));
adapter.add(createTextItem(R.string.segmented_label, SegmentedActivity.class));
adapter.add(createTextItem(R.string.action_bar_activity_label, ActionBarActivity.class));
adapter.add(createTextItem(R.string.quick_action_label, QuickActionActivity.class));
adapter.add(createTextItem(R.string.simple_async_image_view_label, SimpleAsyncImageViewActivity.class));
adapter.add(createTextItem(R.string.async_image_view_list_view_label, AsyncImageViewListActivity.class));
adapter.add(createTextItem(R.string.map_pin_drawable_label, MapPinMapActivity.class));
adapter.add(createTextItem(R.string.paged_view_label, PagedViewActivity.class));
setListAdapter(adapter);
addActionBarItem(getActionBar().newActionBarItem(NormalActionBarItem.class).setDrawable(new ActionBarDrawable(this, R.drawable.ic_action_bar_info)), R.id.action_bar_view_info);
}
use of greendroid.widget.ItemAdapter in project GreenDroid by cyrilmottier.
the class XmlItemActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ItemAdapter adapter;
try {
adapter = ItemAdapter.createFromXml(this, R.xml.items);
setListAdapter(adapter);
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations