Example #1
0
        public static FadeOutEffect CreateAndStart(Widget widget, float time, FadeOutEffectInterpolator interpolator)
        {
            FadeOutEffect fadeOutEffect = new FadeOutEffect(widget, time, interpolator);

            fadeOutEffect.Start();
            return(fadeOutEffect);
        }
Example #2
0
 private void HideDialog()
 {
     if (this.dialog != null && !this.isHidingDialog)
     {
         this.isHidingDialog = true;
         FadeOutEffect fadeOutEffect = new FadeOutEffect();
         fadeOutEffect.Time     = 300f;
         this.dialog.HideEffect = fadeOutEffect;
         this.dialog.HideEffect.EffectStopped += new EventHandler <EventArgs>(this.FadeOutEffectStopped);
         this.dialog.Hide();
         this.updateState(PopupList.ButtonState.Normal);
         this.CancelTouchItemIndex();
         if (this.listSelectedIndex >= 0)
         {
             this.SelectedIndex = this.listSelectedIndex;
         }
     }
 }
Example #3
0
 public BusyIndicator(bool autoStart)
 {
     base.Width               = 48f;
     base.Height              = 48f;
     this.image               = new AnimationImageBox();
     this.image.Image         = new ImageAsset(SystemImageAsset.BusyIndicator);
     this.image.FrameWidth    = 48;
     this.image.FrameHeight   = 48;
     this.image.FrameCount    = 8;
     this.image.FrameInterval = 66.7f;
     base.AddChildLast(this.image);
     this.fadeInEffect  = new FadeInEffect(this.image, 200f, FadeInEffectInterpolator.Linear);
     this.fadeOutEffect = new FadeOutEffect(this.image, 200f, FadeOutEffectInterpolator.Linear);
     this.fadeOutEffect.EffectStopped += new EventHandler <EventArgs>(this.fadeOutEffect_EffectStopped);
     if (autoStart)
     {
         this.image.Visible = true;
         this.image.Start();
         return;
     }
     this.image.Visible = false;
     this.image.Stop();
 }
