Esempio n. 1
0
        public void SetValues(View row)
        {
            //TODO:  Need suppport for tagging to reuse these views.
            TextView  labelTV   = (TextView)row.FindViewById(Resource.Id.drawing_element_textview);
            ImageView drawingIV = (ImageView)row.FindViewById(Resource.Id.drawing_element_imageview);


            labelTV.SetText(fieldLabel, TextView.BufferType.Normal);

            /* TODO: should only be loaded when it is changed */
            drawingBitmap = ImageUtility.LoadImage(this.drawingLocation);

            if (drawingBitmap != null)
            {
                drawingIV.SetImageBitmap(drawingBitmap);
            }
            else
            {
                drawingIV.SetImageBitmap(backgroundBitmap);
            }

            /* C# doesn't support tagging
             * ViewHolder vh = (ViewHolder) row.GetTag();
             * vh.labelTV.SetText(fieldLabel, TextView.BufferType.Normal);
             * drawingBitmap = ImageUtility.LoadImage(this.drawingLocation);
             *
             * if (drawingBitmap != null)
             * {
             *  vh.drawingIV.SetImageBitmap(drawingBitmap);
             *  drawingBitmap.Recycle();
             *  drawingBitmap = null;
             *
             * }
             * else
             * {
             *  vh.drawingIV.SetImageBitmap(backgroundBitmap);
             * }
             */
        }