Back to project page RoboBinding-gallery.
The source code is released under:
Apache License
If you think the Android project RoboBinding-gallery 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 org.robobinding.gallery.model.typedcursor; /*from w w w. jav a 2 s .c o m*/ import java.text.MessageFormat; import org.robobinding.gallery.model.Product; import org.robobinding.itempresentationmodel.ItemContext; import org.robobinding.itempresentationmodel.ItemPresentationModel; /** * @author Cheng Wei * @version $Revision: 1.0 $ * @since 1.0 */ public class ProductItemPresentationModel implements ItemPresentationModel<Product> { private Product product; private int index; public String getProductDetails() { return MessageFormat.format("{0}.{1}: {2}", index + 1, product.getName(), product.getDescription()); } public void updateData(Product product, ItemContext itemContext) { this.index = itemContext.getPosition(); this.product = product; } }