示例#1
0
        public static List <RestoCategoty> GetListByServerResponse(string response)
        {
            if (response == "")
            {
                return(null);
            }
            List <RestoCategoty> members = new List <RestoCategoty>();

            string[] lines = response.Split(new string[] { "<BR>" }, StringSplitOptions.None);
            foreach (string line in lines)
            {
                if (line.Trim() == "")
                {
                    continue;
                }
                string[]      datas = line.Split(';');
                RestoCategoty m     = new RestoCategoty();
                m.restocategory_id   = Convert.ToInt32(datas[0].Trim());
                m.restocategory_code = datas[1];
                m.restocategory_name = datas[2];
                m.restocategory_note = datas[3];
                members.Add(m);
            }
            return(members);
        }
示例#2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            if (position < 0)
            {
                return(null);
            }
            View view = (convertView ?? m_Context.LayoutInflater.Inflate(Resource.Layout.item_restoCat_imgView, parent, false));

            if (view == null)
            {
                return(null);
            }
            RestoByCategoryAdapterWrapper wrapper = view.Tag as RestoByCategoryAdapterWrapper;

            if (wrapper == null)
            {
                wrapper = new RestoByCategoryAdapterWrapper
                {
                    CatName = view.FindViewById <TextView>(Resource.Id.item_title),
                    //RestoImageView = view.FindViewById<ImageView>(Resource.Id.item_image),
                    //RestoAddress = view.FindViewById<TextView>(Resource.Id.item_address),
                    //RestoBackGround = view.FindViewById<LinearLayout>(Resource.Id.item_background),
                    RestoBackGroundIV = view.FindViewById <ImageView>(Resource.Id.imageViewBackGround)
                };
                view.Tag = wrapper;
            }
            RestoCategoty resto = this.m_restos.ElementAt(position);

            wrapper.CatName.Text = resto.restocategory_name;
            // wrapper.RestoAddress.Text = resto.resto_address;
            //wrapper.RestoName.Alpha = 100;
            //wrapper.RestoAddress.Alpha = 100;

            //  System.IO.InputStream URLcontent = (System.IO.InputStream)new URL(resto.resto_url_image).GetContent();
            //  Drawable image = Drawable.CreateFromStream(URLcontent, "your source link");
            // wrapper.Art.SetImageDrawable(image);

            //wrapper.Art.SetImageBitmap(Android.Graphics.Bitmap.CreateBitmap())
            //LinearLayout ly;ly.SetBackgroundDrawable

            //ImageLoader.DisplayImage(resto.resto_url_image, wrapper.RestoImageView, -1);
            //ImageLoader.DisplayImageLinearLayOut(resto.resto_url_image, wrapper.RestoBackGround, -1);
            ImageLoader.DisplayImage(resto.restocategory_note, wrapper.RestoBackGroundIV, -1);
            return(view);
        }