Ejemplo n.º 1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View view = convertView;

            // re-use an existing view, if one is available
            // otherwise create a new one
            if (view == null)
            {
                view = context.LayoutInflater.Inflate(_viewID, parent, false);
            }

            T item = Filterlist[position];

            if (item != null)
            {
                _dlg.Invoke(view, item);
            }

            PropertyInfo picode = item.GetType().GetProperty("icode");

            if (picode != null)
            {
                object tmp = picode.GetValue(item);
                if (tmp != null)
                {
                    if (tmp.ToString() == "TAX" || tmp.ToString() == "AMOUNT")
                    {
                        view.SetBackgroundColor(Color.WhiteSmoke);
                        SetChildFontColor(view, Color.DarkBlue);
                    }
                    else
                    {
                        SetRecordColor(view, position);
                    }
                }
                else
                {
                    SetRecordColor(view, position);
                }
            }
            else
            {
                SetRecordColor(view, position);
            }


            return(view);
        }
Ejemplo n.º 2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View view = convertView;

            // re-use an existing view, if one is available
            // otherwise create a new one
            if (view == null)
            {
                view = context.LayoutInflater.Inflate(_viewID, parent, false);
            }

            T item = Filterlist[position];

            if (item != null)
            {
                _dlg.Invoke(view, item);
            }


            InvoiceDtls itmcode = item as InvoiceDtls;

            if (itmcode.icode == "TAX" || itmcode.icode == "AMOUNT")
            {
                view.SetBackgroundColor(Color.WhiteSmoke);
                SetChildFontColor(view, Color.DarkBlue);
            }
            else
            {
                if (position % 2 == 1)
                {
                    view.SetBackgroundResource(Resource.Drawable.listview_selector_even);
                    SetChildFontColor(view, Color.White);
                }
                else
                {
                    view.SetBackgroundResource(Resource.Drawable.listview_selector_odd);
                    SetChildFontColor(view, Color.Black);
                }
            }
            return(view);
        }