public ShoppingDescription(ShoppingEntry value) {
            InitializeComponent();
            List<String> imageList = value.ImageList;
            myCarousel.ItemsSource = imageList;
            //indicator which image is showing
            myCarousel.PositionSelected += (sender, e) => {
                position.Text = (e.NewValue + 1) + "/" + imageList.Count();
            };
            description.Text = value.Description;
            direction.Text = value.Direction;
            phoneNumber.Text = value.PhoneNumber;
            phoneNumber.Clicked += (sender, e) => {
                Console.WriteLine("Pressed");
                var PhoneCallTask = CrossMessaging.Current.PhoneDialer;
                if (PhoneCallTask.CanMakePhoneCall)
                    PhoneCallTask.MakePhoneCall("+862368629315");

            };
            direction.Clicked += (sender, e) => {
                if (Device.RuntimePlatform == Device.Android)
                {
                    // opens the 'task chooser' so the user can pick Maps, Chrome or other mapping app
                    Device.OpenUri(new Uri("http://maps.google.com/?daddr=" + value.Address + "+&saddr=660+Parrington+Oval+,+Norman,+OK"));
                }
                else if (Device.RuntimePlatform == Device.iOS)
                {
                    //https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html
                    Device.OpenUri(new Uri("http://maps.apple.com/?daddr=" + value.Address + "+CA&saddr=660+Parrington+Oval+,+Norman,+OK"));

                }
            };

        }
示例#2
0
        public Shopping(ShoppingEntry value)
        {
            InitializeComponent();
            Image image = new Image
            {
                Source = value.MainImage
                         //I feel there needs more detail settings
            };

            image.Aspect = Xamarin.Forms.Aspect.Fill;
            this.contentViewforFirstImage.Content = image;
            this.restaurantName.Text = value.StoreName;
            this.address.Text        = value.Address;
            this.reviewScore.Text    = "" + (value.ReviewScore) + "/5.0";
            this.special.Text        = value.Special;
            this.distance.Text       = "" + value.Distance + " mi";
            this.averagePrice.Text   = "\u0024" + value.AveragePrice;

            TapGestureRecognizer tapGesture = new TapGestureRecognizer();

            tapGesture.Tapped += async(sender, args) => {
                await Navigation.PushAsync(new bigview.ShoppingDescription(value));
            };
            this.GestureRecognizers.Add(tapGesture);
        }
示例#3
0
        public Shopping(Model model)
        {
            InitializeComponent();


            for (int index = 0; index < model.ShoppingEntries.Count(); index++)
            {
                ShoppingEntry           temp  = model.ShoppingEntries[index];
                App1.smallview.Shopping temp1 = new smallview.Shopping(temp);
                innerOne.Children.Add(temp1);
            }

            searchBar.TextChanged += (sender, args) => {
                string               temp  = searchBar.Text;
                StackLayout          temp2 = new StackLayout();
                List <ShoppingEntry> temp1 = model.ShoppingEntries;
                for (int index = 0; index < temp1.Count; index++)
                {
                    if (temp1[index].contain(temp))
                    {
                        temp2.Children.Add(new smallview.Shopping(temp1[index]));
                    }
                }
                scrollview.Content = temp2;
            };
            searchBar.Focused += (sender, args) => {
            };
        }
示例#4
0
        public Shopping()
        {
            InitializeComponent();
            ShoppingEntry entry = new ShoppingEntry
            {
                MainImage   = "https://s3-media4.fl.yelpcdn.com/bphoto/OGcA8vvKqCyDY4IUMydjfA/o.jpg",
                StoreName   = "dfsafs",
                ReviewScore = 2.7,
                Special     = "haha",
                Address     = "nima",
                Distance    = 28
            };

            this.Content = new ContentView
            {
                Content = new StackLayout {
                    Children = { new smallview.Shopping(entry) }
                }
            };
        }
