コード例 #1
0
ファイル: LeaderboardCell.cs プロジェクト: PhotoIImprov/iiApp
        public void OnImgTapped(object sender, EventArgs args)
        {
            if (((iiBitmapView)sender) != null)
            {
                MasterPage      m1 = ((MasterPage)Application.Current.MainPage);
                MainPageSwipeUI mp = m1.thePages;
                m1.zoomPage.ActiveMetaBallot = new BallotCandidateJSON(); // nada for now.

                iiBitmapView taggedImg = new iiBitmapView {
                    Bitmap    = ((iiBitmapView)sender).Bitmap.Copy(),
                    PhotoMeta = ((iiBitmapView)sender).PhotoMeta,
                };
                m1.zoomPage.MainImage = taggedImg;
                m1.zoomPage.pid       = taggedImg.PhotoMeta.pid;
                m1.zoomPage.buildZoomView();
                //mp.zoomPage.PreviousContent = mp.thePages.leaderboardPage;
                //m1.zoomPage.PreviousContent = mp.leaderboardPage;
                Device.BeginInvokeOnMainThread(() => {
                    //mp.thePages.leaderboardPage.Content = mp.zoomPage.Content;
                    //mp.leaderboardPage.Content = m1.zoomPage.Content;
                    //mp.leaderboardPage.Content = m1.zoomPage;
                    m1.gotoZoomPage();
                });
            }
        }
コード例 #2
0
        public CameraClosedCategorySelectionCell()
        {
            if (cameraImage == null)
            {
                cameraImage = GlobalSingletonHelpers.loadSKBitmapFromResourceName(CAMERA_IMAGE_NAME, this.GetType().GetTypeInfo().Assembly);
            }
            rowSplitter = new Grid {
                ColumnSpacing = 0, RowSpacing = 0, Margin = 1,
            };
            for (int i = 0; i < 10; i++)
            {
                rowSplitter.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(1, GridUnitType.Star)
                });
            }

            categoryName.SetBinding(Label.TextProperty, "categoryName");
            categoryName.MinimumHeightRequest = 32;
            rowSplitter.Children.Add(categoryName, 0, 0);
            Grid.SetColumnSpan(categoryName, 10);

            cameraButton = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName(CAMERA_IMAGE_NAME, this.GetType().GetTypeInfo().Assembly))
            {
                HorizontalOptions = LayoutOptions.End,
                VerticalOptions   = LayoutOptions.Center,
                Margin            = 3,
            };
            rowSplitter.Children.Add(cameraButton, 9, 0);  // col, row
            rowSplitter.HeightRequest = 32;
            this.View = rowSplitter;
        }
コード例 #3
0
        protected void buildRankImages()
        {
            voteBoxes = new List <iiBitmapView>();
            for (int i = 0; i < 4; i++)
            {
                iiBitmapView vBox = new iiBitmapView {
                    Bitmap              = GlobalSingletonHelpers.loadSKBitmapFromResourceName(JudgingContentPage.VOTE_BOX_FILENAME, assembly),
                    HorizontalOptions   = LayoutOptions.FillAndExpand,
                    VerticalOptions     = LayoutOptions.FillAndExpand,
                    MinimumWidthRequest = 60,
                    Margin              = 2,
                };
                voteBoxes.Add(vBox);
            }

            rankImages = new List <iiBitmapView>();
            foreach (string filename in JudgingContentPage.rankFilenames)
            {
                iiBitmapView img = new iiBitmapView {
                    Bitmap              = GlobalSingletonHelpers.loadSKBitmapFromResourceName(filename, assembly),
                    HorizontalOptions   = LayoutOptions.FillAndExpand,
                    VerticalOptions     = LayoutOptions.FillAndExpand,
                    MinimumWidthRequest = 60,
                    Margin              = 2,
                };
                //img.GestureRecognizers.Add(tap);
                rankImages.Add(img);
            }
        }
