Beispiel #1
0
        private void prepareDisableConfirmationButtonOnboardingStep()
        {
            greyCheckmarkButtonImage = UIImage.FromBundle("icCheckGrey");
            greenCheckmarkButtonImage = UIImage.FromBundle("doneGreen");

            var disabledConfirmationButtonOnboardingStep
                = new DisabledConfirmationButtonOnboardingStep(
                    ViewModel.OnboardingStorage,
                    isDescriptionEmptySubject.AsObservable());

            disabledConfirmationButtonOnboardingDisposable
                = disabledConfirmationButtonOnboardingStep
                    .ShouldBeVisible
                    .Subscribe(visible => InvokeOnMainThread(() =>
                    {
                        var image = visible ? greyCheckmarkButtonImage : greenCheckmarkButtonImage;
                        DoneButton.SetImage(image, UIControlState.Normal);
                    }));
        }
        private void prepareDisableConfirmationButtonOnboardingStep()
        {
            greyCheckmarkButtonImage  = UIImage.FromBundle("icCheckGrey");
            greenCheckmarkButtonImage = UIImage.FromBundle("doneGreen");

            var disabledConfirmationButtonOnboardingStep
                = new DisabledConfirmationButtonOnboardingStep(
                      ViewModel.OnboardingStorage,
                      isDescriptionEmptySubject.AsObservable());

            disabledConfirmationButtonOnboardingDisposable
                = disabledConfirmationButtonOnboardingStep
                  .ShouldBeVisible
                  .ObserveOn(IosDependencyContainer.Instance.SchedulerProvider.MainScheduler)
                  .Subscribe(visible =>
            {
                var image = visible ? greyCheckmarkButtonImage : greenCheckmarkButtonImage;
                DoneButton.SetImage(image, UIControlState.Normal);
            });
        }
Beispiel #3
0
        /// <summary>
        /// Create a <see cref="MenuView"/>
        /// </summary>
        public MenuView()
        {
            CloseButton  = CreateButton("CloseButton");
            DoneButton   = CreateButton("DoneButton");
            ExtraButton  = CreateButton("ExtraButton");
            DeleteButton = CreateButton("DeleteButton");

            MenuTitle = new UILabel
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                ContentMode            = UIViewContentMode.Left,
                TextAlignment          = UITextAlignment.Center,
                UserInteractionEnabled = false,
                Opaque                    = false,
                BaselineAdjustment        = UIBaselineAdjustment.AlignBaselines,
                AdjustsFontSizeToFitWidth = false,
                LineBreakMode             = UILineBreakMode.TailTruncation,
                Text               = Configuration.CameraRollTitle,
                TextColor          = UIColor.White,
                AccessibilityLabel = "MenuTitle"
            };

            Add(CloseButton);
            Add(DoneButton);
            Add(ExtraButton);
            Add(MenuTitle);
            Add(DeleteButton);

            var checkImage  = Configuration.CheckImage ?? UIImage.FromBundle("ic_check");
            var closeImage  = Configuration.CloseImage ?? UIImage.FromBundle("ic_close");
            var extraImage  = Configuration.ExtraImage ?? UIImage.FromBundle("ic_add");
            var deleteImage = Configuration.DeleteImage ?? UIImage.FromBundle("ic_delete");

            if (Configuration.TintIcons)
            {
                checkImage =
                    checkImage?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                closeImage =
                    closeImage?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                extraImage =
                    extraImage?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                deleteImage =
                    deleteImage?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
                DoneButton.TintColor   = Configuration.TintColor;
                CloseButton.TintColor  = Configuration.TintColor;
                ExtraButton.TintColor  = Configuration.TintColor;
                DeleteButton.TintColor = Configuration.DeleteTintColor;
            }

            CloseButton.SetImage(closeImage, UIControlState.Normal);
            CloseButton.SetImage(closeImage, UIControlState.Highlighted);
            CloseButton.SetImage(closeImage, UIControlState.Selected);

            DoneButton.SetImage(checkImage, UIControlState.Normal);

            ExtraButton.SetImage(extraImage, UIControlState.Normal);

            DeleteButton.SetImage(deleteImage, UIControlState.Normal);

            MenuTitle.TextColor = Configuration.BaseTintColor;

            CloseButton.TouchUpInside  += OnClose;
            DoneButton.TouchUpInside   += OnDone;
            ExtraButton.TouchUpInside  += OnExtra;
            DeleteButton.TouchUpInside += OnDelete;

            CloseButtonHidden  = false;
            DoneButtonHidden   = false;
            ExtraButtonHidden  = true;
            DeleteButtonHidden = true;
        }