Ejemplo n.º 1
0
        public override Android.Support.V7.Widget.RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            CardView cv = (CardView)LayoutInflater.From(parent.Context).Inflate(Resource.Layout.card_task_in_list, parent, false);

            ViewHolder viewHolder = new ViewHolder(cv, OnClick);

            return(viewHolder);
        }
Ejemplo n.º 2
0
        public override void OnBindViewHolder(Android.Support.V7.Widget.RecyclerView.ViewHolder holder, int position)
        {
            ViewHolder viewHolder = holder as ViewHolder;
            CardView   cardView   = viewHolder.CardView;

            TextView roomTitleTextView = cardView.FindViewById <TextView>(Resource.Id.room_title_text_view);

            roomTitleTextView.Text = roomTitles[position];

            ImageView timeImageView = cardView.FindViewById <ImageView>(Resource.Id.time_image_view);

            timeImageView.SetImageResource(Resource.Drawable.stopwatch);
            timeImageView.ContentDescription = timeOfRoomCleaning[position];

            TextView timeTextView = cardView.FindViewById <TextView>(Resource.Id.time_text_view);

            timeTextView.Text = timeOfRoomCleaning[position];
        }
        public override void OnBindViewHolder(Android.Support.V7.Widget.RecyclerView.ViewHolder holder, int position)
        {
            ViewHolder viewHolder = holder as ViewHolder;

            CardView  cardView  = viewHolder.CardView;
            ImageView imageView = cardView.FindViewById <ImageView>(Resource.Id.info_image);
            Drawable  drawable  = cardView.Resources.GetDrawable(imageIds[position]);

            imageView.SetImageDrawable(drawable);
            imageView.ContentDescription = captions[position];
            TextView mainTextView = cardView.FindViewById <TextView>(Resource.Id.main_text);

            mainTextView.Text = captions[position];
            TextView infoTextView = cardView.FindViewById <TextView>(Resource.Id.info_text);

            infoTextView.Text = descriptions[position];
            infoTextView.SetTextColor(new Android.Graphics.Color(189, 189, 189));
        }
        public override void OnBindViewHolder(Android.Support.V7.Widget.RecyclerView.ViewHolder holder, int position)
        {
            ViewHolder viewHolder = holder as ViewHolder;

            CardView  cardView      = viewHolder.CardView;
            ImageView mainImageView = cardView.FindViewById <ImageView>(Resource.Id.info_image);
            Drawable  drawable      = cardView.Resources.GetDrawable(imageIds[position]);

            mainImageView.SetImageDrawable(drawable);
            mainImageView.ContentDescription = captions[position];
            TextView titleTextView = cardView.FindViewById <TextView>(Resource.Id.room_title_textview);

            titleTextView.Text = captions[position];


            //ImageView iconImage = cardView.FindViewById<ImageView>(Resource.Id.info_icon);
            //iconImage.SetImageResource(Resource.Drawable.ic_edit);
            //iconImage.ContentDescription = captions[position];
            //iconImage.RequestLayout();
            //iconImage.LayoutParameters.Height = Convert.ToInt16(titleTextView.TextSize);
            //iconImage.SetColorFilter(new Android.Graphics.Color(context.GetColor(Resource.Color.colorAction)));

            TextView actionTextView1 = cardView.FindViewById <TextView>(Resource.Id.action1_textview);

            actionTextView1.Text   = actionText[0];
            actionTextView1.Click += Action1_Click;

            TextView actionTextView2 = cardView.FindViewById <TextView>(Resource.Id.action2_textview);

            actionTextView2.Text   = actionText[1];
            actionTextView2.Click += Action2_Click;

            View view = cardView.FindViewById <View>(Resource.Id.line_view);

            view.SetBackgroundColor(new Android.Graphics.Color(224, 224, 224));

            TextView infoTextView = cardView.FindViewById <TextView>(Resource.Id.info_text);

            infoTextView.Text = context.GetString(Resource.String.info_text_for_room_title);
            infoTextView.SetTextColor(new Android.Graphics.Color(189, 189, 189));
        }