Пример #1
0
        public virtual void APIStateChanged(IAPIProvider api, APIState state)
        {
            switch (state)
            {
            case APIState.Offline:
                PopContentOut(Content);
                placeholder.ScaleTo(0.8f).Then().ScaleTo(1, 3 * transform_duration, Easing.OutQuint);
                placeholder.FadeInFromZero(2 * transform_duration, Easing.OutQuint);
                LoadingAnimation.Hide();
                break;

            case APIState.Online:
                PopContentIn(Content);
                placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
                LoadingAnimation.Hide();
                break;

            case APIState.Failing:
            case APIState.Connecting:
                PopContentOut(Content);
                LoadingAnimation.Show();
                placeholder.FadeOut(transform_duration / 2, Easing.OutQuint);
                break;
            }
        }
        async void UploadButton_Clicked(object sender, System.EventArgs e)
        {
            LoadingOverlay.IsVisible = true;
            LoadingAnimation.Play();

            // Upload photo
            var stream = pickedPhoto != null?pickedPhoto.GetStream() : new MemoryStream(photoResult.Image);

            var success = false; //await viewModel.UploadPhoto(stream, "");

            if (success)
            {
                PhotoPreview.Source = null;
                viewModel.Caption   = string.Empty;

                await Navigation.PopAsync();

                // Navigate back to categories page
                App.AppShell.SelectedItem = null; // Hack: Xamarin.Forms Bug does not allow the same navigation twice otherwise
                App.AppShell.SelectedItem = App.AppShell.Children.First();
            }

            LoadingOverlay.IsVisible   = false;
            LoadingAnimation.IsPlaying = false;
            LoadingAnimation.Pause();
        }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #4
0
        public SocialOverlay()
        {
            FirstWaveColour  = OsuColour.FromHex(@"cb5fa0");
            SecondWaveColour = OsuColour.FromHex(@"b04384");
            ThirdWaveColour  = OsuColour.FromHex(@"9b2b6e");
            FourthWaveColour = OsuColour.FromHex(@"6d214d");

            ScrollFlow.Children = new[]
            {
                new OsuContextMenuContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Child            = panelFlow = new FillFlowContainer <UserPanel>
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Margin           = new MarginPadding {
                            Top = 20
                        },
                        Spacing = new Vector2(10f),
                    }
                },
            };

            Add(loading = new LoadingAnimation());
        }
Пример #5
0
        async void UploadButton_Clicked(object sender, System.EventArgs e)
        {
            Analytics.TrackEvent("Upload Button Clicked");

            LoadingOverlay.IsVisible = true;
            LoadingAnimation.Play();

            // Upload photo
            var success = await viewModel.UploadPhoto(file.GetStream(), file.Path);

            if (success)
            {
                CameraControls.IsVisible = true;
                UploadControls.IsVisible = false;
                PhotoPreview.Source      = null;
                viewModel.Caption        = string.Empty;

                // Navigate back to categories page
                App.AppShell.SelectedItem = null; // Hack: Xamarin.Forms Bug does not allow the same navigation twice otherwise
                App.AppShell.SelectedItem = App.AppShell.Children.First();
            }

            LoadingOverlay.IsVisible   = false;
            LoadingAnimation.IsPlaying = false;
            LoadingAnimation.Pause();
        }
Пример #6
0
 // Load data for the ViewModel Items
 private void MainPage_Loaded(object sender, RoutedEventArgs e)
 {
     if (!App.ViewModel.IsDataLoaded)
     {
         App.ViewModel.LoadData();
         LoadingAnimation.Begin();
     }
 }
Пример #7
0
        public PaginatedContainer(Bindable <User> user, string header, string missing)
        {
            User.BindTo(user);

            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;
            Direction        = FillDirection.Vertical;

            Children = new Drawable[]
            {
                new OsuSpriteText
                {
                    TextSize = 15,
                    Text     = header,
                    Font     = "Exo2.0-RegularItalic",
                    Margin   = new MarginPadding {
                        Top = 10, Bottom = 10
                    },
                },
                ItemsContainer = new FillFlowContainer
                {
                    AutoSizeAxes     = Axes.Y,
                    RelativeSizeAxes = Axes.X,
                    Margin           = new MarginPadding {
                        Bottom = 10
                    }
                },
                ShowMoreButton = new OsuHoverContainer
                {
                    Alpha        = 0,
                    Action       = ShowMore,
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.TopCentre,
                    Origin       = Anchor.TopCentre,
                    Child        = new OsuSpriteText
                    {
                        TextSize = 14,
                        Text     = "show more",
                        Padding  = new MarginPadding {
                            Vertical = 10, Horizontal = 15
                        },
                    }
                },
                ShowMoreLoading = new LoadingAnimation
                {
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre,
                    Size   = new Vector2(14),
                },
                MissingText = new OsuSpriteText
                {
                    TextSize = 14,
                    Text     = missing,
                    Alpha    = 0,
                },
            };
        }
