예제 #1
0
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            View itemView           = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.adapter_RadniNalog_row, parent, false);
            RadniNalogViewHolder vh = new RadniNalogViewHolder(itemView, OnClickItem, OnClickDelete);

            return(vh);
        }
예제 #2
0
        public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
        {
            RadniNalogViewHolder vh = holder as RadniNalogViewHolder;
            string nazivSkladista   = db.Query <T_SKL>(
                "SELECT * " +
                "FROM T_SKL " +
                "WHERE SKL_SIFRA = ?", mDID_RadniNalozi[position].PokretnoSkladiste).FirstOrDefault().SKL_NAZIV;

            if (mDID_RadniNalozi[position].Status == 5 && mDID_RadniNalozi[position].SinhronizacijaStatus == 2)
            {
                vh.ItemView.SetBackgroundResource(Resource.Color.greenDark);
                vh.Status.Text = "izvršeno";
            }
            else if (mDID_RadniNalozi[position].Status == 5)
            {
                vh.ItemView.SetBackgroundResource(Resource.Color.colorPrimary);
                vh.Status.Text = "izvršeno";
            }
            else if (mDID_RadniNalozi[position].Status == 4)
            {
                vh.ItemView.SetBackgroundColor(Android.Graphics.Color.Transparent);
                vh.Status.Text = "djelomično izvršeno";
            }
            else
            {
                vh.ItemView.SetBackgroundColor(Android.Graphics.Color.Transparent);
                vh.Status.Text = "neizvršeno";
            }

            vh.Broj.Text      = mDID_RadniNalozi[position].Broj.ToString();
            vh.Godina.Text    = mDID_RadniNalozi[position].Godina.ToString();
            vh.Skladiste.Text = nazivSkladista;
            vh.DatumOd.Text   = mDID_RadniNalozi[position].DatumOd.ToShortDateString();
            vh.DatumDo.Text   = mDID_RadniNalozi[position].DatumDo.ToShortDateString();
            vh.Broj.Text      = mDID_RadniNalozi[position].Broj.ToString();
        }