use of org.robobinding.gallery.model.Product in project RoboBinding-gallery by RoboBinding.
the class FragmentDemo method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int productIndex = getArguments().getInt(EXTRA_PRODUCT_INDEX);
Product product = MemoryProductStore.getInstance().getByIndex(productIndex);
presentationModel = new FragmentDemoPresentationModel(product);
}
use of org.robobinding.gallery.model.Product in project RoboBinding-gallery by RoboBinding.
the class DatabaseHelper method onCreate.
@Override
public void onCreate(SQLiteDatabase db) {
String itemTable = MessageFormat.format("create table {0} ({1} integer primary key autoincrement, {2} text not null, {3} text not null)", ProductTable.TABLE_NAME, ProductTable._ID, ProductTable.NAME, ProductTable.DESCRIPTION);
db.execSQL(itemTable);
List<Product> products = TestData.products();
for (Product product : products) {
insertProduct(db, product);
}
}
use of org.robobinding.gallery.model.Product in project RoboBinding-gallery by RoboBinding.
the class ContextMenuPresentationModel method deleteProduct.
public void deleteProduct(MenuItem menuItem) {
AdapterContextMenuInfo menuInfo = (AdapterContextMenuInfo) menuItem.getMenuInfo();
Product deletedProduct = productStore.remove(menuInfo.position);
productOperationListener.onProductDeleted(deletedProduct);
}
use of org.robobinding.gallery.model.Product in project RoboBinding-gallery by RoboBinding.
the class TypedCursorActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GetAllQuery<Product> allProductsQuery = new GetAllQuery<Product>(ProductTable.TABLE_NAME, new ProductRowMapper());
db = getDatabaseHelper().getReadableDatabase();
presentationModel = new TypedCursorPresentationModel(db, allProductsQuery);
initializeContentView(R.layout.activity_typed_cursor, presentationModel);
}
Aggregations