コード例 #4
0
        public SubmissionsImageRowViewCell()
        {
            //View.MinimumHeightRequest = 120;
            Height = 120;
            if (Device.Idiom == TargetIdiom.Tablet)
            {
                Height = 270;
            }
            //this.ForceUpdateSize();
            myView = new Grid {
                ColumnSpacing = 1, RowSpacing = 1,
            };
            myView.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(2, GridUnitType.Star)
            });
            myView.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            myView.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            myView.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            img0 = new iiBitmapView()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand, MinimumHeightRequest = 120,
            };
            img1 = new iiBitmapView()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand, MinimumHeightRequest = 120,
            };
            img2 = new iiBitmapView()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand, MinimumHeightRequest = 120,
            };

            img0.SetBinding(iiBitmapView.BitmapProperty, "bitmap0");
            img1.SetBinding(iiBitmapView.BitmapProperty, "bitmap1");
            img2.SetBinding(iiBitmapView.BitmapProperty, "bitmap2");

            img0.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp0Meta");
            img1.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp1Meta");
            img2.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp2Meta");

            TapGestureRecognizer imgTapped = new TapGestureRecognizer();

            imgTapped.Tapped += OnImgTapped;
            img0.GestureRecognizers.Add(imgTapped);
            img1.GestureRecognizers.Add(imgTapped);
            img2.GestureRecognizers.Add(imgTapped);

            myView.Children.Add(img0, 0, 0);
            myView.Children.Add(img1, 1, 0);
            myView.Children.Add(img2, 2, 0);
            myView.MinimumHeightRequest = Height;
            this.View = myView;
        }
コード例 #5
0
        public UpperProfileSection()
        {
            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            lightbulbs = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.ImageMetaIcons.reward.png", assembly));
            mostBulbsInOneDay.SizeChanged += fixFontSizes;
            buildUI();
        }
コード例 #6
0
        public ProfileNavRow(IProvideProfileNavigation parent)
        {
            this.parent = parent;

            RowSpacing      = 0;
            ColumnSpacing   = 0;
            BackgroundColor = GlobalStatusSingleton.backgroundColor;

            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            mySubmissionsOff           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.play_inactive.png", assembly));
            mySubmissionsOn            = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.play.png", assembly));
            mySubmissionsOff.IsVisible = false;  // default to my entries page.

            myLikesOff          = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.ImageMetaIcons.unliked.png", assembly));
            myLikesOn           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.ImageMetaIcons.liked.png", assembly));
            myLikesOn.IsVisible = false;

            myEventsOff          = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.events_inactive.png", assembly));
            myEventsOn           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.events.png", assembly));
            myEventsOn.IsVisible = false;

            myBadgesOff          = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.contests_inactive.png", assembly));
            myBadgesOn           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.contest.png", assembly));
            myBadgesOn.IsVisible = false;

            hideButton           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.upCaret.png", assembly));
            showButton           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.downCaret.png", assembly));
            showButton.IsVisible = false;  // default to showing profile

            TapGestureRecognizer tapGesture = new TapGestureRecognizer();

            tapGesture.Tapped += OnClicked;
            mySubmissionsOff.GestureRecognizers.Add(tapGesture);
            myLikesOff.GestureRecognizers.Add(tapGesture);
            myEventsOff.GestureRecognizers.Add(tapGesture);
            myBadgesOff.GestureRecognizers.Add(tapGesture);
            showButton.GestureRecognizers.Add(tapGesture);
            hideButton.GestureRecognizers.Add(tapGesture);

            // on buttons behave differently...
            TapGestureRecognizer tapGestureOn = new TapGestureRecognizer();

            tapGestureOn.Tapped += OnClickedWhenOn;
            mySubmissionsOn.GestureRecognizers.Add(tapGestureOn);
            myLikesOn.GestureRecognizers.Add(tapGestureOn);
            myEventsOn.GestureRecognizers.Add(tapGestureOn);
            myBadgesOn.GestureRecognizers.Add(tapGestureOn);

            horizLine = new BoxView {
                HeightRequest = 1.0, BackgroundColor = GlobalStatusSingleton.highlightColor, HorizontalOptions = LayoutOptions.FillAndExpand,
            };
            horizLine2 = new BoxView {
                HeightRequest = 1.0, BackgroundColor = GlobalStatusSingleton.highlightColor, HorizontalOptions = LayoutOptions.FillAndExpand,
            };
            buildUI();
            NavHighlightIndex = 0;
        }
