Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if (Intent.HasExtra("Storeid"))
            {
                int storeID = Intent.GetIntExtra("Storeid", 0);        //To Get Items Of a Specific Store
                itemsList = new ItemsList(storeID);
            }
            else
            {
                itemsList = new ItemsList(0);                         //To Get All Items
            }

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_items);
            myCart = (LinearLayout)FindViewById(Resource.Id.cartInItems);

            if (MainActivity.CartItems.numitems != 0 || MainActivity.CartOffers.numoffers != 0)
            {
                myCart.Visibility = ViewStates.Visible;
                myCart.Click     += MyCart_Click;
            }


            mRecycleView   = FindViewById <RecyclerView>(Resource.Id.itemsRecyclerView);
            mLayoutManager = new LinearLayoutManager(this);
            mRecycleView.SetLayoutManager(mLayoutManager);
            mAdapter            = new ItemsListAdapter(itemsList);
            mAdapter.ItemClick += MAdapter_ItemClick;
            mRecycleView.SetAdapter(mAdapter);
        }
Exemplo n.º 2
0
 public static FilterHelper newInstance(JavaList <String> currentList, ItemsListAdapter adapter)
 {
     FilterHelper.adapter     = adapter;
     FilterHelper.currentList = currentList;
     return(new FilterHelper());
 }