Example #4
0
        public NavigationScene()
        {
            base.Visible         = false;
            this.navigationPanel = new Panel
            {
                Width           = (float)UISystem.FramebufferWidth,
                Height          = NavigationScene.navigationBarHeight,
                X               = 0f,
                Y               = -NavigationScene.navigationBarHeight,
                BackgroundColor = new UIColor(0f, 0f, 0f, 0f)
            };
            base.RootWidget.AddChildLast(this.navigationPanel);
            this.backgroundImage = new ImageBox
            {
                Width           = this.navigationPanel.Width,
                Height          = this.navigationPanel.Height,
                X               = 0f,
                Y               = 0f,
                ImageScaleType  = ImageScaleType.NinePatch,
                Image           = new ImageAsset(SystemImageAsset.NavigationBarBackground),
                NinePatchMargin = AssetManager.GetNinePatchMargin(SystemImageAsset.NavigationBarBackground)
            };
            this.navigationPanel.AddChildLast(this.backgroundImage);
            CustomButtonImageSettings customImage = new CustomButtonImageSettings
            {
                BackgroundNormalImage     = new ImageAsset(SystemImageAsset.BackButtonBackgroundNormal),
                BackgroundPressedImage    = new ImageAsset(SystemImageAsset.BackButtonBackgroundPressed),
                BackgroundDisabledImage   = new ImageAsset(SystemImageAsset.BackButtonBackgroundDisabled),
                BackgroundNinePatchMargin = AssetManager.GetNinePatchMargin(SystemImageAsset.BackButtonBackgroundNormal)
            };
            float num  = (NavigationScene.navigationBarHeight - NavigationScene.backButtonHeight) / 2f;
            Font  font = new Font(0, NavigationScene.navigationBarFontSize, 0);

            this.backButtonCurrent = new Button
            {
                Width       = NavigationScene.backButtonWidth,
                Height      = NavigationScene.backButtonHeight,
                X           = num,
                Y           = num,
                TextFont    = font,
                Style       = ButtonStyle.Custom,
                CustomImage = customImage,
                Visible     = false
            };
            this.backButtonCurrent.ButtonAction += new EventHandler <TouchEventArgs>(NavigationScene.PopAction);
            this.navigationPanel.AddChildLast(this.backButtonCurrent);
            this.backButtonNext = new Button
            {
                Width       = NavigationScene.backButtonWidth,
                Height      = NavigationScene.backButtonHeight,
                X           = num,
                Y           = num,
                TextFont    = font,
                Style       = ButtonStyle.Custom,
                CustomImage = customImage,
                Visible     = false
            };
            this.backButtonNext.ButtonAction += new EventHandler <TouchEventArgs>(NavigationScene.PopAction);
            this.navigationPanel.AddChildLast(this.backButtonNext);
            float num2 = this.navigationPanel.Width - NavigationScene.backButtonWidth * 2f - num * 2f;

            this.leftLabelPosX   = -num2;
            this.centerLabelPosX = NavigationScene.backButtonWidth + num;
            this.rightLabelPosX  = (float)UISystem.FramebufferWidth;
            this.labelCurrent    = new Label
            {
                Width  = num2,
                Height = this.navigationPanel.Height,
                X      = this.centerLabelPosX,
                Y      = 0f,
                Font   = font,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Middle
            };
            this.navigationPanel.AddChildLast(this.labelCurrent);
            this.labelNext = new Label
            {
                Width  = num2,
                Height = this.navigationPanel.Height,
                X      = this.rightLabelPosX,
                Y      = 0f,
                Font   = font,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Middle,
                Visible             = false
            };
            this.navigationPanel.AddChildLast(this.labelNext);
            this.panelShowMoveEffect = new MoveEffect
            {
                Widget             = this.navigationPanel,
                Interpolator       = MoveEffectInterpolator.Custom,
                CustomInterpolator = new AnimationInterpolator(NavigationScene.EaseOutQuartInterpolator),
                Time = NavigationScene.showHideAnimationDuration,
                X    = 0f,
                Y    = 0f
            };
            this.panelHideMoveEffect = new MoveEffect
            {
                Widget             = this.navigationPanel,
                Interpolator       = MoveEffectInterpolator.Custom,
                CustomInterpolator = new AnimationInterpolator(NavigationScene.EaseOutQuartInterpolator),
                Time = NavigationScene.showHideAnimationDuration,
                X    = 0f,
                Y    = -NavigationScene.navigationBarHeight
            };
            this.panelHideMoveEffect.EffectStopped += new EventHandler <EventArgs>(this.OnPanelHideMoveEffectStopped);
            this.labelCurrentMoveEffect             = new MoveEffect
            {
                Interpolator       = MoveEffectInterpolator.Custom,
                CustomInterpolator = new AnimationInterpolator(NavigationScene.EaseOutQuartInterpolator),
                Time = NavigationScene.stackAnimationTime
            };
            this.labelCurrentMoveEffect.EffectStopped += new EventHandler <EventArgs>(this.OnLabelMoveEffectStopped);
            this.labelCurrentFadeOutEffect             = new FadeOutEffect
            {
                Interpolator = FadeOutEffectInterpolator.Linear,
                Time         = NavigationScene.stackAnimationTime
            };
            this.labelNextMoveEffect = new MoveEffect
            {
                Interpolator       = MoveEffectInterpolator.Custom,
                CustomInterpolator = new AnimationInterpolator(NavigationScene.EaseOutQuartInterpolator),
                Time = NavigationScene.stackAnimationTime
            };
            this.labelNextFadeInEffect = new FadeInEffect
            {
                Interpolator = FadeInEffectInterpolator.Linear,
                Time         = NavigationScene.stackAnimationTime
            };
            this.backButtonCurrentFadeOutEffect = new FadeOutEffect
            {
                Interpolator = FadeOutEffectInterpolator.Linear,
                Time         = NavigationScene.stackAnimationTime
            };
            this.backButtonNextFadeInEffect = new FadeInEffect
            {
                Interpolator = FadeInEffectInterpolator.Linear,
                Time         = NavigationScene.stackAnimationTime
            };
        }