Esempio n. 1
0
        private void LoadReflection()
        {
            try
            {
                Clear();
                ReflectionExample reflectionEx = getReflectionExample();
                reflectionEx.Visible   = false;
                reflectionEx.BackColor = BackColor;
                panel2.Controls.Add(reflectionEx);
                //reflectionEx.Dock = DockStyle.Fill;
                reflectionEx.Location = Point.Empty;
                reflectionEx.Size     = panel2.Size;

                SlideIn CstSl = new SlideIn();
                CstSl.From     = Direction.Right;
                CstSl.Distance = 500;
                animator1.Add(reflectionEx, CstSl);
                /// Some Glitch
                ///
                reflectionEx.Visible = true;
                reflectionEx.Visible = false;
            }
            catch (Exception ex)
            {
                ShowError(ex.Message);
            }
        }
Esempio n. 2
0
        public void TransitionAnimationSlideIn()
        {
            tlog.Debug(tag, $"TransitionAnimationSlideIn START");

            var testingTarget = new SlideIn(3000);

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <SlideIn>(testingTarget, "should be an instance of SlideIn class!");

            var style = testingTarget.DefaultImageStyle;
            var dummy = -Window.Instance.GetWindowSize().Width;

            Assert.IsTrue(Window.Instance.GetWindowSize().Width == style.Size.Width);
            Assert.IsTrue(Window.Instance.GetWindowSize().Height == style.Size.Height);
            Assert.IsTrue(dummy == style.Position.X);
            Assert.IsTrue(0 == style.Position.Y);

            Assert.IsTrue(0 == testingTarget.AnimationDataList[0].StartTime);
            Assert.IsTrue(3000 == testingTarget.AnimationDataList[0].EndTime);
            Assert.IsTrue("PositionX" == testingTarget.AnimationDataList[0].Property);
            Assert.IsTrue("0" == testingTarget.AnimationDataList[0].DestinationValue);

            testingTarget.Dispose();
            tlog.Debug(tag, $"TransitionAnimationSlideIn END (OK)");
        }
Esempio n. 3
0
        void Form1_Shown(object sender, System.EventArgs e)
        {
            int startFrame = 10;
            // Menu
            SlideIn sl1 = new SlideIn();

            sl1.startFrame = startFrame;
            animator1.Add(panel1, sl1);

            startFrame += 30;

            // Menu Pane
            SlideIn sl2 = new SlideIn();

            sl2.startFrame = startFrame;
            sl2.From       = Direction.Right;
            animator1.Add(panel2, sl2);

            startFrame += 30;

            // Menu Button Animation
            foreach (Control item in panel1.Controls)
            {
                SlideIn _sl = new SlideIn();
                _sl.From       = Direction.Left;
                _sl.startFrame = startFrame;
                animator1.Add(item, _sl);
                //animator1.AddReflection(item);
                /// Play with this number to load menu item in difftent style
                /// try 1,2,3,0
                startFrame += 3;
            }
        }
    IEnumerator slide(SlideIn slideIn)
    {
        yield return(new WaitForSeconds(slideIn.InitialDelay));

        Vector2[] vels = new Vector2[slideIn.SlidingObjects.Count];

        float timer = 0;

        while (timer < slideIn.Time)
        {
            for (int i = 0; i < slideIn.SlidingObjects.Count; i++)
            {
                SlideIn.SlidingObject obj = slideIn.SlidingObjects[i];

                obj.Transform.anchoredPosition = Vector2.Lerp(obj.StartLocation, obj.EndLocation, timer / slideIn.Time);
            }

            timer += Time.deltaTime;
            yield return(null);
        }

        foreach (var obj in slideIn.SlidingObjects)
        {
            obj.Transform.anchoredPosition = obj.EndLocation;
        }

        CameraCache.Main.ShakeScreen2D(BurstShakeTime, BurstShakeAmount);
    }
Esempio n. 5
0
            async Task InitializeComponents()
            {
                AutoFlash = true;

                Tapped.Handle(ViewButtonTapped);

                await Add(PhotoImage = new ImageView { Id = "PhotoImage", CssClass = "icon", Path = Item.Photo.Path }
                          .Set(x => x.Style.Visible = (Module.ShowPhotoColumn && Item.Photo.HasValue()))
                          .Set(x => x.Style.Ignored = !(Module.ShowPhotoColumn)));

                await Add(NameColumn = new Stack { Id = "NameColumn" });

                await NameColumn.Add(Name = new TextView { Id = "Name", CssClass = "title", Text = Item.Name });

                await NameColumn.Add(ContactDetails = new TextView
                {
                    Id   = "ContactDetails",
                    Text = (new[] { Item.Email, Item.Tel }.Trim().ToString(", "))
                }
                                     );

                await Add(ViewButton = new ImageView
                {
                    Id        = "ViewButton",
                    CssClass  = "view-row",
                    Path      = "Images/Icons/Arrow-Right.png",
                    AutoFlash = true
                }

                          .On(x => x.Tapped, ViewButtonTapped));

                await SlideIn.Add(DeleteButton = new Button { Id = "DeleteButton", Text = "Delete", CssClass = "delete-button" }
                                  .On(x => x.Tapped, DeleteButtonTapped));
            }
        private void generarAlerta(string mensaje)
        {
            NotificationConfig config = new NotificationConfig();

            config.Title     = Core.Constantes.Generales.nickNameDeLaApp;
            config.Html      = mensaje;
            config.Height    = 75;
            config.Width     = 300;
            config.HideDelay = 10000;
            config.BodyStyle = "padding:10px";
            config.Icon      = Icon.UserAlert;
            config.PinEvent  = "mouseover";

            SlideIn show = new SlideIn();

            show.Anchor = AnchorPoint.Right;

            SlideOut hide = new SlideOut();

            show.Anchor = AnchorPoint.Right;

            config.ShowFx = show;
            config.HideFx = hide;
            X.Msg.Notify(config).Show();
        }
        public static async Task SlideIn(this VisualElement element, SlideIn direction = Editors.SlideIn.FromTop, uint linearLength = 250, uint springLength = 50, int springiness = 20)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element), "must not be null");
            }
            var springX = 0;
            var springY = 0;

            switch (direction)
            {
            case Editors.SlideIn.FromLeft:
                springX = springiness;
                springY = 0;
                break;

            case Editors.SlideIn.FromTop:
                springX = 0;
                springY = springiness;
                break;

            case Editors.SlideIn.FromRight:
                springX = -springiness;
                springY = 0;
                break;

            case Editors.SlideIn.FromBottom:
                springX = 0;
                springY = springiness;
                break;
            }

            await element.TranslateTo(0, 0, linearLength, Easing.Linear);

            await element.TranslateTo(springX, springY, springLength, Easing.CubicOut);

            await element.TranslateTo(0, 0, springLength, Easing.CubicIn);
        }
Esempio n. 8
0
 public MainPage()
 {
     this.InitializeComponent();
     SlideIn.Begin();
 }
Esempio n. 9
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     SlideIn.Begin();
 }