コード例 #7
0
        public void SetBadgesData(BadgesResponseJSON badges)
        {
            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            if (badges.firstphoto == true)
            {
                upload1 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.uploadMedal_01.png", assembly));
            }
            else
            {
                upload1 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.uploadMedals_inactive.png", assembly));
            }
            if (badges.upload7 == true)
            {
                upload7 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.uploadMedal_02.png", assembly));
            }
            else
            {
                upload7 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.uploadMedals_inactive.png", assembly));
            }
            if (badges.upload30 == true)
            {
                upload30 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.uploadMedal_03.png", assembly));
            }
            else
            {
                upload30 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.uploadMedals_inactive.png", assembly));
            }
            if (badges.upload100 == true)
            {
                upload100 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.uploadMedal_04.png", assembly));
            }
            else
            {
                upload100 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.uploadMedals_inactive.png", assembly));
            }

            if (badges.vote30 == true)
            {
                vote30 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.voteMedal_01.png", assembly));
            }
            else
            {
                vote30 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.voteMedal_inactive.png", assembly));
            }
            if (badges.vote100 == true)
            {
                vote100 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.voteMedal_01.png", assembly));
            }
            else
            {
                vote100 = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.Medals.voteMedal_inactive.png", assembly));
            }
            Device.BeginInvokeOnMainThread(() => {
                buildUI();
            });
        }
コード例 #8
0
        public void OnImgTapped(object sender, EventArgs args)
        {
            iiBitmapView activeImg = (iiBitmapView)sender;

            Debug.WriteLine("DHB:SubmissionsImageRowViewCell:OnImgTapped: " + Height + " min height:" + View.MinimumHeightRequest);
            if ((activeImg != null) && (activeImg.Bitmap != null))
            {
                MasterPage      m1 = ((MasterPage)Application.Current.MainPage);
                MainPageSwipeUI mp = m1.thePages;
                //mp.zoomPage.ActiveMetaBallot = new BallotCandidateJSON(); // nada for now.

                iiBitmapView taggedImg = new iiBitmapView {
                    Bitmap            = activeImg.Bitmap.Copy(),
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                };
                m1.zoomPage.MainImage = taggedImg;
                //mp.zoomPage.buildZoomView();
                m1.zoomPage.buildZoomFromUserPhotoMeta(activeImg.PhotoMeta);
                // ahh.... there's 2 pieces of info needed now.  The parent page and subpage.
                // eg profile/subs; profile/likes; eventPage/categories

                /*
                 * mp.zoomPage.PreviousContent = mp.thePages.profilePage;
                 * //mp.zoomPage.PreviousView = mp.thePages.profilePage.Content;
                 * mp.thePages.profilePage.PreviousView = mp.thePages.profilePage.Content;
                 * Device.BeginInvokeOnMainThread(() => {
                 *  mp.thePages.profilePage.Content = mp.zoomPage.Content;
                 * });
                 */
                ContentView active = null;
                if (mp.Position == MainPageSwipeUI.CAMERA_PAGE)
                {
                    //mp.zoomPage.PreviousContent = mp.thePages.cameraPage;
                    //m1.zoomPage.PreviousContent = mp.cameraPage;
                    //mp.thePages.cameraPage.PreviousView = mp.thePages.cameraPage.Content;
//                    active = mp.thePages.cameraPage;
                    active = mp.cameraPage;
                }
                else if (mp.Position == MainPageSwipeUI.PROFILE_PAGE)
                {
                    active = mp.profilePage;
                    //m1.zoomPage.PreviousContent = mp.profilePage;
                    //mp.zoomPage.PreviousView = mp.thePages.profilePage.Content;
                    mp.profilePage.PreviousView = active.Content;
                }
                Device.BeginInvokeOnMainThread(() => {
                    //active.Content = m1.zoomPage.Content;
                    m1.gotoZoomPage();
                });
            }
            Debug.WriteLine("DHB:SubmissionsImageRowViewCell:OnImgTapped: " + Height);
        }
