Пример #1
0
        // Create new views (invoked by the layout manager)
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            //Setup your layout here
            View itemView = null;
            var  id       = Resource.Layout.PlaybackListItem;

            itemView = LayoutInflater.From(parent.Context).Inflate(id, parent, false);

            var vh = new PlaybackListAdapterViewHolder(itemView, OnClick, OnLongClick);

            return(vh);
        }
Пример #2
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            //var item = items[position];

            // Replace the contents of the view with that element
            PlaybackListAdapterViewHolder holder = viewHolder as PlaybackListAdapterViewHolder;

            //holder.TextView.Text = items[position];
            if (position == 0)
            {
                holder.CameraName.SetBackgroundResource(Resource.Drawable.button_round_fill_gray);
                holder.DateTime.SetBackgroundResource(Resource.Drawable.button_round_fill_gray);
                holder.Duration.SetBackgroundResource(Resource.Drawable.button_round_fill_gray);
                holder.View.SetBackgroundResource(Resource.Drawable.button_round_fill_gray);
            }
            else
            {
                holder.CameraName.Text = "Driver";
                holder.DateTime.Text   = "03/27/2016 06:27:00 PM";
                holder.Duration.Text   = "00:02:00";
                holder.View.Text       = "View";
            }
        }