Пример #8
0
        public Login()
        {
            this.InitializeComponent();
            animation = new LoadingAnimation {
                HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
                VerticalAlignment   = System.Windows.VerticalAlignment.Stretch
            };

            // A partir de este punto se requiere la inserción de código para la creación del objeto.
        }
Пример #9
0
        public override void RemoveFromSuperview()
        {
            base.RemoveFromSuperview();

            _loader.RunAnimation = false;

            _loader.RemoveFromSuperview();

            _loader = null;
        }
Пример #10
0
            public LoadingBarView(float x = 0, float y = 75, int width = 320, int height = 6, UIColor baseColor = null)
            {
                loader = new LoadingAnimation(width, height, baseColor);

                Frame = new CGRect(x, y, width, height);

                Add(loader);
                ClipsToBounds = true;

                loader.Animate();
            }
Пример #11
0
        public LoadingStatusBarView(CGRect frame)
        {
            _loader = new LoadingAnimation(frame);

            Frame = frame;
            Add(_loader);
            ClipsToBounds = true;

            _loader.RunAnimation = true;
            _loader.Animate();
        }
Пример #12
0
 private bool CreateLoadAnimation(Grid gridName)
 {
     loadedControl = new LoadingAnimation();
     loadedControl.LoadAnimationElement.Height         = 70;
     loadedControl.LoadAnimationElement.Width          = 70;
     loadedControl.LoadAnimationElement.RingsThickness = 3;
     gridName.Children.Add(loadedControl);
     Grid.SetColumnSpan(loadedControl, 3);
     Grid.SetRowSpan(loadedControl, 2);
     return(loadedControl.StartAnimation());
 }
Пример #13
0
        public PaginatedScoreContainer(ScoreType type, Bindable <User> user, string header, bool includeWeight = false)
        {
            this.type          = type;
            this.includeWeight = includeWeight;
            this.user.BindTo(user);

            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;
            Direction        = FillDirection.Vertical;

            Children = new Drawable[]
            {
                new OsuSpriteText
                {
                    TextSize = 15,
                    Text     = header,
                    Font     = "Exo2.0-RegularItalic",
                    Margin   = new MarginPadding {
                        Top = 10, Bottom = 10
                    },
                },
                scoreContainer = new FillFlowContainer <DrawableScore>
                {
                    AutoSizeAxes     = Axes.Y,
                    RelativeSizeAxes = Axes.X,
                    Direction        = FillDirection.Vertical,
                },
                showMoreButton = new OsuHoverContainer
                {
                    Alpha        = 0,
                    Action       = showMore,
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.TopCentre,
                    Origin       = Anchor.TopCentre,
                    Child        = new OsuSpriteText
                    {
                        TextSize = 14,
                        Text     = "show more",
                    }
                },
                showMoreLoading = new LoadingAnimation
                {
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre,
                    Size   = new Vector2(14),
                },
                missing = new OsuSpriteText
                {
                    TextSize = 14,
                    Text     = type == ScoreType.Recent ? "No performance records. :(" : "No awesome performance records yet. :(",
                },
            };
        }
Пример #14
0
 public DimmedLoadingAnimation()
 {
     Children = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = Color4.Black.Opacity(0.5f),
         },
         loading = new LoadingAnimation(),
     };
 }