コード例 #9
0
        private int buildUI()
        {
            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            if (portraitView == null)
            {
                portraitView = new Grid {
                    ColumnSpacing = 1, RowSpacing = 1, BackgroundColor = GlobalStatusSingleton.backgroundColor
                };
                for (int i = 0; i < 16; i++)
                {
                    portraitView.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Star)
                    });
                }
                portraitView.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(1, GridUnitType.Star)
                });

                backButton = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.backbutton.png", assembly))
                {
                    HorizontalOptions = LayoutOptions.Start,
                    Margin            = 4,
                };
                TapGestureRecognizer backTap = new TapGestureRecognizer();
                backTap.Tapped += OnBackPressed;
                backButton.GestureRecognizers.Add(backTap);

                //eventCategories = new ListView { ItemsSource = catNames, ItemTemplate = myDataTemplate, };
                eventCategories = new ListView {
                    ItemsSource = catNames,
                };
                eventCategories.ItemSelected += OnRowTapped;
            }
            else
            {
                // flush the old children.
                portraitView.Children.Clear();
                portraitView.IsEnabled = true;
            }
            portraitView.Children.Add(eventName, 0, 0);
            portraitView.Children.Add(backButton, 0, 0);
            portraitView.Children.Add(eventCreator, 0, 2);
            portraitView.Children.Add(eventMaxPlayers, 0, 3);
            portraitView.Children.Add(eventStartDate, 0, 4);
            portraitView.Children.Add(categoryHeader, 0, 5);
            portraitView.Children.Add(eventCategories, 0, 6);
            Grid.SetRowSpan(eventCategories, 8);
            Content = portraitView;
            return(1);
        }
コード例 #10
0
        private void buildBackCaret()
        {
            backCaret = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.backbutton.png", assembly))
            {
                Margin            = 4,
                HorizontalOptions = LayoutOptions.Start,
            };
            TapGestureRecognizer back = new TapGestureRecognizer();

            back.Tapped += (e, a) => {
                callingPage.switchToEventView();
            };
            backCaret.GestureRecognizers.Add(back);
        }
コード例 #11
0
        public CameraEnterPhotoView(CameraContentPage parent)
        {
            if (Device.Idiom == TargetIdiom.Tablet)
            {
                heightAdjustment = 20.0;
            }
            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            /* try in buildUI to see if that makes a difference for ios...
             * backButton = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.backbutton.png", assembly)) {
             *  HorizontalOptions = LayoutOptions.Start,
             *  Margin = 4,
             * };
             * TapGestureRecognizer backTap = new TapGestureRecognizer();
             * backTap.Tapped += OnBackPressed;
             * backButton.GestureRecognizers.Add(backTap);
             */
            // the above is not working on ios and it makes no sense as it works in Android. grrrr.
            // this didn't help.
            //if (Device.OS == TargetPlatform.iOS) {
            //  challengeLabelP.GestureRecognizers.Add(backTap);
            //}
            //Debug.WriteLine("DHB:CameraEnterPhotoView:CameraEnterPhotoView in ctor ok");

            alertBulb = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.alert.png", assembly))
            {
                HorizontalOptions = LayoutOptions.End,
                Margin            = 4,
                IsVisible         = false,
            };

            this.cameraPage       = parent;
            submitCurrentPictureP = new Button {
                Text = "Enter this photo!",
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                TextColor         = Color.White,
                BackgroundColor   = GlobalStatusSingleton.ButtonColor,
                FontSize          = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                IsVisible         = false,
                //IsEnabled = false,
            };
            submitCurrentPictureP.Clicked += this.OnSubmitCurrentPicture;
            latestTakenImgP = new iiBitmapView();

            this.animate          += new EventHandler(AnimationEvent);
            tagsEntry.TextChanged += tagTextChanged;
            submitOnTagEntryBegin += OnTagEntryBeginSubmit;
        }
コード例 #12
0
        public CameraCreateCategoryView(CameraContentPage parent)
        {
            cameraPage = parent;

            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            backButton = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.backbutton.png", assembly))
            {
                Margin = 4,
            };
            TapGestureRecognizer tapped = new TapGestureRecognizer();

            tapped.Tapped += OnBackPressed;
            backButton.GestureRecognizers.Add(tapped);

            // make sure categoryNames is seeded with at least one entry box.
            Entry newCategory = new Entry {
                Placeholder             = "Category Name, e.g. Red",
                PlaceholderColor        = Color.Gray,
                TextColor               = Color.Black,
                FontSize                = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                BackgroundColor         = Color.White,
                HorizontalTextAlignment = TextAlignment.Center,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                Margin = 1,
            };

            newCategory.TextChanged += PreventCommasInCategoryNames;

            categoryNames.Add(newCategory);
            addCategory = new iiBitmapView {
                Bitmap            = GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.votebox.png", assembly),
                HorizontalOptions = LayoutOptions.End,
                Margin            = 3,
            };
            TapGestureRecognizer catTapped = new TapGestureRecognizer();

            catTapped.Tapped += OnAddCategory;
            addCategory.GestureRecognizers.Add(catTapped);

            TapGestureRecognizer createTapped = new TapGestureRecognizer();

            createTapped.Tapped += OnCreateEvent;
            createEvent.GestureRecognizers.Add(createTapped);

            buildUI();
        }
