Пример #1
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.misProductosCarritos);
            // Create your application here
            //toolbar
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetActionBar(toolbar);
            ActionBar.Title = "Carrito";
            btnComprar      = FindViewById <Button>(Resource.Id.btnComprar);

            mRecyclerView  = FindViewById <RecyclerView>(Resource.Id.recyclerViewCarrito);
            mLayoutManager = new LinearLayoutManager(this);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            var progressDialog = ProgressDialog.Show(this, "Espere un momento", "Obteniendo PRODUCTOS", true);


            //PRODUCTOS recycle
            partidasList = await obtenerPartidas();

            ProductList = await obtenerProductosPorPartidas();


            ProductosAdapter            = new ProductosAdapterPartida(ProductList, this, partidasList);
            ProductosAdapter.ItemClick += OnItemClick;

            mRecyclerView.SetAdapter(ProductosAdapter);
            progressDialog.Dismiss();
            btnComprar.Click += comprar;
        }
Пример #2
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.pedidoProductosLista);
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetActionBar(toolbar);
            ActionBar.Title = "Productos del Pedido";

            Bundle paquete = Intent.GetBundleExtra("bundle");

            idPedido       = paquete.GetString("idPedido");
            mRecyclerView  = FindViewById <RecyclerView>(Resource.Id.rvpedidoProducto);
            mLayoutManager = new LinearLayoutManager(this);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            var progressDialog = ProgressDialog.Show(this, "Espere un momento", "Obteniendo PRODUCTOS", true);


            //PRODUCTOS recycle
            partidasList = await obtenerPartidas();

            ProductList = await obtenerProductosPorPartidas();


            ProductosAdapter            = new ProductosAdapterPartida(ProductList, this, partidasList);
            ProductosAdapter.ItemClick += OnItemClick;

            mRecyclerView.SetAdapter(ProductosAdapter);
            progressDialog.Dismiss();
        }