Пример #15
0
 private void load()
 {
     InternalChildren = new Drawable[]
     {
         Content,
         placeholder      = new LoginPlaceholder(placeholderMessage),
         LoadingAnimation = new LoadingAnimation
         {
             Alpha = 0,
         }
     };
 }
 IEnumerator PerformLoadingAnimation(LoadingAnimation lAnimation)
 {
     yield return new WaitForSeconds(lAnimation.StartTime);
     switch (lAnimation.Type)
     {
         case LoadingAnimation.LoadingAnimationType.Color:
             StartCoroutine("PerformColorLerp", lAnimation);
             break;
         case LoadingAnimation.LoadingAnimationType.Fill:
             StartCoroutine("PerformFill",lAnimation);
             break;
     }
 }
    IEnumerator PerformColorLerp(LoadingAnimation lAnimation)
    {
        float elapsedTime = 0;

        Color startingColor = new Color(lAnimation.Graphic.color.r,lAnimation.Graphic.color.g,lAnimation.Graphic.color.b,lAnimation.Graphic.color.a);

        while (elapsedTime < lAnimation.Duration)
        {
            lAnimation.Graphic.color = Color.Lerp(startingColor, lAnimation.TargetColor, (elapsedTime / lAnimation.Duration));
            elapsedTime += Time.deltaTime;
            yield return null;
        }
    }
        void ReleaseDesignerOutlets()
        {
            if (LoadingAnimation != null)
            {
                LoadingAnimation.Dispose();
                LoadingAnimation = null;
            }

            if (PhotoView != null)
            {
                PhotoView.Dispose();
                PhotoView = null;
            }
        }
Пример #19
0
        void ShowLoadingAnimation(bool show)
        {
            LoadingAnimation.SetHidden(!show);

            if (show)
            {
                LoadingAnimation.SetImage("loading_");
                LoadingAnimation.StartAnimating(new NSRange(0, 12), 2.0, Int32.MaxValue);
            }
            else
            {
                LoadingAnimation.StopAnimating();
            }
        }
Пример #20
0
    public override void DataLoaded()
    {
        if (Model.ClubsList.Length > 0 &&
            ScrollRect != null)
        {
            ScrollRect.Initialize(Model.ClubsList.ToList());
            LoadingAnimation.SetActive(false);
        }

        for (int i = 0; i < ScrollRect.ActiveElements.Count; i++)
        {
            HandleClubItemData(ScrollRect.ActiveElements[i]);
        }
    }
    IEnumerator PerformFill(LoadingAnimation lAnimation)
    {
        float elapsedTime = 0;
        Image img = (Image)lAnimation.Graphic;

        float startingFill = img.fillAmount;

        while (elapsedTime < lAnimation.Duration)
        {
            img.fillAmount = Mathf.Lerp(startingFill, lAnimation.TargetValue, (elapsedTime / lAnimation.Duration));
            elapsedTime += Time.deltaTime;
            yield return null;
        }
    }
Пример #22
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            LoadingAnimation loading = new LoadingAnimation();

            loading.VerticalAlignment   = VerticalAlignment.Center;
            loading.HorizontalAlignment = HorizontalAlignment.Left;
            root.Children.Add(loading);
            await Task.Run(() =>
            {
                AllCalculations();
            });

            root.Children.Remove(loading);
        }
Пример #23
0
        public SettingsPage(MainWindow mainWindow)
        {
            InitializeComponent();
            _mWindow      = mainWindow;
            loadedControl = new LoadingAnimation();
            MainSheldueGrid.Children.Add(loadedControl);
            loadedControl.StartAnimation();
            _mWindow.KindThrowMessage.Foreground = FindResource("WarningForegroundColorUIElements") as SolidColorBrush;
            _mWindow.KindThrowMessage.Kind       = MaterialDesignThemes.Wpf.PackIconKind.WarningOutline;
            _mWindow.TextBlockMessageThrow.Text  = "Изменение к расписанию загружается! Не закрывайте программу!";
            Storyboard sb = _mWindow.FindResource("ShowMessageThrowGrid") as Storyboard;

            sb.Begin();
            Task.Run(() => this.Dispatcher.BeginInvoke((ThreadStart) delegate() { LoadSheldueAsyncMethod(); }));
        }
Пример #24
0
    public override void DataLoaded()
    {
        if (Model.playerData != null &&
            Model.playerData.pictureUrl != "")
        {
            DataManager.Instance.GetSpriteByUrl(Model.playerData.pictureUrl,
                                                (image) => { playerImage.sprite = image; });
            playerName.text = Model.playerData.username;
        }

        if (ApiManager.Instance.IsConnected)
        {
            LoadingAnimation.SetActive(false);
        }
    }