コード例 #13
0
        public PageHeader()
        {
            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            settingsButton = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.settings_inactive.png", assembly))
            {
                HorizontalOptions = LayoutOptions.End,
                Margin            = 4,
                IsVisible         = false, // starts invis.
            };
            settingsButton_active = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.settings.png", assembly))
            {
                HorizontalOptions = LayoutOptions.End,
                Margin            = 4,
                IsVisible         = false, // starts invis.
            };

            TapGestureRecognizer tapped = new TapGestureRecognizer();

            tapped.Tapped += ((e, s) => {
                MasterPage mp = ((MasterPage)Application.Current.MainPage);
                settingsButton_active.IsVisible = true;
                settingsButton.IsVisible = false;
                mp.thePages.profilePage.gotoSettingsPage();
            });
            settingsButton.GestureRecognizers.Add(tapped);

            backCaret = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.backbutton.png", assembly))
            {
                HorizontalOptions = LayoutOptions.Start,
                Margin            = 4,
                IsVisible         = false, // starts invis.
            };

            TapGestureRecognizer goBack = new TapGestureRecognizer();

            goBack.Tapped += ((a, b) => {
                if (backButtonDelegate != null)
                {
                    backButtonDelegate(a, b);
                }
            });
            backCaret.GestureRecognizers.Add(goBack);

            this.Content = buildTextLogo();
        }
コード例 #14
0
        public CameraCategorySelectionView(CameraContentPage parent)
        {
            cameraPage = parent;

            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            categoryCreationButton = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.createaneventbutton.png", assembly))
            {
                Scaling      = true,
                EnsureSquare = false,
                //MinimumHeightRequest = 80,
                //MinimumWidthRequest = .8*360,
                //HorizontalOptions = LayoutOptions.CenterAndExpand,
                Margin = 2,
            };
            categoryCreationButton.SizeChanged += CheckCatButton;

            TapGestureRecognizer tap = new TapGestureRecognizer();

            tap.Tapped += OnCategoryCreateClicked;
            categoryCreationButton.GestureRecognizers.Add(tap);


            //joinPassphraseFrame.Content = joinPassphrase;
            joinImageEnd = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.play.png", assembly))
            {
                HorizontalOptions = LayoutOptions.End,
                Margin            = 3,
            };
            TapGestureRecognizer joinTap = new TapGestureRecognizer();

            joinTap.Tapped += OnJoinClicked;
            //joinLabel.GestureRecognizers.Add(joinTap);
            joinImageEnd.GestureRecognizers.Add(joinTap);

            LoadEventsRequest += new EventHandler(OnEventsLoadRequest);
        }
