/// <summary> /// Transform the placeholder to title /// </summary> /// <returns></returns> async Task PlaceholderToTitle() { if (Animated) { await Task.WhenAll( PlaceholderLabel.TranslateTo( x: 0, y: BorderlessEntry.Y - PlaceholderLabel.Height, length: 100), PlaceholderLabel.SizeTo( startSize: PlaceholderLabel.FontSize, endSize: TITLE_FONT_SIZE, callback: (t) => PlaceholderLabel.FontSize = t, length: 100, easing: Easing.BounceIn), PlaceholderLabel.ColorTo( startColor: PlaceholderColor, endColor: TitleColor, callback: (c) => PlaceholderLabel.TextColor = c, length: 100), (PlaceholderToTitleAsync?.InvokeAsync(this, new EventArgs())) ?? Task.CompletedTask); } else { PlaceholderLabel.TranslationX = 0; PlaceholderLabel.TranslationY = BorderlessEntry.Y - PlaceholderLabel.Height; PlaceholderLabel.FontSize = TITLE_FONT_SIZE; } }
/// <summary> /// Transform the title to placeholder /// </summary> /// <returns></returns> async Task TitleToPlaceholder() { if (Animated) { await Task.WhenAll( PlaceholderLabel.TranslateTo( x: LabelStartX, y: 0, length: 100), PlaceholderLabel.SizeTo( startSize: PlaceholderLabel.FontSize, endSize: PLACEHOLDER_FONT_SIZE, callback: (t) => PlaceholderLabel.FontSize = t, length: 100, easing: Easing.BounceIn), PlaceholderLabel.ColorTo( startColor: TitleColor, endColor: PlaceholderColor, callback: (c) => PlaceholderLabel.TextColor = c, length: 100), (TitleToPlaceholderAsync?.InvokeAsync(this, new EventArgs())) ?? Task.CompletedTask); } else { PlaceholderLabel.TranslationX = 10; PlaceholderLabel.TranslationY = 0; PlaceholderLabel.FontSize = PLACEHOLDER_FONT_SIZE; Grid.Margin = new Thickness(0, 0, 0, 0); } }
async Task TitleToPlaceholder() { if (Animated) { await Task.WhenAll( PlaceholderLabel.TranslateTo(10, 0, 100), PlaceholderLabel.SizeTo(PlaceholderLabel.FontSize, PLACEHOLDER_FONT_SIZE, (t) => PlaceholderLabel.FontSize = t, 100, Easing.BounceIn), HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, 0, BottomBorder.Height), 200), PlaceholderLabel.ColorTo(ActiveTextColor, DefaultTextColor, (c) => PlaceholderLabel.TextColor = c, 100), Grid.MarginTo(Grid.Margin, new Thickness(0, 0, 0, 0), (m) => Grid.Margin = m, 100)); } else { PlaceholderLabel.TranslationX = 10; PlaceholderLabel.TranslationY = 0; PlaceholderLabel.FontSize = PLACEHOLDER_FONT_SIZE; HiddenBottomBorder.WidthRequest = 0; Grid.Margin = new Thickness(0, 0, 0, 0); } }
async Task PlaceholderToTitle() { if (Animated) { await Task.WhenAll( PlaceholderLabel.TranslateTo(0, BorderlessEntry.Y - PlaceholderLabel.Height, 100), PlaceholderLabel.SizeTo(PlaceholderLabel.FontSize, TITLE_FONT_SIZE, (t) => PlaceholderLabel.FontSize = t, 100, Easing.BounceIn), HiddenBottomBorder.LayoutTo(new Rectangle(BottomBorder.X, BottomBorder.Y, BottomBorder.Width, BottomBorder.Height), 200), PlaceholderLabel.ColorTo(DefaultTextColor, ActiveTextColor, (c) => PlaceholderLabel.TextColor = c, 100), Grid.MarginTo(Grid.Margin, new Thickness(0, 15, 0, 0), (m) => Grid.Margin = m, 100)); } else { PlaceholderLabel.TranslationX = 0; PlaceholderLabel.TranslationY = BorderlessEntry.Y - PlaceholderLabel.Height; PlaceholderLabel.FontSize = TITLE_FONT_SIZE; HiddenBottomBorder.WidthRequest = BottomBorder.Width; Grid.Margin = new Thickness(0, 15, 0, 0); } }