示例#1
0
        protected override void OnBindData(RecyclerView.ViewHolder viewHolder, int position, HotReview.Reviews item)
        {
            var holder = viewHolder as EasyRVHolder;

            holder.setCircleImageUrl(Resource.Id.ivBookCover, Constant.IMG_BASE_URL + item.author.avatar, Resource.Drawable.avatar_default)
            .setText(Resource.Id.tvBookTitle, item.author.nickname)
            .setText(Resource.Id.tvBookType, Java.Lang.String.Format(mContext.GetString(Resource.String
                                                                                        .book_detail_user_lv), item.author.lv))
            .setText(Resource.Id.tvTitle, item.title)
            .setText(Resource.Id.tvContent, item.content)
            .setText(Resource.Id.tvHelpfulYes, item.helpful.yes.ToString());
            XLHRatingBar ratingBar = holder.getView <XLHRatingBar>(Resource.Id.rating);

            ratingBar.setCountSelected(item.rating);
            holder.Click += (sender, e) =>
            {
                itemClickListener.onItemClick(holder.getItemView(), position, item);
            };
        }
示例#2
0
            public override void setData(HotReview.Reviews item)
            {
                if (!Settings.IsNoneCover)
                {
                    holder.setCircleImageUrl(Resource.Id.ivBookCover, Constant.IMG_BASE_URL + item.author.avatar,
                                             Resource.Drawable.avatar_default);
                }
                else
                {
                    holder.setImageResource(Resource.Id.ivBookCover, Resource.Drawable.avatar_default);
                }

                holder.setText(Resource.Id.tvBookTitle, item.author.nickname)
                .setText(Resource.Id.tvBookType, Java.Lang.String.Format(mContext.GetString(Resource.String
                                                                                            .book_detail_user_lv), item.author.lv))
                .setText(Resource.Id.tvTime, FormatUtils.getDescriptionTimeFromDateString(item.created))
                .setText(Resource.Id.tvTitle, item.title)
                .setText(Resource.Id.tvContent, item.content)
                .setText(Resource.Id.tvHelpfulYes, item.helpful.yes.ToString());
                holder.setVisible(Resource.Id.tvTime, true);
                XLHRatingBar ratingBar = holder.getView <XLHRatingBar>(Resource.Id.rating);

                ratingBar.setCountSelected(item.rating);
            }