コード例 #15
0
ファイル: LeaderboardCell.cs プロジェクト: PhotoIImprov/iiApp
        public LeaderboardCell()
        {
            double gridHeightForImages = 2;

            if (Device.Idiom == TargetIdiom.Tablet)
            {
                gridHeightForImages = 4;
            }
            myView = new Grid {
                ColumnSpacing = 1, RowSpacing = 1,
            };
            myView.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            myView.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(gridHeightForImages, GridUnitType.Star)
            });
            myView.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(gridHeightForImages, GridUnitType.Star)
            });
            myView.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(gridHeightForImages, GridUnitType.Star)
            });
            myView.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(.25, GridUnitType.Star)
            });
            myView.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            myView.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            myView.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            categoryDescription = new Label {
                BackgroundColor         = GlobalStatusSingleton.ButtonColor,
                TextColor               = Color.White,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                FontAttributes          = FontAttributes.Bold,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                //WidthRequest = Width,
                MinimumHeightRequest = Height / 15.0,
                FontSize             = 30, // program later
            };
            //GlobalSingletonHelpers.fixLabelHeight(categoryDescription, categoryDescription.Width, categoryDescription.Height, 30);

            img0 = new iiBitmapView();
            img1 = new iiBitmapView();
            img2 = new iiBitmapView();
            img3 = new iiBitmapView();
            img4 = new iiBitmapView();
            img5 = new iiBitmapView();
            img6 = new iiBitmapView();
            img7 = new iiBitmapView();
            img8 = new iiBitmapView();

            categoryDescription.SetBinding(Label.TextProperty, "title");
            img0.SetBinding(iiBitmapView.BitmapProperty, "bitmap0");
            img1.SetBinding(iiBitmapView.BitmapProperty, "bitmap1");
            img2.SetBinding(iiBitmapView.BitmapProperty, "bitmap2");
            img3.SetBinding(iiBitmapView.BitmapProperty, "bitmap3");
            img4.SetBinding(iiBitmapView.BitmapProperty, "bitmap4");
            img5.SetBinding(iiBitmapView.BitmapProperty, "bitmap5");
            img6.SetBinding(iiBitmapView.BitmapProperty, "bitmap6");
            img7.SetBinding(iiBitmapView.BitmapProperty, "bitmap7");
            img8.SetBinding(iiBitmapView.BitmapProperty, "bitmap8");

            img0.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp0Meta");
            img1.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp1Meta");
            img2.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp2Meta");
            img3.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp3Meta");
            img4.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp4Meta");
            img5.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp5Meta");
            img6.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp6Meta");
            img7.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp7Meta");
            img8.SetBinding(iiBitmapView.PhotoMetaProperty, "bmp8Meta");

            TapGestureRecognizer imgTapped = new TapGestureRecognizer();

            imgTapped.Tapped += OnImgTapped;
            img0.GestureRecognizers.Add(imgTapped);
            img1.GestureRecognizers.Add(imgTapped);
            img2.GestureRecognizers.Add(imgTapped);
            img3.GestureRecognizers.Add(imgTapped);
            img4.GestureRecognizers.Add(imgTapped);
            img5.GestureRecognizers.Add(imgTapped);
            img6.GestureRecognizers.Add(imgTapped);
            img7.GestureRecognizers.Add(imgTapped);
            img8.GestureRecognizers.Add(imgTapped);

            myView.Children.Add(categoryDescription, 0, 0);
            Grid.SetColumnSpan(categoryDescription, 3);
            myView.Children.Add(img0, 0, 1);
            myView.Children.Add(img1, 1, 1);
            myView.Children.Add(img2, 2, 1);
            myView.Children.Add(img3, 0, 2);
            myView.Children.Add(img4, 1, 2);
            myView.Children.Add(img5, 2, 2);
            myView.Children.Add(img6, 0, 3);
            myView.Children.Add(img7, 1, 3);
            myView.Children.Add(img8, 2, 3);

            this.View = myView;
        }
コード例 #16
0
        private int buildUI()
        {
            this.BackgroundColor = Color.Transparent;

            assembly = this.GetType().GetTypeInfo().Assembly;
            if (portraitView == null)
            {
                portraitView = new Grid {
                    ColumnSpacing = 0, RowSpacing = 0, BackgroundColor = Color.White,
                };
                for (int i = 0; i < 20; i++)    // we're a whole page modal
                {
                    portraitView.RowDefinitions.Add(new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Star)
                    });
                }
                for (int i = 0; i < 12; i++)    // we're a whole page modal
                {
                    portraitView.ColumnDefinitions.Add(new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    });
                }
            }
            iiBitmapView backButton = new iiBitmapView {
                Bitmap            = GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.backbutton.png", assembly),
                HorizontalOptions = LayoutOptions.Start,
                VerticalOptions   = LayoutOptions.Center,
                Margin            = 2,
            };
            TapGestureRecognizer tap = new TapGestureRecognizer();

            tap.Tapped += OnCloseTapped;
            backButton.GestureRecognizers.Add(tap);
            portraitView.Children.Add(backButton, 0, 2);
            Grid.SetRowSpan(backButton, 2);

            buildRankImages();
            addImage(0, 1, 5);
            addImage(1, 7, 5);
            addImage(2, 1, 10);
            addImage(3, 7, 10);

            Label instructionsOne = new Label {
                Text = "Pick your favorites and earn lightbulbs!\n"
                       + "Tap the vote box starting with your favorite\n"
                       + "Tap an image to zoom in, like, tag, or flag\n"
                       + "Click play to enter your own photos!",
                TextColor = Color.Black, Opacity = 1,
                FontSize  = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                HorizontalTextAlignment = TextAlignment.Center,
            };

            portraitView.Children.Add(instructionsOne, 0, 15);
            Grid.SetColumnSpan(instructionsOne, 12);
            Grid.SetRowSpan(instructionsOne, 5);

            portraitView.Opacity = .8;
            Content = portraitView;

            if (animate != null)
            {
                animate(this, new EventArgs());
            }

            return(1);
        }
