Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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]);
                }
            }
        }
Ejemplo n.º 3
0
 public Product(DemiProductCategory category = DemiProductCategory.Other, DemiProductGroup group = DemiProductGroup.Other, string name = "")
 {
     this.category = category;
     this.group    = group;
     this.name     = name;
 }