예제 #1
0
        private void InflateMainData()
        {
            restaurant = JsonConvert.DeserializeObject <CompleteRestaurant>(
                Intent.GetStringExtra("mainInfo"));
            idRestaurant = restaurant.idrestaurant;

            ImageView main = FindViewById <ImageView>(Resource.Id.toolbarImage);

            main.SetImageBitmap(ImageHelper.GetImageBitmapFromUrl(restaurant.UrlMainFoto));


            TextView  restaurantName     = FindViewById <TextView>(Resource.Id.restaurantName);
            TextView  restaurantLocation = FindViewById <TextView>(Resource.Id.restaurantLocation);
            TextView  restaurantCuisine  = FindViewById <TextView>(Resource.Id.restaurantCuisine);
            RatingBar ratingBar          = FindViewById <RatingBar>(Resource.Id.restaurantRating);

            restaurantName.Text     = restaurant.name;
            restaurantLocation.Text = restaurant.address;
            restaurantCuisine.Text  = restaurant.idcategoriesNavigation.category;
            ratingBar.Rating        = restaurant.score;

            Button   call               = FindViewById <Button>(Resource.Id.buttonCall);
            TextView informationPrice   = FindViewById <TextView>(Resource.Id.informationPrice);
            TextView informationView    = FindViewById <TextView>(Resource.Id.informationFood);
            TextView informationPayment = FindViewById <TextView>(Resource.Id.informationPayment);
            TextView informationDress   = FindViewById <TextView>(Resource.Id.informationDress);
            TextView description        = FindViewById <TextView>(Resource.Id.informationComment);

            call.Text               = restaurant.phone;
            informationPrice.Text   = $"${restaurant.price} MXN o más";
            informationView.Text    = restaurant.idcategoriesNavigation.category;
            informationPayment.Text = restaurant.idpaymentNavigation.paymentOption;
            informationDress.Text   = restaurant.dress;
            description.Text        = restaurant.description;

            TextView schedule = FindViewById <TextView>(Resource.Id.informationHour);

            schedule.Text = API.GetSchedule(idRestaurant);

            InitToolbar(restaurant.name);

            bars    = API.GetBars(idRestaurant);
            ratings = API.GetRatings(idRestaurant);
            TextView    generalRating = FindViewById <TextView>(Resource.Id.generalRating);
            RatingBar   rating        = FindViewById <RatingBar>(Resource.Id.restaurantRatingSmall);
            ProgressBar pbar1         = FindViewById <ProgressBar>(Resource.Id.pbar1);
            ProgressBar pbar2         = FindViewById <ProgressBar>(Resource.Id.pbar2);
            ProgressBar pbar3         = FindViewById <ProgressBar>(Resource.Id.pbar3);
            ProgressBar pbar4         = FindViewById <ProgressBar>(Resource.Id.pbar4);
            ProgressBar pbar5         = FindViewById <ProgressBar>(Resource.Id.pbar5);

            rating.Rating      = ratings[3];
            generalRating.Text = ratings[3].ToString();
            pbar1.Progress     = bars[0];
            pbar2.Progress     = bars[1];
            pbar3.Progress     = bars[2];
            pbar4.Progress     = bars[3];
            pbar5.Progress     = bars[4];
        }