Exemplo n.º 1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            // Inflate the RecyclerItem View
            View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.drink_list_item, parent, false);

            // Create a ViewHolder to find and hold these view references, and
            // register OnClick with the view holder:
            DrinksViewHolder vh = new DrinksViewHolder(itemView, OnClick);

            return(vh);
        }
Exemplo n.º 2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            DrinksViewHolder vh = holder as DrinksViewHolder;

            // Set the TextViews in this ViewHolder's ListItem
            // from this position in the data:

            vh.drinkName.Text           = drinks[position].Model;
            vh.drinkTime.Text           = DateTime.Now.ToString("h:mm:ss tt");
            vh.drinkContent.Text        = drinks[position].Volume.ToString() + " fl. oz";
            vh.drinkAlcoholContent.Text = drinks[position].Percentage_consumed.ToString() + "%";
            vh.drinkName.SetOnTouchListener(new TouchListenerHelper(vh, startDragListener));
        }