コード例 #1
0
        public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View view = inflater.Inflate(Resource.Layout.fragment_personal_cart, container, false);

            presenter = new PersonalCartPresenter(new NavigationService(this.Activity.Application));
            presenter.SetView(this);
            //presenter.GetPreOrderList();


            addBtn  = view.FindViewById <ImageView>(Resource.Id.addBtn);
            bookBtn = view.FindViewById <Button>(Resource.Id.bookBtn);

            addBtn.Click  += delegate { AddService(); };
            bookBtn.Click += delegate { BookNow(); };

            recyclerView = view.FindViewById <RecyclerView>(Resource.Id.cartsList);
            preOrders    = new List <spa.Data.Model.PreOrder.PreOrder>();
            //services.Add(new Service("Foot Massage", 60));
            //services.Add(new Service("Facial Massage", 60));
            //services.Add(new Service("Body Massage", 60));
            //services.Add(new Service("Massage in long time", 30));
            //services.Add(new Service("Spa Bath", 30));
            //services.Add(new Service("Loose weight", 30));
            //services.Add(new Service("Mediation", 30));

            adapter = new PersonalCartAdapter(preOrders, presenter);
            LinearLayoutManager linearLayoutManager = new LinearLayoutManager(Context);

            recyclerView.SetAdapter(adapter);
            recyclerView.SetLayoutManager(linearLayoutManager);

            return(view);
        }
コード例 #2
0
 public void updateListService(int serviceID)
 {
     for (int i = 0; i < preOrders.Count; i++)
     {
         if (preOrders[i].serviceID == serviceID)
         {
             preOrders.Remove(preOrders[i]);
         }
     }
     adapter = new PersonalCartAdapter(preOrders, presenter);
     recyclerView.SetAdapter(adapter);
 }
コード例 #3
0
 public void updateListService(List <spa.Data.Model.PreOrder.PreOrder> preOrders)
 {
     this.preOrders = preOrders;
     adapter        = new PersonalCartAdapter(preOrders, presenter);
     recyclerView.SetAdapter(adapter);
 }