diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index 7abf7d6dd..4825654e1 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -156,6 +156,7 @@ + diff --git a/src/Android/Assets/bwi-font.ttf b/src/Android/Assets/bwi-font.ttf index 358fca186..7c7afd4cd 100644 Binary files a/src/Android/Assets/bwi-font.ttf and b/src/Android/Assets/bwi-font.ttf differ diff --git a/src/Android/Effects/RemoveFontPaddingEffect.cs b/src/Android/Effects/RemoveFontPaddingEffect.cs new file mode 100644 index 000000000..1f7cf1297 --- /dev/null +++ b/src/Android/Effects/RemoveFontPaddingEffect.cs @@ -0,0 +1,23 @@ +using Android.Widget; +using Bit.Droid.Effects; +using Xamarin.Forms; +using Xamarin.Forms.Platform.Android; + +[assembly: ExportEffect(typeof(RemoveFontPaddingEffect), nameof(RemoveFontPaddingEffect))] +namespace Bit.Droid.Effects +{ + public class RemoveFontPaddingEffect : PlatformEffect + { + protected override void OnAttached() + { + if (Control is TextView textView) + { + textView.SetIncludeFontPadding(false); + } + } + + protected override void OnDetached() + { + } + } +} \ No newline at end of file diff --git a/src/App/App.csproj b/src/App/App.csproj index 9305cd38c..c60580e2d 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -139,6 +139,7 @@ + @@ -430,5 +431,6 @@ + diff --git a/src/App/Controls/IconButton.cs b/src/App/Controls/IconButton.cs index e7f8cd787..64f44b023 100644 --- a/src/App/Controls/IconButton.cs +++ b/src/App/Controls/IconButton.cs @@ -1,4 +1,5 @@ -using Xamarin.Forms; +using Bit.App.Effects; +using Xamarin.Forms; namespace Bit.App.Controls { @@ -16,6 +17,8 @@ namespace Bit.App.Controls FontFamily = "bwi-font.ttf#bwi-font"; break; } + + Effects.Add(new RemoveFontPaddingEffect()); } } } diff --git a/src/App/Controls/IconLabel.cs b/src/App/Controls/IconLabel.cs index fce9159f6..ee21eb234 100644 --- a/src/App/Controls/IconLabel.cs +++ b/src/App/Controls/IconLabel.cs @@ -1,4 +1,5 @@ -using Xamarin.Forms; +using Bit.App.Effects; +using Xamarin.Forms; namespace Bit.App.Controls { @@ -17,6 +18,8 @@ namespace Bit.App.Controls FontFamily = "bwi-font.ttf#bwi-font"; break; } + + Effects.Add(new RemoveFontPaddingEffect()); } } } diff --git a/src/App/Controls/IconLabelButton/IconLabelButton.xaml b/src/App/Controls/IconLabelButton/IconLabelButton.xaml new file mode 100644 index 000000000..5b88dcd91 --- /dev/null +++ b/src/App/Controls/IconLabelButton/IconLabelButton.xaml @@ -0,0 +1,40 @@ + + + + + + + + + + + + diff --git a/src/App/Controls/IconLabelButton/IconLabelButton.xaml.cs b/src/App/Controls/IconLabelButton/IconLabelButton.xaml.cs new file mode 100644 index 000000000..ebd99360c --- /dev/null +++ b/src/App/Controls/IconLabelButton/IconLabelButton.xaml.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; +using Bit.Core.Models.Domain; +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace Bit.App.Controls +{ + public partial class IconLabelButton : Frame + { + public static readonly BindableProperty IconProperty = BindableProperty.Create( + nameof(Icon), typeof(string), typeof(IconLabelButton)); + + public static readonly BindableProperty LabelProperty = BindableProperty.Create( + nameof(Label), typeof(string), typeof(IconLabelButton)); + + public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create( + nameof(ButtonCommand), typeof(Command), typeof(IconLabelButton)); + + public static readonly BindableProperty IconLabelColorProperty = BindableProperty.Create( + nameof(IconLabelColor), typeof(Color), typeof(IconLabelButton), Color.White); + + public static readonly BindableProperty IconLabelBackgroundColorProperty = BindableProperty.Create( + nameof(IconLabelBackgroundColor), typeof(Color), typeof(IconLabelButton), Color.White); + + public static readonly BindableProperty IconLabelBorderColorProperty = BindableProperty.Create( + nameof(IconLabelBorderColor), typeof(Color), typeof(IconLabelButton), Color.White); + + public IconLabelButton() + { + InitializeComponent(); + } + + public string Icon + { + get => GetValue(IconProperty) as string; + set => SetValue(IconProperty, value); + } + + public string Label + { + get => GetValue(LabelProperty) as string; + set => SetValue(LabelProperty, value); + } + + public ICommand ButtonCommand + { + get => GetValue(ButtonCommandProperty) as ICommand; + set => SetValue(ButtonCommandProperty, value); + } + + public Color IconLabelColor + { + get { return (Color)GetValue(IconLabelColorProperty); } + set { SetValue(IconLabelColorProperty, value); } + } + + public Color IconLabelBackgroundColor + { + get { return (Color)GetValue(IconLabelBackgroundColorProperty); } + set { SetValue(IconLabelBackgroundColorProperty, value); } + } + + public Color IconLabelBorderColor + { + get { return (Color)GetValue(IconLabelBorderColorProperty); } + set { SetValue(IconLabelBorderColorProperty, value); } + } + } +} + diff --git a/src/App/Effects/RemoveFontPaddingEffect.cs b/src/App/Effects/RemoveFontPaddingEffect.cs new file mode 100644 index 000000000..56f1579f3 --- /dev/null +++ b/src/App/Effects/RemoveFontPaddingEffect.cs @@ -0,0 +1,13 @@ +using System; +using Xamarin.Forms; + +namespace Bit.App.Effects +{ + public class RemoveFontPaddingEffect : RoutingEffect + { + public RemoveFontPaddingEffect() + : base("Bitwarden.RemoveFontPaddingEffect") + { } + } +} + diff --git a/src/App/Pages/Accounts/HintPage.xaml.cs b/src/App/Pages/Accounts/HintPage.xaml.cs index b1f1d762a..0fe7cd6fe 100644 --- a/src/App/Pages/Accounts/HintPage.xaml.cs +++ b/src/App/Pages/Accounts/HintPage.xaml.cs @@ -6,11 +6,12 @@ namespace Bit.App.Pages { private HintPageViewModel _vm; - public HintPage() + public HintPage(string email = null) { InitializeComponent(); _vm = BindingContext as HintPageViewModel; _vm.Page = this; + _vm.Email = email; if (Device.RuntimePlatform == Device.Android) { ToolbarItems.RemoveAt(0); diff --git a/src/App/Pages/Accounts/HintPageViewModel.cs b/src/App/Pages/Accounts/HintPageViewModel.cs index 2e59f98c9..11e7890f6 100644 --- a/src/App/Pages/Accounts/HintPageViewModel.cs +++ b/src/App/Pages/Accounts/HintPageViewModel.cs @@ -15,6 +15,7 @@ namespace Bit.App.Pages private readonly IPlatformUtilsService _platformUtilsService; private readonly IApiService _apiService; private readonly ILogger _logger; + private string _email; public HintPageViewModel() { @@ -34,7 +35,12 @@ namespace Bit.App.Pages } public ICommand SubmitCommand { get; } - public string Email { get; set; } + + public string Email + { + get => _email; + set => SetProperty(ref _email, value); + } public async Task SubmitAsync() { diff --git a/src/App/Pages/Accounts/HomePage.xaml b/src/App/Pages/Accounts/HomePage.xaml index 8276861e1..40f631b28 100644 --- a/src/App/Pages/Accounts/HomePage.xaml +++ b/src/App/Pages/Accounts/HomePage.xaml @@ -24,6 +24,7 @@ UseOriginalImage="True" AutomationProperties.IsInAccessibleTree="True" AutomationProperties.Name="{u:I18n Account}" /> + - - - - - -