示例#1
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            NewsAdapterWrapper Myholder = holder as NewsAdapterWrapper;

            Myholder.Titulo.Text    = mPublicaciones [position].Titulo;
            Myholder.Subtitulo.Text = mPublicaciones [position].Subtitulo;
            Myholder.Fecha.Text     = mPublicaciones [position].FechaPublicacion.ToString();
            Koush.UrlImageViewHelper.SetUrlDrawable(Myholder.Imagen, mPublicaciones [position].Imagen.ToString());
            Myholder.Detalle.Visibility = ViewStates.Gone;
            Myholder.Imagen.Click      += (object sender, EventArgs e) =>
            {
                Intent IntentNews = new Intent(this.mContext, typeof(NewsDetailActivity));
                IntentNews.PutExtra("TituloDetalle", mPublicaciones [position].Titulo);
                IntentNews.PutExtra("SubtituloDetalle", mPublicaciones [position].Subtitulo);
                IntentNews.PutExtra("FechaDetalle", mPublicaciones [position].FechaPublicacion.ToString());
                IntentNews.PutExtra("ContenidoDetalle", mPublicaciones [position].Contenido.Trim());
                IntentNews.PutExtra("ImagenDetalle", mPublicaciones [position].Imagen.ToString());

                this.mContext.StartActivity(IntentNews);
            };
//			Myholder.Detalle.Click += (object sender, EventArgs e) =>
//			{
//				Intent IntentNews = new Intent(this.mContext,typeof(NewsDetailActivity));
//				IntentNews.PutExtra ("TituloDetalle", mPublicaciones [position].Titulo);
//				IntentNews.PutExtra ("SubtituloDetalle", mPublicaciones [position].Subtitulo);
//				IntentNews.PutExtra ("FechaDetalle", mPublicaciones [position].FechaPublicacion.ToString ());
//				IntentNews.PutExtra ("ContenidoDetalle", mPublicaciones [position].Contenido.Trim ());
//				IntentNews.PutExtra ("ImagenDetalle", mPublicaciones [position].Imagen.ToString ());
//				this.mContext.StartActivity (IntentNews);
//			};
        }
示例#2
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(Android.Views.ViewGroup parent, int viewType)
        {
            View row = LayoutInflater.From(mContext).Inflate(Resource.Layout.layout_group, parent, false);

            TextView  txtTitulo    = row.FindViewById <TextView> (Resource.Id.txtTitulo);
            TextView  txtSubtitulo = row.FindViewById <TextView> (Resource.Id.txtSubtitulo);
            TextView  txtFecha     = row.FindViewById <TextView> (Resource.Id.txtFechaContenido);
            ImageView image        = row.FindViewById <ImageView> (Resource.Id.img_portada);
            Button    btnDetalle   = row.FindViewById <Button> (Resource.Id.btnDetalle);

            NewsAdapterWrapper view = new NewsAdapterWrapper(row)
            {
                Titulo    = txtTitulo,
                Subtitulo = txtSubtitulo,
                Fecha     = txtFecha,
                Imagen    = image,
                Detalle   = btnDetalle
            };

            return(view);
        }
		public override RecyclerView.ViewHolder OnCreateViewHolder (Android.Views.ViewGroup parent, int viewType)
		{
			View row = LayoutInflater.From (mContext).Inflate (Resource.Layout.layout_group,parent,false);

			TextView txtTitulo = row.FindViewById<TextView> (Resource.Id.txtTitulo);
			TextView txtSubtitulo = row.FindViewById<TextView> (Resource.Id.txtSubtitulo);
			TextView txtFecha = row.FindViewById<TextView> (Resource.Id.txtFechaContenido);
			ImageView image = row.FindViewById<ImageView> (Resource.Id.img_portada);
			Button btnDetalle = row.FindViewById<Button> (Resource.Id.btnDetalle);

			NewsAdapterWrapper view = new NewsAdapterWrapper (row) {
				Titulo = txtTitulo,
				Subtitulo = txtSubtitulo,
				Fecha = txtFecha,
				Imagen = image,
				Detalle = btnDetalle
			};

			return view;

		}