public async Task Apply(GalleyBaseView view, GalleySuperView superView) { var oldViewIndex = superView.Children.ToArray().IndexOf(superView.CurrentView); superView.InsertChildIfNeeded(0, view, !superView.IsAllowedMakingViewsInvisible); await superView.SetCurrentView(view, true); var newViewIndex = superView.Children.ToArray().IndexOf(superView.CurrentView); Task animationTask; if (newViewIndex > oldViewIndex) { view.Opacity = 0; view.IsVisible = true; animationTask = Task.Run(async() => await view.FadeTo(1, _time)); } else { view.Opacity = 1; view.IsVisible = true; animationTask = superView.GetOtherVisibleViews(view).EachAsync(async c => await c.FadeTo(0, _time), false); } await superView.ResetFloatingControls(view, animationTask); superView.SetSuperView(view); }
public GalleySuperPage(GalleySuperView superView, bool isAppHasSideMenu = false) { NavigationPage.SetHasNavigationBar(this, false); this.WithBinding(IsBusyProperty, nameof(GalleyBaseViewModel.IsBusy)); SuperView = superView; Content = isAppHasSideMenu ? GalleyApp.Current.ViewFactory.CreateSideScrollView(this) : (View)SuperView; }
public async Task Apply(GalleyBaseView view, GalleySuperView superView) { superView.InsertChildIfNeeded(0, view); await superView.SetCurrentView(view, true); await superView.ResetFloatingControls(view, superView.GetOtherVisibleViews(view) .EachAsync(async c => await c.LayoutTo(superView.Width, 0, superView.Width, superView.Height, _time))); superView.SetSuperView(view); }
public async Task Apply(GalleyBaseView view, GalleySuperView superView) { view.Opacity = 0; superView.Children.Add(view); view.Layout(superView.Width, superView.Height, superView.Width, superView.Height); view.Opacity = 1; await superView.ResetFloatingControls(view, view.LayoutTo(0, 0, superView.Width, superView.Height, 500, Easing.Linear)); await superView.SetCurrentView(view); superView.SetSuperView(view); }
public async Task AddToSuperView(GalleySuperView superView) { var opacity = Opacity; Opacity = 0; superView.Children.Add(this); this.Layout(200, superView.Height, 80, 80); Opacity = opacity; await this.LayoutTo(200, 400, 80, 80); this.WithAbsBounds(200, 400, 80, 80); }
public async Task Apply(GalleyBaseView view, GalleySuperView superView) { view.WidthRequest = superView.Width; view.HeightRequest = superView.Height; view.TranslationX = superView.Width; superView.InsertChildIfNeeded(superView.Children.Count, view); var pushTcs = new TaskCompletionSource <bool>(); new Animation((v) => view.TranslationX = v, superView.Width, 0) .Commit(view, "pushAnimation", 16, _time, Easing.Linear, async(v, b) => { await superView.SetCurrentView(view); superView.SetSuperView(view); pushTcs.SetResult(true); }); await superView.ResetFloatingControls(view, pushTcs.Task); }
public virtual GalleySuperPage CreateSuperPage(GalleySuperView view) => new GalleySuperPage(view);
public async Task AddControls(GalleySuperView superView) { await FloatingControls.EachAsync(v => v.AddToSuperView(superView), false); }
public async Task RemoveFromSuperView(GalleySuperView superView) { await this.LayoutTo(X, superView.Height, Width, Height); superView.Children.Remove(this); }