Beispiel #1
0
        private void SellerDescriptionLinerLayout_Click(object sender, System.EventArgs e)
        {
            var newActivity = new Intent(this, typeof(SellerDescriptionActivity));

            ActivityCommunication.Seller = UserAPIController.GetSellerById(CatalogAPIController.GetSellerIdByProductId(this.product.Id).Result).Result;
            StartActivity(newActivity);
        }
Beispiel #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            this.product = ActivityCommunication.Product;
            SetContentView(Resource.Layout.ProductDescriptionActivity);

            this.ProductImageView = FindViewById <ImageView>(Resource.Id.ProductImageView);
            new Task(() => {
                var ulr = this.product.Image;
                if (ImageCache.Cache.ContainsKey(ulr))
                {
                    this.ProductImageView.SetImageBitmap(ImageCache.Cache[ulr]);
                }
                else
                {
                    var image = ImageDownload.GetImageBitmapFromUrl(ulr);
                    this.ProductImageView.SetImageBitmap(image);
                    ImageCache.Cache.Add(ulr, image);
                }
            }).Start();
            this.NameTextView          = FindViewById <TextView>(Resource.Id.ProductNameTextView);
            this.NameTextView.Text     = this.product.Name;
            this.BarndTextView         = FindViewById <TextView>(Resource.Id.ProductBrandTextView);
            this.BarndTextView.Text    = this.product.Brand;
            this.BarndVersionView      = FindViewById <TextView>(Resource.Id.ProductVersionTextView);
            this.BarndVersionView.Text = this.product.Version;
            this.BarndPriceView        = FindViewById <TextView>(Resource.Id.ProductPriceTextView);
            this.BarndPriceView.Text   = this.product.Price.ToString();
            this.BarndRAMView          = FindViewById <TextView>(Resource.Id.ProductRAMTextView);
            this.BarndRAMView.Text     = this.product.RAM.ToString();
            this.BarndYearView         = FindViewById <TextView>(Resource.Id.ProductYearTextView);
            this.BarndYearView.Text    = this.product.Year.ToString();

            this.Seller = UserAPIController.GetSellerById(CatalogAPIController.GetSellerIdByProductId(this.product.Id).Result).Result;

            this.SellerNameTextView           = FindViewById <TextView>(Resource.Id.SellerNameTextView);
            this.SellerNameTextView.Text      = this.Seller.Name;
            this.SellerAddressTextView        = FindViewById <TextView>(Resource.Id.SellerAddressTextView);
            this.SellerAddressTextView.Text   = this.Seller.Address;
            this.SellerCellPhoneTextView      = FindViewById <TextView>(Resource.Id.SellerCellPhoneTextView);
            this.SellerCellPhoneTextView.Text = this.Seller.CellPhone;

            this.AddToCartButton        = FindViewById <Button>(Resource.Id.AddToCartButton);
            this.AddToCartButton.Click += AddToCartButton_Click;

            this.BuyNowButton        = FindViewById <Button>(Resource.Id.BuyNowButton);
            this.BuyNowButton.Click += BuyNowButton_Click;

            FindViewById <LinearLayout>(Resource.Id.SellerDescriptionLinearLayout).Click += SellerDescriptionLinerLayout_Click;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.SellerDescriptionActivity);
            var seller = ActivityCommunication.Seller;

            FindViewById <TextView>(Resource.Id.SellerNameTextView).Text      = seller.Name;
            FindViewById <RatingBar>(Resource.Id.SellerRatingBar).Rating      = (float)seller.Rating;
            FindViewById <TextView>(Resource.Id.SellerAddressTextView).Text   = seller.Address;
            FindViewById <TextView>(Resource.Id.SellerCellPhoneTextView).Text = seller.CellPhone;
            FindViewById <TextView>(Resource.Id.SellerEmailTextView).Text     = seller.Email;
            var products = CatalogAPIController.GetProductsBySellerId(seller.Id);

            this.Adapter = new ProductsAdapter(this, products, Resource.Layout.ProductAdapterItem);
            var ProductsGridView = FindViewById <GridView>(Resource.Id.ProductListView);

            ProductsGridView.Adapter    = Adapter;
            ProductsGridView.ItemClick += ProductsGridView_ItemClick;
        }