protected override void OnAppearing() { base.OnAppearing(); _loginButton.Clicked += HandleLoginButtonClicked; _newUserSignUpButton.Clicked += HandleNewUserSignUpButtonClicked; _forgotPasswordButton.Clicked += async(object sender, EventArgs e) => await ForgotPassword(); if (string.IsNullOrEmpty(LogoFileImageSource)) { throw new Exception("You must set the LogoFileImageSource property to specify the logo"); } _logo.Source = LogoFileImageSource; List <Task> animationTaskList; if (!_isInitialized) { Device.BeginInvokeOnMainThread(async() => { await Task.Delay(500); await _logo?.TranslateTo(0, -MainLayout.Height * 0.3 - 10, 250); await _logo?.TranslateTo(0, -MainLayout.Height * 0.3 + 5, 100); await _logo?.TranslateTo(0, -MainLayout.Height * 0.3, 50); await _logo?.TranslateTo(0, -200 + 5, 100); await _logo?.TranslateTo(0, -200, 50); var logoSloginAnimationTask = _logoSlogan?.FadeTo(1, 5); var newUserSignUpButtonAnimationTask = _newUserSignUpButton?.FadeTo(1, 250); var forgotPasswordButtonAnimationTask = _forgotPasswordButton?.FadeTo(1, 250); var loginEntryAnimationTask = _loginEntry?.FadeTo(1, 250); var passwordEntryAnimationTask = _passwordEntry?.FadeTo(1, 250); var loginButtonAnimationTask = _loginButton?.FadeTo(1, 249); animationTaskList = new List <Task> { logoSloginAnimationTask, newUserSignUpButtonAnimationTask, forgotPasswordButtonAnimationTask, loginEntryAnimationTask, passwordEntryAnimationTask, loginButtonAnimationTask }; await Task.WhenAll(animationTaskList); _isInitialized = true; await RunAfterAnimation(); }); } }
protected override void OnAppearing() { base.OnAppearing(); if (String.IsNullOrEmpty(LogoFileImageSource)) { throw new Exception("You must set the LogoFileImageSource property to specify the logo"); } logo.Source = LogoFileImageSource; List <Task> animationTaskList; if (!isInitialized) { Device.BeginInvokeOnMainThread(async() => { await Task.Delay(500); await logo?.TranslateTo(0, -MainLayout.Height * 0.3 - 10, 250); await logo?.TranslateTo(0, -MainLayout.Height * 0.3 + 5, 100); await logo?.TranslateTo(0, -MainLayout.Height * 0.3, 50); await logo?.TranslateTo(0, -200 + 5, 100); await logo?.TranslateTo(0, -200, 50); var logoSloginAnimationTask = logoSlogan?.FadeTo(1, 5); var newUserSignUpButtonAnimationTask = newUserSignUpButton?.FadeTo(1, 250); var forgotPasswordButtonAnimationTask = forgotPasswordButton?.FadeTo(1, 250); var loginEntryAnimationTask = loginEntry?.FadeTo(1, 250); var passwordEntryAnimationTask = passwordEntry?.FadeTo(1, 250); var saveUsernameAnimationTask = saveUsername?.FadeTo(1, 250); var rememberMeAnimationTask = rememberMe?.FadeTo(1, 250); var loginButtonAnimationTask = loginButton?.FadeTo(1, 249); animationTaskList = new List <Task> { logoSloginAnimationTask, newUserSignUpButtonAnimationTask, forgotPasswordButtonAnimationTask, loginEntryAnimationTask, passwordEntryAnimationTask, saveUsernameAnimationTask, rememberMeAnimationTask, loginButtonAnimationTask }; await Task.WhenAll(animationTaskList); isInitialized = true; RunAfterAnimation(); }); } }
void AnimateLoginPage() { Device.BeginInvokeOnMainThread(async() => { await Task.Delay(500); await _logo?.TranslateTo(0, -_relativeLayout.Height * 0.3 - 10, 250); await _logo?.TranslateTo(0, -_relativeLayout.Height * 0.3 + 5, 100); await _logo?.TranslateTo(0, -_relativeLayout.Height * 0.3, 50); await _logo?.TranslateTo(0, -200 + 5, 100); await _logo?.TranslateTo(0, -200, 50); await Task.WhenAll(_logoSlogan?.FadeTo(1, 5), _newUserSignUpButton?.FadeTo(1, 250), _usernameEntry?.FadeTo(1, 250), _passwordEntry?.FadeTo(1, 250), _loginButton?.FadeTo(1, 249), _HomeAutomationButton?.FadeTo(1, 249)); }); }