Ejemplo n.º 1
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            AddressViewHolder recyclerViewHolder = holder as AddressViewHolder;

            recyclerViewHolder._tvAddress.Text = recyclerViewHolder._tvName.Text = recyclerViewHolder._tvPhone.Text = " ";
            if (_lstDiaChi[position].MacDinh == true)
            {
                recyclerViewHolder._tvAddress.Text = "Chưa có địa chỉ mặc định!";
                if (!String.IsNullOrEmpty(_lstDiaChi[position].HoTen))
                {
                    recyclerViewHolder._tvName.Text = _lstDiaChi[position].HoTen + " (Mặc định)";
                }
            }
            else
            {
                if (!String.IsNullOrEmpty(_lstDiaChi[position].HoTen))
                {
                    recyclerViewHolder._tvName.Text = _lstDiaChi[position].HoTen;
                }
            }

            if (!String.IsNullOrEmpty(_lstDiaChi[position].SoNha) &&
                !String.IsNullOrEmpty(_lstDiaChi[position].TinhThanh) &&
                !String.IsNullOrEmpty(_lstDiaChi[position].QuanHuyen) &&
                !String.IsNullOrEmpty(_lstDiaChi[position].PhuongXa))
            {
                recyclerViewHolder._tvAddress.Text = "Địa chỉ: " + _lstDiaChi[position].SoNha + " " + _lstDiaChi[position].PhuongXa + " " + _lstDiaChi[position].QuanHuyen + " " + _lstDiaChi[position].TinhThanh;
            }
            if (!String.IsNullOrEmpty(_lstDiaChi[position].SoDT))
            {
                recyclerViewHolder._tvPhone.Text = "Địện thoại: " + _lstDiaChi[position].SoDT;
            }
        }
Ejemplo n.º 2
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            LayoutInflater inflater = LayoutInflater.From(parent.Context);
            View           _recyRow = inflater.Inflate(Resource.Layout.Item_Bill_Confirm_Change_Address, parent, false);

            AddressViewHolder row = new AddressViewHolder(_recyRow, ClickChoose, ClickEdit, ClickDelete);

            if (viewType == 1)
            {
                row._tvName.SetTextColor(Android.Graphics.Color.ParseColor("#fe8802"));
                row._lnContent.SetBackgroundResource(Resource.Drawable.layout_home_recyclerview_item_shape_3);
            }
            return(row);
        }