Esempio n. 1
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;
        }
Esempio n. 2
0
        public MainPageSwipeUI(LoginPage loginPage)
        {
            BackgroundColor = GlobalStatusSingleton.backgroundColor;

            refToLoginPage = loginPage;

            //var padding = new Thickness(0, Device.OnPlatform(40, 40, 0), 0, 0);
            leaderboardPage = new LeaderboardPage();
            judgingPage     = new JudgingContentPage();
            cameraPage      = new CameraContentPage();
            profilePage     = new ProfilePage();

            Debug.WriteLine("DHB:MainPageSwipeUI:ctor cameraPage created.");



            // TokenReceived is my successful login event.
            loginPage.TokenReceived += new TokenReceivedEventHandler(this.TokenReceived);
            loginPage.TokenReceived += new TokenReceivedEventHandler(judgingPage.TokenReceived);
            loginPage.TokenReceived += new TokenReceivedEventHandler(profilePage.TokenReceived);
            loginPage.LogoutClicked += new LogoutClickedEventHandler(this.OnLogoutClicked);

            // These lines enable another page to process a first page's events.
            // both judgingPage and cameraPage are guaranteed to exist at this point.
            // is categoryLoad?
            judgingPage.CategoryLoadSuccess          += new CategoryLoadSuccessEventHandler(cameraPage.OnCategoryLoad);
            judgingPage.CategoryLoadSuccess          += new CategoryLoadSuccessEventHandler(leaderboardPage.OnCategoryLoad);
            judgingPage.CategoryLoadSuccess          += new CategoryLoadSuccessEventHandler(profilePage.MySubmissionsPage.OnCategoryLoad);
            judgingPage.CategoryLoadSuccess          += new CategoryLoadSuccessEventHandler(profilePage.LikesPage.OnCategoryLoad);
            judgingPage.CategoryLoadSuccess          += new CategoryLoadSuccessEventHandler(profilePage.EventsPage.OnCategoryLoad);
            cameraPage.LoadBallotFromPhotoSubmission += new LoadBallotFromPhotoSubmissionEventHandler(judgingPage.OnLoadBallotFromSubmission);
            cameraPage.LoadBallotFromPhotoSubmission += new LoadBallotFromPhotoSubmissionEventHandler(profilePage.MySubmissionsPage.OnPhotoSubmit);

            // Change behavior. Don't want to be able to do stuff prior to successful login...
            // Easiest to add these pages POST login.
            // Delayed add doesn't seem to work.  Adding now, and switching from login page to this.
            Children.Add(judgingPage);
            Children.Add(leaderboardPage);
            Children.Add(cameraPage);
            Children.Add(profilePage);

            Debug.WriteLine("DHB:MainPageSwipeUI:MainPageSwipeUI Children count is:" + Children.Count);

            this.ItemTemplate = new CarouselTemplateSelector();
            this.ItemsSource  = Children;
            //this.SetBinding(CarouselView.ItemsSourceProperty, "Children");
            BindingContext = this;
            Position       = 0; // should be the voting page.
        }
        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();
        }
Esempio n. 4
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);
        }