コード例 #17
0
ファイル: ZoomPage.cs プロジェクト: PhotoIImprov/iiApp
        private void buildMetaButtons()
        {
            saveDataOnExit = false;  //default setting.

            unlikedImg   = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.ImageMetaIcons.unliked.png", assembly));
            unflaggedImg = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.ImageMetaIcons.unflagged.png", assembly));
            likedImg     = new iiBitmapView {
                Bitmap    = (GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.ImageMetaIcons.liked.png", assembly)),
                IsVisible = false
            };
            flaggedImg = new iiBitmapView {
                Bitmap    = GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.ImageMetaIcons.flagged.png", assembly),
                IsVisible = false
            };

            TapGestureRecognizer ulTap = new TapGestureRecognizer();

            ulTap.Tapped += (sender, args) => {
                ActiveMetaBallot.isLiked = true;
                unlikedImg.IsVisible     = false;
                likedImg.IsVisible       = true;
                saveDataOnExit           = true;
            };
            unlikedImg.GestureRecognizers.Add(ulTap);

            TapGestureRecognizer lTap = new TapGestureRecognizer();

            lTap.Tapped += (sender, args) => {
                ActiveMetaBallot.isLiked = false;
                likedImg.IsVisible       = false;
                unlikedImg.IsVisible     = true;
                saveDataOnExit           = true;
            };
            likedImg.GestureRecognizers.Add(lTap);

            TapGestureRecognizer ufTap = new TapGestureRecognizer();

            ufTap.Tapped += (sender, args) => {
                ActiveMetaBallot.isFlagged = true;
                unflaggedImg.IsVisible     = false;
                flaggedImg.IsVisible       = true;
                saveDataOnExit             = true;
            };
            unflaggedImg.GestureRecognizers.Add(ufTap);

            TapGestureRecognizer fTap = new TapGestureRecognizer();

            fTap.Tapped += (sender, args) => {
                ActiveMetaBallot.isFlagged = false;
                flaggedImg.IsVisible       = false;
                unflaggedImg.IsVisible     = true;
                saveDataOnExit             = true;
            };
            flaggedImg.GestureRecognizers.Add(fTap);

            /*
             * backButton = new Button {
             *  //Text = buttonText,
             *  Text = "Back",
             *  HorizontalOptions = LayoutOptions.CenterAndExpand,
             *  //VerticalOptions = LayoutOptions.FillAndExpand,
             *  TextColor = Color.Black,
             *  BackgroundColor = GlobalStatusSingleton.ButtonColor,
             *  FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
             * };
             * backButton.Clicked += (sender, args) => {
             *  // Need to return to caller instead.
             *  //MasterPage mp = ((MasterPage)Application.Current.MainPage);
             *  //await mp.Navigation.PopModalAsync();
             *
             *  // only bother checking the textentry on exit.
             *  if (ActiveMetaBallot != null) {
             *      if ((ActiveMetaBallot.tags == null) || (!ActiveMetaBallot.tags.Equals(tagEntry.Text))) {
             *          ActiveMetaBallot.tags = tagEntry.Text;
             *      }
             *  }
             *
             *  if (saveDataOnExit) {
             *      saveDataOnExitAsync(this);
             *      Debug.WriteLine("DHB:ZoomPage:buildMetaButtons:backButtonClickedAnon this should print first");
             *  }
             *  PreviousContent.returnToCaller();
             * };*/

            /*backCaret = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.backbutton.png", assembly)) {
             *  Margin = 4,
             *  HorizontalOptions = LayoutOptions.Start,
             * };
             * TapGestureRecognizer back = new TapGestureRecognizer();
             * back.Tapped += OnBack;
             * backCaret.GestureRecognizers.Add(back);*/
        }
コード例 #18
0
        public KeyPageNavigator(string categoryDesc = "")
        {
            RowSpacing    = 0;
            ColumnSpacing = 0;

            BackgroundColor = GlobalStatusSingleton.backgroundColor;
            //Padding = 10;

            Assembly assembly = this.GetType().GetTypeInfo().Assembly;

            gotoVotingImgButtonOff           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.vote_inactive.png", assembly));
            gotoVotingImgButtonOn            = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.vote.png", assembly));
            gotoVotingImgButtonOff.IsVisible = false;

            gotoLeaderboardImgButtonOff          = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.leaderboard_inactive.png", assembly));
            gotoLeaderboardImgButtonOn           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.leaderboard.png", assembly));
            gotoLeaderboardImgButtonOn.IsVisible = false;

            gotoCameraImgButtonOff          = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.play_inactive.png", assembly));
            gotoCameraImgButtonOn           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.play.png", assembly));
            gotoCameraImgButtonOn.IsVisible = false;

            gotoHamburgerImgButtonOff          = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.profile_inactive.png", assembly));
            gotoHamburgerImgButtonOn           = new iiBitmapView(GlobalSingletonHelpers.loadSKBitmapFromResourceName("ImageImprov.IconImages.profile.png", assembly));
            gotoHamburgerImgButtonOn.IsVisible = false;

            categoryLabel = new Label {
                Text = categoryDesc,
                HorizontalOptions       = LayoutOptions.FillAndExpand,
                VerticalOptions         = LayoutOptions.FillAndExpand,
                HorizontalTextAlignment = TextAlignment.Center,
                TextColor       = Color.Black,
                BackgroundColor = GlobalStatusSingleton.backgroundColor,
                LineBreakMode   = LineBreakMode.WordWrap,
                FontSize        = Device.GetNamedSize(NamedSize.Micro, typeof(Label)),
            };

            tapGesture         = new TapGestureRecognizer();
            tapGesture.Tapped += OnClicked;
            gotoVotingImgButtonOff.GestureRecognizers.Add(tapGesture);
            //goHomeImgButton.GestureRecognizers.Add(tapGesture);
            gotoLeaderboardImgButtonOff.GestureRecognizers.Add(tapGesture);
            gotoCameraImgButtonOff.GestureRecognizers.Add(tapGesture);
            gotoHamburgerImgButtonOff.GestureRecognizers.Add(tapGesture);

            // on buttons behave differently...
            TapGestureRecognizer tapGestureOn = new TapGestureRecognizer();

            tapGestureOn.Tapped += OnClickedWhenOn;
            gotoVotingImgButtonOn.GestureRecognizers.Add(tapGestureOn);
            gotoLeaderboardImgButtonOn.GestureRecognizers.Add(tapGestureOn);
            gotoCameraImgButtonOn.GestureRecognizers.Add(tapGestureOn);
            gotoHamburgerImgButtonOn.GestureRecognizers.Add(tapGestureOn);

            horizLine = new BoxView {
                HeightRequest = 1.0, BackgroundColor = GlobalStatusSingleton.highlightColor, HorizontalOptions = LayoutOptions.FillAndExpand,
            };
            // ColumnSpacing = 1; RowSpacing = 1;
            ColumnDefinitions.Add(new ColumnDefinition());
            ColumnDefinitions.Add(new ColumnDefinition());
            ColumnDefinitions.Add(new ColumnDefinition());
            ColumnDefinitions.Add(new ColumnDefinition());
            RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(14, GridUnitType.Star)
            });
            RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(60, GridUnitType.Star)
            });
            RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(20, GridUnitType.Star)
            });
            RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(5, GridUnitType.Star)
            });
            Children.Add(horizLine, 0, 0);
            Grid.SetColumnSpan(horizLine, 4);
            Children.Add(gotoVotingImgButtonOff, 0, 2);
            Children.Add(gotoVotingImgButtonOn, 0, 2);
            //Children.Add(goHomeImgButton, 1, 1);
            Children.Add(gotoLeaderboardImgButtonOff, 1, 2);
            Children.Add(gotoLeaderboardImgButtonOn, 1, 2);
            Children.Add(gotoCameraImgButtonOff, 2, 2);
            Children.Add(gotoCameraImgButtonOn, 2, 2);
            Children.Add(categoryLabel, 2, 3);
            Children.Add(gotoHamburgerImgButtonOff, 3, 2);
            Children.Add(gotoHamburgerImgButtonOn, 3, 2);

            // We now have a play button.
            // This object should always be created AFTER the judging page, so this should exist...
            //if (GlobalStatusSingleton.ptrToJudgingPageLoadCategory != null) {
            //    GlobalStatusSingleton.ptrToJudgingPageLoadCategory += new CategoryLoadSuccessEventHandler(OnCategoryLoad);
            //}
        }