示例#5
0
        public Model()
        {
            FoodAndWineEntries = new List <FoodAndWineEntry>();
            AHs             = new List <AH>();
            shoppingEntries = new List <ShoppingEntry>();
            for (int index = 0; index < 16; index++)
            {
                FoodAndWineEntry temp = new FoodAndWineEntry
                {
                    RestaurantName = "Mr Sushi" + index,
                    ReviewScore    = 4.5,
                    Special        = "Sushi bars, seafood, Ramen",
                    Address        = "1204 n interstate Dr,Ste 130, Norman",
                    Distance       = index,
                    MainImage      = "https://s3-media4.fl.yelpcdn.com/bphoto/OGcA8vvKqCyDY4IUMydjfA/o.jpg",
                    AveragePrice   = 5.3 + index,
                    Description    = "But the real star is the food. Tables laden with delicacies line the walls. Everything you can think of, and things you have never dreamed of, lie in wait. Whole roasted cows and pigs and goats still turning on spits. Huge platters of fowl stuffed with savoury fruit and nuts. Ocean creatures drizzled in sauces or begging to be dipped in spicy concoctions. Countless cheeses, breads, vegetables, sweets, waterfalls of wine, and streams of spirits that flicker with flames." + index,
                    ImageList      = new List <string> {
                        "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=519346092,2976750614&fm=27&gp=0.jpg",
                        "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1523130641138&di=eb7711ba8645b454a315e1defb2b31b5&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fimgad%2Fpic%2Fitem%2Fd53f8794a4c27d1ebf4654ff10d5ad6eddc438ac.jpg",
                        "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1523130641661&di=2abd404c658770f46e30d11011e84006&imgtype=0&src=http%3A%2F%2Fimgsrc.baidu.com%2Fimage%2Fc0%253Dpixel_huitu%252C0%252C0%252C294%252C40%2Fsign%3D2806cf299cdda144ce0464f2dbcfb5ce%2F91ef76c6a7efce1bb9c7a3f0a451f3deb48f651f.jpg"
                    },
                    PhoneNumber = "405-625-" + (2780 + index),
                    Direction   = "DIRECTION"
                };

                AH ahtemp = new AH {
                    AttractionName = "chentiangou",
                    AHaddress      = "wangbadan",
                    AHimageList    = new List <string> {
                        "http://www.zfiengr.com/assets/images/OU_Devon_Energy_Hall.jpg"
                    },
                    AHdescription = "OU Devon Energy Hall and Rawl Engineering Practice Facility+/n" +
                                    "Norman, Oklahoma+/n" +
                                    "The Devon Energy Hall serves as instructional and research space for the College " +
                                    "of Engineering at the University of Oklahoma.  The facility has a five-story " +
                                    "conventionally-reinforced concrete pan joist and shear wall structural system.  " +
                                    "Special design features include a four-story atrium space and a grand stair supported" +
                                    " only at the floor levels. The Rawl Engineering Practice Facility consists of hands-on " +
                                    "laboratory and testing spaces for the College of Engineering.  The facility has a two-story" +
                                    " conventionally-reinforced concrete pan joist and moment frame structural system.  Highlights " +
                                    "of the design include a two-story-high practice bay area serviced by a three-ton crane and a " +
                                    "centrally located, three-story high, automated storage and retrieval system."
                };
                ShoppingEntry setrmp = new ShoppingEntry {
                    StoreName   = "Mr Sushi" + index,
                    ReviewScore = 4.5,
                    Special     = "Sushi bars, seafood, Ramen",
                    Address     = "1204 n interstate Dr,Ste 130, Norman",
                    ImageList   = new List <string> {
                        "http://www.zfiengr.com/assets/images/OU_Devon_Energy_Hall.jpg"
                    },
                    Description = "But the real star is the food. Tables laden with delicacies line the walls. Everything you can think of, and things you have never dreamed of, lie in wait. Whole roasted cows and pigs and goats still turning on spits. Huge platters of fowl stuffed with savoury fruit and nuts. Ocean creatures drizzled in sauces or begging to be dipped in spicy concoctions. Countless cheeses, breads, vegetables, sweets, waterfalls of wine, and streams of spirits that flicker with flames." + index,
                };



                foodAndWineEntries.Add(temp);
                ahs.Add(ahtemp);
                shoppingEntries.Add(setrmp);
            }
        }