Пример #25
0
        public TestCaseLoadingAnimation()
            : base(2, 2)
        {
            LoadingAnimation loading;

            Cell(0).AddRange(new Drawable[]
            {
                new Box
                {
                    Colour           = Color4.Black,
                    RelativeSizeAxes = Axes.Both
                },
                loading = new LoadingAnimation()
            });

            loading.Show();

            Cell(1).AddRange(new Drawable[]
            {
                new Box
                {
                    Colour           = Color4.White,
                    RelativeSizeAxes = Axes.Both
                },
                loading = new LoadingAnimation()
            });

            loading.Show();

            Cell(2).AddRange(new Drawable[]
            {
                new Box
                {
                    Colour           = Color4.Gray,
                    RelativeSizeAxes = Axes.Both
                },
                loading = new LoadingAnimation()
            });

            loading.Show();

            Cell(3).AddRange(new Drawable[]
            {
                loading = new LoadingAnimation()
            });

            Scheduler.AddDelayed(() => loading.ToggleVisibility(), 200, true);
        }
Пример #26
0
        public LoginWindow()
        {
            InitializeComponent();

            loginWaiting = new LoadingAnimation(canvasLoginWaiting);

            try
            {
                GameClient.Instance.Start();
                GameClient.Instance.LoginEvent += OnLoginResponse;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Пример #27
0
 public void STOP_LOAD(LoadingAnimation loading)
 {
     try
     {
         if (!Dispatcher.CheckAccess()) // 컨트롤 요청이 들어올 경우
         {                              // 델리게이트를 이용해 STOP_LOAD 메서드를 다시 호출
             STOP_LOADING d = new STOP_LOADING(STOP_LOAD);
             Dispatcher.Invoke(d, new object[] { loading });
         }
         else
         {   // 컨트롤 접근이 가능할 경우, 다음 구문 처리
             loadingBar.Visibility = Visibility.Collapsed;
         }
     }
     catch { } // 멀티 스레드 환경에서 뜻하지 않은 예외가 발생할 경우 처리
 }
Пример #28
0
 private void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "IsDataLoaded")
     {
         if (App.ViewModel.IsDataLoaded == true)
         {
             LoadingEndedAnimation.Begin();
             SystemTray.ProgressIndicator.IsVisible = false;
         }
         else
         {
             LoadingAnimation.Begin();
             SystemTray.ProgressIndicator.IsVisible = true;
         }
     }
 }
Пример #29
0
        public SocialOverlay()
        {
            FirstWaveColour  = OsuColour.FromHex(@"cb5fa0");
            SecondWaveColour = OsuColour.FromHex(@"b04384");
            ThirdWaveColour  = OsuColour.FromHex(@"9b2b6e");
            FourthWaveColour = OsuColour.FromHex(@"6d214d");

            Add(loading = new LoadingAnimation());

            Filter.Search.Current.ValueChanged += text =>
            {
                if (!string.IsNullOrEmpty(text))
                {
                    // force searching in players until searching for friends is supported
                    Header.Tabs.Current.Value = SocialTab.AllPlayers;

                    if (Filter.Tabs.Current.Value != SocialSortCriteria.Rank)
                    {
                        Filter.Tabs.Current.Value = SocialSortCriteria.Rank;
                    }
                }
            };

            Header.Tabs.Current.ValueChanged += tab => Scheduler.AddOnce(updateSearch);

            Filter.Tabs.Current.ValueChanged += sortCriteria => Scheduler.AddOnce(updateSearch);

            Filter.DisplayStyleControl.DisplayStyle.ValueChanged     += recreatePanels;
            Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += sortOrder => Scheduler.AddOnce(updateSearch);

            currentQuery.ValueChanged += query =>
            {
                queryChangedDebounce?.Cancel();

                if (string.IsNullOrEmpty(query))
                {
                    Scheduler.AddOnce(updateSearch);
                }
                else
                {
                    queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500);
                }
            };

            currentQuery.BindTo(Filter.Search.Current);
        }
Пример #30
0
    private IEnumerator Radial(float from, float to, float animDuration)
    {
        float i           = 0f;
        float currentTime = 0f;

        while (i <= 1f)
        {
            currentTime          += Time.deltaTime;
            i                     = currentTime / animDuration;
            this.image.fillAmount = LoadingAnimation.EaseInOutSine(from, to, i);
            yield return(0);
        }
        this.image.fillAmount = to;
        yield return(null);

        yield break;
    }
