public FriendsPage()
        {
            InitializeComponent();
            Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);

            if (Device.RuntimePlatform == Device.iOS)
            {
                //MainStack.Margin = new Thickness(0,60,0,0);
                var safeInsets = On <Xamarin.Forms.PlatformConfiguration.iOS>().SafeAreaInsets();
                safeInsets.Left = 0;
                safeInsets.Top  = 40;
                this.Padding    = safeInsets;
            }
            else if (Device.RuntimePlatform == Device.Android)
            {
                searchBar.WidthRequest = 250;
            }

            listener = new SwipeListener(stlout_Swipe, this);

            if (Device.RuntimePlatform == Device.iOS)
            {
                searchBar.BackgroundColor = Color.White;
                searchBar.WidthRequest    = 250;
            }

            friends = Friend.friends;
            lv_FriendsList.ItemsSource = friends;
        }
예제 #2
0
        public OptionsPage()
        {
            NavigationPage.SetHasBackButton(this, false);
            InitializeComponent();
            listener = new SwipeListener(stlout_Swipe, this);

            List <string> itemsGeneral = new List <string>();

            itemsGeneral.Add("Meine Daten");

            List <string> itemsSystem = new List <string>();

            itemsSystem.Add("Impressum");
            itemsSystem.Add("Logout");

            ListViewGeneral.ItemsSource = itemsGeneral;
            ListViewSystem.ItemsSource  = itemsSystem;
        }
예제 #3
0
        public DashBoard()
        {
            Xamarin.Forms.NavigationPage.SetHasNavigationBar(this, false);
            InitializeComponent();

            if (Device.RuntimePlatform == Device.iOS)
            {
                var safeInsets = On <Xamarin.Forms.PlatformConfiguration.iOS>().SafeAreaInsets();
                safeInsets.Left = 0;
                safeInsets.Top  = 40;
                this.Padding    = safeInsets;
            }
            else if (Device.RuntimePlatform == Device.Android)
            {
                bestBierName.FontSize     = 14;
                friendRatingName.FontSize = 14;
                RatingLabel.FontSize      = 14;
                randomName1.FontSize      = 14;
                randomName2.FontSize      = 14;
            }

            listener  = new SwipeListener(stlout_Swipe, this);
            listener1 = new SwipeListener(frame1, this);
            listener2 = new SwipeListener(frame2, this);
            listener3 = new SwipeListener(frame3, this);
            listener4 = new SwipeListener(frame4, this);
            listener5 = new SwipeListener(frame5, this);
            listener6 = new SwipeListener(frame6, this);


            //SpecificUser.UserID = Convert.ToInt32(Xamarin.Forms.Application.Current.Properties["userID"]);
            //BestBier
            Beer bestBeer = allBeers[0];

            bestBierImg.Source  = bestBeer.pic;
            bestBierName.Text   = bestBeer.beerName;
            bestBierRating.Text = Convert.ToString(bestBeer.avgRating);


            //FriendRating
            List <FriendRating> friendRatings = BetterBeer.Objects.DashBoard.friendsRating;

            if (friendRatings.Count > 0)
            {
                FriendRating rating = friendRatings[0];
                int          bierId = rating.BierId;
                Beer         beer   = null;

                foreach (Beer beerdata in allBeers)
                {
                    if (Convert.ToInt32(beerdata.beerId) == bierId)
                    {
                        beer = beerdata;
                    }
                }
                friendRatingBeer.Source = beer.pic;

                Friend friend = BetterBeer.Objects.DashBoard.friend;
                LastFriendsRating     = friend;
                friendRatingName.Text = friend.Name + " hat " + beer.beerName + " bewertet.";
            }
            else
            {
                friendRatingName.Text = "Du hast keine Freunde :( ";
            }


            //Rating
            int userRatings = BetterBeer.Objects.DashBoard.count;

            RatingLabel.Text = "Du hast " + userRatings + " Biere bewertet.";


            //FriendRatings
            List <FriendRatingCount> friendRatingCount = BetterBeer.Objects.DashBoard.friendRatingCount;

            if (friendRatingCount.Count > 0)
            {
                List <Friend> friendsRatingList = BetterBeer.Objects.DashBoard.friendsRatingList;
                for (int i = 0; i < friendRatingCount.Count && i < 3; i++)
                {
                    Label label = new Label
                    {
                        Text = friendsRatingList[i].Name + ":\t " + friendRatingCount[i].RatingCount
                    };
                    RatingFriendCount.Children.Add(label);
                }
            }
            else
            {
                Label label = new Label
                {
                    Text = "Los füge schnell welche hinzu."
                };
                if (Device.RuntimePlatform == Device.Android)
                {
                    label.FontSize = 16;
                }
                RatingFriendCount.Children.Add(label);
            }


            //Random
            Random r      = new Random();
            int    number = r.Next(allBeers.Count);

            Beer randomBeer = allBeers[number];

            randomImg1.Source = randomBeer.pic;
            randomName1.Text  = randomBeer.beerName;


            //Newest
            Beer newestBeer = allBeers[0];

            foreach (Beer newBeer in allBeers)
            {
                if (Convert.ToInt32(newBeer.beerId) > Convert.ToInt32(newestBeer.beerId))
                {
                    newestBeer = newBeer;
                }
            }
            randomImg2.Source = newestBeer.pic;
            randomName2.Text  = newestBeer.beerName;
        }