diff --git a/src/Android/MainActivity.cs b/src/Android/MainActivity.cs index 35915da0b..e23e2433f 100644 --- a/src/Android/MainActivity.cs +++ b/src/Android/MainActivity.cs @@ -24,6 +24,7 @@ namespace Bit.Android base.OnCreate(bundle); Console.WriteLine("A OnCreate"); + HockeyApp.Android.CrashManager.Register(this); global::Xamarin.Forms.Forms.Init(this, bundle); LoadApplication(new App.App( diff --git a/src/Android/Properties/AndroidManifest.xml b/src/Android/Properties/AndroidManifest.xml index 108743583..5597fa5a8 100644 --- a/src/Android/Properties/AndroidManifest.xml +++ b/src/Android/Properties/AndroidManifest.xml @@ -1,12 +1,12 @@  - + - + \ No newline at end of file diff --git a/src/Android/Properties/AssemblyInfo.cs b/src/Android/Properties/AssemblyInfo.cs index 079abf04d..f7a7e13bb 100644 --- a/src/Android/Properties/AssemblyInfo.cs +++ b/src/Android/Properties/AssemblyInfo.cs @@ -15,6 +15,7 @@ using Android.App; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] +[assembly: MetaData("net.hockeyapp.android.appIdentifier", Value = "d3834185b4a643479047b86c65293d42")] // Version information for an assembly consists of the following four values: // diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index e7cb51d18..89d954a02 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -1310,32 +1310,32 @@ namespace Bit.Android public partial class Color { - // aapt resource value: 0x7f0a0069 - public const int abc_background_cache_hint_selector_material_dark = 2131361897; - // aapt resource value: 0x7f0a006a - public const int abc_background_cache_hint_selector_material_light = 2131361898; + public const int abc_background_cache_hint_selector_material_dark = 2131361898; // aapt resource value: 0x7f0a006b - public const int abc_color_highlight_material = 2131361899; + public const int abc_background_cache_hint_selector_material_light = 2131361899; + + // aapt resource value: 0x7f0a006c + public const int abc_color_highlight_material = 2131361900; // aapt resource value: 0x7f0a0015 public const int abc_input_method_navigation_guard = 2131361813; - // aapt resource value: 0x7f0a006c - public const int abc_primary_text_disable_only_material_dark = 2131361900; - // aapt resource value: 0x7f0a006d - public const int abc_primary_text_disable_only_material_light = 2131361901; + public const int abc_primary_text_disable_only_material_dark = 2131361901; // aapt resource value: 0x7f0a006e - public const int abc_primary_text_material_dark = 2131361902; + public const int abc_primary_text_disable_only_material_light = 2131361902; // aapt resource value: 0x7f0a006f - public const int abc_primary_text_material_light = 2131361903; + public const int abc_primary_text_material_dark = 2131361903; // aapt resource value: 0x7f0a0070 - public const int abc_search_url_text = 2131361904; + public const int abc_primary_text_material_light = 2131361904; + + // aapt resource value: 0x7f0a0071 + public const int abc_search_url_text = 2131361905; // aapt resource value: 0x7f0a0016 public const int abc_search_url_text_normal = 2131361814; @@ -1346,14 +1346,14 @@ namespace Bit.Android // aapt resource value: 0x7f0a0018 public const int abc_search_url_text_selected = 2131361816; - // aapt resource value: 0x7f0a0071 - public const int abc_secondary_text_material_dark = 2131361905; - // aapt resource value: 0x7f0a0072 - public const int abc_secondary_text_material_light = 2131361906; + public const int abc_secondary_text_material_dark = 2131361906; - // aapt resource value: 0x7f0a0068 - public const int accent = 2131361896; + // aapt resource value: 0x7f0a0073 + public const int abc_secondary_text_material_light = 2131361907; + + // aapt resource value: 0x7f0a0069 + public const int accent = 2131361897; // aapt resource value: 0x7f0a0019 public const int accent_material_dark = 2131361817; @@ -1373,6 +1373,9 @@ namespace Bit.Android // aapt resource value: 0x7f0a001e public const int background_material_light = 2131361822; + // aapt resource value: 0x7f0a0064 + public const int black = 2131361892; + // aapt resource value: 0x7f0a001f public const int bright_foreground_disabled_material_dark = 2131361823; @@ -1412,8 +1415,8 @@ namespace Bit.Android // aapt resource value: 0x7f0a0008 public const int common_action_bar_splitter = 2131361800; - // aapt resource value: 0x7f0a0073 - public const int common_google_signin_btn_text_dark = 2131361907; + // aapt resource value: 0x7f0a0074 + public const int common_google_signin_btn_text_dark = 2131361908; // aapt resource value: 0x7f0a0009 public const int common_google_signin_btn_text_dark_default = 2131361801; @@ -1427,8 +1430,8 @@ namespace Bit.Android // aapt resource value: 0x7f0a000a public const int common_google_signin_btn_text_dark_pressed = 2131361802; - // aapt resource value: 0x7f0a0074 - public const int common_google_signin_btn_text_light = 2131361908; + // aapt resource value: 0x7f0a0075 + public const int common_google_signin_btn_text_light = 2131361909; // aapt resource value: 0x7f0a000d public const int common_google_signin_btn_text_light_default = 2131361805; @@ -1442,8 +1445,8 @@ namespace Bit.Android // aapt resource value: 0x7f0a000e public const int common_google_signin_btn_text_light_pressed = 2131361806; - // aapt resource value: 0x7f0a0075 - public const int common_plus_signin_btn_text_dark = 2131361909; + // aapt resource value: 0x7f0a0076 + public const int common_plus_signin_btn_text_dark = 2131361910; // aapt resource value: 0x7f0a0000 public const int common_plus_signin_btn_text_dark_default = 2131361792; @@ -1457,8 +1460,8 @@ namespace Bit.Android // aapt resource value: 0x7f0a0001 public const int common_plus_signin_btn_text_dark_pressed = 2131361793; - // aapt resource value: 0x7f0a0076 - public const int common_plus_signin_btn_text_light = 2131361910; + // aapt resource value: 0x7f0a0077 + public const int common_plus_signin_btn_text_light = 2131361911; // aapt resource value: 0x7f0a0004 public const int common_plus_signin_btn_text_light_default = 2131361796; @@ -1472,8 +1475,8 @@ namespace Bit.Android // aapt resource value: 0x7f0a0005 public const int common_plus_signin_btn_text_light_pressed = 2131361797; - // aapt resource value: 0x7f0a0064 - public const int darkgray = 2131361892; + // aapt resource value: 0x7f0a0065 + public const int darkgray = 2131361893; // aapt resource value: 0x7f0a004f public const int design_fab_shadow_end_color = 2131361871; @@ -1523,8 +1526,8 @@ namespace Bit.Android // aapt resource value: 0x7f0a002c public const int foreground_material_light = 2131361836; - // aapt resource value: 0x7f0a0065 - public const int gray = 2131361893; + // aapt resource value: 0x7f0a0066 + public const int gray = 2131361894; // aapt resource value: 0x7f0a002d public const int highlighted_text_material_dark = 2131361837; @@ -1568,8 +1571,8 @@ namespace Bit.Android // aapt resource value: 0x7f0a0062 public const int hockeyapp_text_white = 2131361890; - // aapt resource value: 0x7f0a0066 - public const int lightgray = 2131361894; + // aapt resource value: 0x7f0a0067 + public const int lightgray = 2131361895; // aapt resource value: 0x7f0a0031 public const int material_blue_grey_800 = 2131361841; @@ -1607,8 +1610,8 @@ namespace Bit.Android // aapt resource value: 0x7f0a003c public const int material_grey_900 = 2131361852; - // aapt resource value: 0x7f0a0067 - public const int primary = 2131361895; + // aapt resource value: 0x7f0a0068 + public const int primary = 2131361896; // aapt resource value: 0x7f0a003d public const int primary_dark_material_dark = 2131361853; @@ -1658,11 +1661,11 @@ namespace Bit.Android // aapt resource value: 0x7f0a004c public const int switch_thumb_disabled_material_light = 2131361868; - // aapt resource value: 0x7f0a0077 - public const int switch_thumb_material_dark = 2131361911; - // aapt resource value: 0x7f0a0078 - public const int switch_thumb_material_light = 2131361912; + public const int switch_thumb_material_dark = 2131361912; + + // aapt resource value: 0x7f0a0079 + public const int switch_thumb_material_light = 2131361913; // aapt resource value: 0x7f0a004d public const int switch_thumb_normal_material_dark = 2131361869; diff --git a/src/Android/Resources/values-v21/styles.xml b/src/Android/Resources/values-v21/styles.xml index 7c675d03d..a0cca8e0b 100644 --- a/src/Android/Resources/values-v21/styles.xml +++ b/src/Android/Resources/values-v21/styles.xml @@ -1,9 +1,9 @@  - + diff --git a/src/Android/Resources/values/colors.xml b/src/Android/Resources/values/colors.xml index 29de0f436..60c7776e0 100644 --- a/src/Android/Resources/values/colors.xml +++ b/src/Android/Resources/values/colors.xml @@ -1,9 +1,10 @@  - #FFFFFF - #333333 - #738182 - #efeff4 - #222d32 - #3c8dbc + #FFFFFF + #000000 + #333333 + #738182 + #efeff4 + #222d32 + #3c8dbc diff --git a/src/Android/Resources/values/styles.xml b/src/Android/Resources/values/styles.xml index 72d59efda..c309667b8 100644 --- a/src/Android/Resources/values/styles.xml +++ b/src/Android/Resources/values/styles.xml @@ -1,9 +1,9 @@  - + diff --git a/src/App/Controls/ExtendedEntry.cs b/src/App/Controls/ExtendedEntry.cs index 55ccdd7be..bc93961d5 100644 --- a/src/App/Controls/ExtendedEntry.cs +++ b/src/App/Controls/ExtendedEntry.cs @@ -6,6 +6,14 @@ namespace Bit.App.Controls { public class ExtendedEntry : Entry { + public ExtendedEntry() + { + if(Device.OS == TargetPlatform.Android) + { + PlaceholderColor = Color.FromHex("c7c7cd"); + } + } + public static readonly BindableProperty HasBorderProperty = BindableProperty.Create(nameof(HasBorder), typeof(bool), typeof(ExtendedEntry), true); diff --git a/src/App/Controls/ExtendedTextCell.cs b/src/App/Controls/ExtendedTextCell.cs index 34fb2467f..d2192b813 100644 --- a/src/App/Controls/ExtendedTextCell.cs +++ b/src/App/Controls/ExtendedTextCell.cs @@ -7,6 +7,11 @@ namespace Bit.App.Controls { public ExtendedTextCell() { + if(Device.OS == TargetPlatform.Android) + { + TextColor = Color.Black; + } + DetailColor = Color.FromHex("777777"); } @@ -41,7 +46,13 @@ namespace Bit.App.Controls public void OnDisclousureTapped() { - DisclousureTapped?.Invoke(this, EventArgs.Empty); + if(DisclousureTapped == null) + { + OnTapped(); + return; + } + + DisclousureTapped.Invoke(this, EventArgs.Empty); } } } diff --git a/src/App/Controls/FormEntryCell.cs b/src/App/Controls/FormEntryCell.cs index e7c5c731a..b1c6c15ac 100644 --- a/src/App/Controls/FormEntryCell.cs +++ b/src/App/Controls/FormEntryCell.cs @@ -24,6 +24,11 @@ namespace Bit.App.Controls Style = (Style)Application.Current.Resources["text-muted"], HorizontalOptions = LayoutOptions.FillAndExpand }; + + if(Device.OS == TargetPlatform.Android) + { + Label.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)); + } } Entry = new ExtendedEntry @@ -36,6 +41,12 @@ namespace Bit.App.Controls HorizontalOptions = LayoutOptions.FillAndExpand }; + if(Device.OS == TargetPlatform.Android) + { + Entry.FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)); + Entry.TextColor = Color.Black; + } + if(useLabelAsPlaceholder) { Entry.Placeholder = labelText; diff --git a/src/App/Controls/LabeledDetailCell.cs b/src/App/Controls/LabeledDetailCell.cs index d5e770c96..355cd11bf 100644 --- a/src/App/Controls/LabeledDetailCell.cs +++ b/src/App/Controls/LabeledDetailCell.cs @@ -8,7 +8,6 @@ namespace Bit.App.Controls { Label = new Label { - VerticalOptions = LayoutOptions.CenterAndExpand, LineBreakMode = LineBreakMode.TailTruncation }; @@ -16,14 +15,13 @@ namespace Bit.App.Controls { FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), LineBreakMode = LineBreakMode.TailTruncation, - VerticalOptions = LayoutOptions.End, - Style = (Style)Application.Current.Resources["text-muted"], + Style = (Style)Application.Current.Resources["text-muted"] }; var labelDetailStackLayout = new StackLayout { HorizontalOptions = LayoutOptions.StartAndExpand, - VerticalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.CenterAndExpand, Children = { Label, Detail }, Padding = new Thickness(15, 5, 5, 5), Spacing = 0 @@ -32,7 +30,7 @@ namespace Bit.App.Controls Button = new Button { HorizontalOptions = LayoutOptions.End, - VerticalOptions = LayoutOptions.FillAndExpand, + VerticalOptions = LayoutOptions.CenterAndExpand, WidthRequest = 50 }; @@ -42,6 +40,12 @@ namespace Bit.App.Controls Children = { labelDetailStackLayout, Button } }; + if(Device.OS == TargetPlatform.Android) + { + Label.TextColor = Color.Black; + Detail.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)); + } + View = containerStackLayout; } diff --git a/src/App/Pages/Lock/LockPasswordPage.cs b/src/App/Pages/Lock/LockPasswordPage.cs index 4c4809e4c..9a166778e 100644 --- a/src/App/Pages/Lock/LockPasswordPage.cs +++ b/src/App/Pages/Lock/LockPasswordPage.cs @@ -49,7 +49,7 @@ namespace Bit.App.Pages NoFooter = true, Root = new TableRoot { - new TableSection() + new TableSection { PasswordCell } diff --git a/src/App/Pages/LoginPage.cs b/src/App/Pages/LoginPage.cs index daeaf4f66..063fc9deb 100644 --- a/src/App/Pages/LoginPage.cs +++ b/src/App/Pages/LoginPage.cs @@ -48,7 +48,10 @@ namespace Bit.App.Pages { MessagingCenter.Send(Application.Current, "ShowStatusBar", true); - var padding = new Thickness(15, 20); + var padding = Device.OnPlatform( + iOS: new Thickness(15, 20), + Android: new Thickness(15, 8), + WinPhone: new Thickness(15, 20)); PasswordCell = new FormEntryCell(AppResources.MasterPassword, IsPassword: true, useLabelAsPlaceholder: true, imageSource: "lock", containerPadding: padding); @@ -166,11 +169,13 @@ namespace Bit.App.Pages return; } - var key = _cryptoService.MakeKeyFromPassword(PasswordCell.Entry.Text, EmailCell.Entry.Text); + var normalizedEmail = EmailCell.Entry.Text.ToLower(); + + var key = _cryptoService.MakeKeyFromPassword(PasswordCell.Entry.Text, normalizedEmail); var request = new TokenRequest { - Email = EmailCell.Entry.Text, + Email = normalizedEmail, MasterPasswordHash = _cryptoService.HashPasswordBase64(key, PasswordCell.Entry.Text), Device = new DeviceRequest(_appIdService, _deviceInfo) }; diff --git a/src/App/Pages/LoginTwoFactorPage.cs b/src/App/Pages/LoginTwoFactorPage.cs index e1fc0717b..e9c9cb8d8 100644 --- a/src/App/Pages/LoginTwoFactorPage.cs +++ b/src/App/Pages/LoginTwoFactorPage.cs @@ -38,8 +38,13 @@ namespace Bit.App.Pages private void Init() { + var padding = Device.OnPlatform( + iOS: new Thickness(15, 20), + Android: new Thickness(15, 8), + WinPhone: new Thickness(15, 20)); + CodeCell = new FormEntryCell("Verification Code", useLabelAsPlaceholder: true, - imageSource: "lock", containerPadding: new Thickness(15, 20)); + imageSource: "lock", containerPadding: padding); CodeCell.Entry.Keyboard = Keyboard.Numeric; CodeCell.Entry.ReturnType = Enums.ReturnType.Go; diff --git a/src/App/Pages/PasswordHintPage.cs b/src/App/Pages/PasswordHintPage.cs index 35bde30aa..8058fbf20 100644 --- a/src/App/Pages/PasswordHintPage.cs +++ b/src/App/Pages/PasswordHintPage.cs @@ -30,8 +30,13 @@ namespace Bit.App.Pages private void Init() { + var padding = Device.OnPlatform( + iOS: new Thickness(15, 20), + Android: new Thickness(15, 8), + WinPhone: new Thickness(15, 20)); + EmailCell = new FormEntryCell(AppResources.EmailAddress, entryKeyboard: Keyboard.Email, - useLabelAsPlaceholder: true, imageSource: "envelope", containerPadding: new Thickness(15, 20)); + useLabelAsPlaceholder: true, imageSource: "envelope", containerPadding: padding); EmailCell.Entry.ReturnType = Enums.ReturnType.Go; EmailCell.Entry.Completed += Entry_Completed; diff --git a/src/App/Pages/RegisterPage.cs b/src/App/Pages/RegisterPage.cs index cb1d18d70..ba67a7236 100644 --- a/src/App/Pages/RegisterPage.cs +++ b/src/App/Pages/RegisterPage.cs @@ -40,7 +40,10 @@ namespace Bit.App.Pages { MessagingCenter.Send(Application.Current, "ShowStatusBar", true); - var padding = new Thickness(15, 20); + var padding = Device.OnPlatform( + iOS: new Thickness(15, 20), + Android: new Thickness(15, 8), + WinPhone: new Thickness(15, 20)); PasswordHintCell = new FormEntryCell("Master Password Hint (optional)", useLabelAsPlaceholder: true, imageSource: "lightbulb", containerPadding: padding); @@ -169,10 +172,11 @@ namespace Bit.App.Pages return; } - var key = _cryptoService.MakeKeyFromPassword(PasswordCell.Entry.Text, EmailCell.Entry.Text); + var normalizedEmail = EmailCell.Entry.Text.ToLower(); + var key = _cryptoService.MakeKeyFromPassword(PasswordCell.Entry.Text, normalizedEmail); var request = new RegisterRequest { - Email = EmailCell.Entry.Text, + Email = normalizedEmail, MasterPasswordHash = _cryptoService.HashPasswordBase64(key, PasswordCell.Entry.Text), MasterPasswordHint = !string.IsNullOrWhiteSpace(PasswordHintCell.Entry.Text) ? PasswordHintCell.Entry.Text : null }; @@ -188,7 +192,7 @@ namespace Bit.App.Pages } _googleAnalyticsService.TrackAppEvent("Registered"); - await _homePage.DismissRegisterAndLoginAsync(EmailCell.Entry.Text); + await _homePage.DismissRegisterAndLoginAsync(normalizedEmail); } private class FormTableView : ExtendedTableView diff --git a/src/App/Pages/Vault/VaultListSitesPage.cs b/src/App/Pages/Vault/VaultListSitesPage.cs index de77a3081..b788879d4 100644 --- a/src/App/Pages/Vault/VaultListSitesPage.cs +++ b/src/App/Pages/Vault/VaultListSitesPage.cs @@ -71,7 +71,7 @@ namespace Bit.App.Pages ToolbarItems.Add(new AddSiteToolBarItem(this)); } - ListView = new ListView + ListView = new ListView(ListViewCachingStrategy.RecycleElement) { IsGroupingEnabled = true, ItemsSource = PresentationFolders,