Exemple #1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.activity_daftar_gizi_list_item, parent, false);
            ListCariMakananViewHolder vh = new ListCariMakananViewHolder(itemView);

            return(vh);
        }
Exemple #2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            ListCariMakananViewHolder vh = holder as ListCariMakananViewHolder;

            vh.tvNamaMakanan.Text = makanan[position].nama;

            holder.ItemView.Click += (sender, e) =>
            {
                Intent intentHasilGizi = new Intent(holder.ItemView.Context, typeof(ActivityDaftarGiziHasil));
                intentHasilGizi.PutExtra("query", makanan[position].nama);
                holder.ItemView.Context.StartActivity(intentHasilGizi);
            };
        }