protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Demiactivity_main); mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView1); if (this.Intent.Extras != null) { var category = (DemiProductCategory)Intent.Extras.GetInt("CategoryID"); var group = (DemiProductGroup)Intent.Extras.GetInt("GroupID"); CategoryID = category; GroupID = group; } mProductList = new DemiProductList(CategoryID, GroupID); //---------------------------------------------------------------------------------------- // Layout Managing Set-up mLayoutManager = new GridLayoutManager(this, 2, GridLayoutManager.Vertical, false); mRecyclerView.SetLayoutManager(mLayoutManager); //---------------------------------------------------------------------------------------- // Adapter Set-up mAdapter = new DemiProductAdapter(mProductList); mAdapter.ItemClick += OnItemClick; mRecyclerView.SetAdapter(mAdapter); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Demiactivity_main); mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView1); if (this.Intent.Extras != null) { var category = (DemiProductCategory)Intent.Extras.GetInt("CategoryID"); CategoryID = category; var productlist = Intent.Extras.GetStringArray("lijst"); ListOfProducts = productlist.ToList(); } mProductList = new DemiProductList(CategoryID); button = FindViewById <Button>(Resource.Id.button1); //---------------------------------------------------------------------------------------- // Layout Managing Set-up mLayoutManager = new GridLayoutManager(this, 2, GridLayoutManager.Vertical, false); mRecyclerView.SetLayoutManager(mLayoutManager); //---------------------------------------------------------------------------------------- // Adapter Set-up mAdapter = new DemiProductGroupListAdapter(mProductList); mAdapter.ItemClick += OnItemClick; button.Click += Button_Click;; mRecyclerView.SetAdapter(mAdapter); }
public DemiProductList(DemiProductCategory CategoryID, DemiProductGroup GroupID) { mProducts = new List <Product>(); for (int i = 0; i < mConfirmedProducts.Length; i++) { if (mConfirmedProducts[i].group == GroupID) { mProducts.Add(mConfirmedProducts[i]); } } }
public Product(DemiProductCategory category = DemiProductCategory.Other, DemiProductGroup group = DemiProductGroup.Other, string name = "") { this.category = category; this.group = group; this.name = name; }