Пример #31
0
        public HomePage(MainWindow mWindow)
        {
            InitializeComponent();
            _mWindow = mWindow;

            ReferenseDALClass refClassDAL = new ReferenseDALClass();

            loadedControl = new LoadingAnimation();
            MainSheldueGrid.Children.Add(loadedControl);
            loadedControl.StartAnimation();
            allSheldueList = _mWindow.GetSheldue;
            if (allSheldueList == null)
            {
                userNotes = new List <UserNotes>(refClassDAL.SetConnectionDBSelectAll(_mWindow._userInfo.ID));
                _mWindow.KindThrowMessage.Foreground = FindResource("WarningForegroundColorUIElements") as SolidColorBrush;
                _mWindow.KindThrowMessage.Kind       = MaterialDesignThemes.Wpf.PackIconKind.WarningOutline;
                _mWindow.TextBlockMessageThrow.Text  = "Расписание загружается! Не закрывайте программу!";
                Storyboard sb = _mWindow.FindResource("ShowMessageThrowGrid") as Storyboard;
                sb.Begin();
                _mWindow.IsEnabled = false;
                switch (_mWindow._userInfo.Status)
                {
                case teacher:
                    Task.Run(() => this.Dispatcher.BeginInvoke((ThreadStart) delegate() { LoadSheldueAsyncMethod(false); }));
                    break;

                case student:
                    Task.Run(() => this.Dispatcher.BeginInvoke((ThreadStart) delegate() { LoadSheldueAsyncMethod(true); }));
                    break;
                }
            }
            else
            {
                ListViewSheldueDay.ItemsSource = allSheldueList;
                StopAnimation.Tick            += new EventHandler(StopMethodAnimation);
                StopAnimation.Interval         = new TimeSpan(0, 0, 1);
                StopAnimation.Start();
            }
            DateTime firstDate = GetFirstDateOfWeek(DayOfWeek.Monday);
            var      lastDate  = GetLastDateOfWeek(DayOfWeek.Saturday);

            GetListDateOfWeek(firstDate, lastDate);
            refClassDAL.SetConnectionDBDeleteNote(listDate[0]);
        }
 private void StartOrStop(bool start)
 {
     if (start)
     {
         LockUi(true);
         _currentPercentage   = 0;
         labelPercentage.Text = "";
         _stopwatch.Reset();
         labelPercentage.Refresh();
         _stopwatch.Start();
         LoadingAnimation.Start(advancedDataGridView);
     }
     else
     {
         LoadingAnimation.End(advancedDataGridView);
         LockUi(false);
         _stopwatch.Stop();
     }
 }
Пример #33
0
        public PreviewButton()
        {
            Height = 42;

            Children = new Drawable[]
            {
                audioWrapper = new Container(),
                bg           = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Black.Opacity(0.25f),
                },
                new Container
                {
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    Height           = 3,
                    Child            = progress = new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Width            = 0f,
                        Alpha            = 0f,
                    },
                },
                icon = new SpriteIcon
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Icon   = FontAwesome.fa_play,
                    Size   = new Vector2(18),
                    Shadow = false,
                },
                loadingAnimation = new LoadingAnimation
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                },
            };

            Action = () => Playing = !Playing;
        }
Пример #34
0
 public ScoresContainer()
 {
     RelativeSizeAxes = Axes.X;
     AutoSizeAxes     = Axes.Y;
     Children         = new Drawable[]
     {
         new FillFlowContainer
         {
             Anchor           = Anchor.TopCentre,
             Origin           = Anchor.TopCentre,
             RelativeSizeAxes = Axes.X,
             AutoSizeAxes     = Axes.Y,
             Width            = 0.95f,
             Direction        = FillDirection.Vertical,
             Spacing          = new Vector2(0, spacing),
             Margin           = new MarginPadding {
                 Vertical = spacing
             },
             Children = new Drawable[]
             {
                 topScore = new DrawableTopScore(),
                 flow     = new FillFlowContainer
                 {
                     RelativeSizeAxes = Axes.X,
                     AutoSizeAxes     = Axes.Y,
                     Direction        = FillDirection.Vertical,
                     Spacing          = new Vector2(0, 1),
                 },
             }
         },
         foreground = new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = Color4.Black.Opacity(0.7f),
             Alpha            = 0,
         },
         loadingAnimation = new LoadingAnimation
         {
             Alpha = 0,
         },
     };
 }
        public RegistrationWindow()
        {
            InitializeComponent();

            registrationAnimation = new LoadingAnimation(canvasRegistration);
        }
 public void Animate(LoadingAnimation lAnimation)
 {
     StartCoroutine("PerformLoadingAnimation", lAnimation);
 }