示例#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_appointment, container, false);

            presenter = new AppointmentPresenter(new NavigationService(Activity.Application));
            presenter.GetAllAppointmentHistory();

            recyclerView = view.FindViewById <RecyclerView>(Resource.Id.AppointmentList);

            string mDate = "2020/03/17";
            string mOutDate;

            FormatDateString(mDate, out mOutDate);
            appointmentsList = new List <Appointment>();
            appointmentsList.Add(new Appointment(mOutDate, ChangeIntToStringComma(15000000)));
            appointmentsList.Add(new Appointment(mOutDate, ChangeIntToStringComma(15000000)));
            appointmentsList.Add(new Appointment(mOutDate, ChangeIntToStringComma(15000000)));

            LinearLayoutManager linearLayoutManager = new LinearLayoutManager(Context);

            adapter = new AppointmentHistoryAdapter(appointmentsList, Context, presenter);
            recyclerView.SetAdapter(adapter);
            recyclerView.SetLayoutManager(linearLayoutManager);

            return(view);
        }
            public Myview(View _itemView, AppointmentPresenter presenter) : base(_itemView)
            {
                date   = _itemView.FindViewById <TextView>(Resource.Id.txtDate);
                total  = _itemView.FindViewById <TextView>(Resource.Id.txtTotal);
                detail = _itemView.FindViewById <ImageView>(Resource.Id.btnDetail);

                this.presenter = presenter;
                detail.Click  += delegate { DetailButtonClick(_itemView); };
            }
 public AppointmentHistoryAdapter(List <Appointment> list, Context con, AppointmentPresenter presenter)
 {
     mList          = list;
     mContext       = con;
     this.presenter = presenter;
 }