From c72b551e8018144a3ef8e341abf40febc0fb90b6 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 7 Nov 2016 23:45:46 -0500 Subject: [PATCH] Android vault add/edit/view button widths, padding, and background color adjusted. --- src/App/Controls/FormEntryCell.cs | 6 +++++ src/App/Controls/LabeledValueCell.cs | 24 ++++++++++--------- src/App/Models/Page/VaultViewSitePageModel.cs | 2 +- src/App/Pages/Vault/VaultAddSitePage.cs | 4 ++++ src/App/Pages/Vault/VaultEditSitePage.cs | 4 ++++ src/App/Pages/Vault/VaultViewSitePage.cs | 7 ++++++ 6 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/App/Controls/FormEntryCell.cs b/src/App/Controls/FormEntryCell.cs index 0ab4027c5..74ad9cc0d 100644 --- a/src/App/Controls/FormEntryCell.cs +++ b/src/App/Controls/FormEntryCell.cs @@ -117,6 +117,12 @@ namespace Bit.App.Controls { Button = new ExtendedButton(); imageStackLayout.Children.Add(Button); + + if(Device.OS == TargetPlatform.Android) + { + Button.Padding = new Thickness(0); + Button.BackgroundColor = Color.Transparent; + } } Tapped += FormEntryCell_Tapped; diff --git a/src/App/Controls/LabeledValueCell.cs b/src/App/Controls/LabeledValueCell.cs index 28c335615..bcc867db8 100644 --- a/src/App/Controls/LabeledValueCell.cs +++ b/src/App/Controls/LabeledValueCell.cs @@ -84,17 +84,19 @@ namespace Bit.App.Controls if(Device.OS == TargetPlatform.Android) { - //if(Button1 != null) - //{ - // Button1.Padding = new Thickness(5); - // Button1.BackgroundColor = Color.Transparent; - //} - //if(Button2 != null) - //{ - // Button2.Padding = new Thickness(5); - // Button2.BackgroundColor = Color.Transparent; - //} - + buttonStackLayout.Spacing = 5; + + if(Button1 != null) + { + Button1.Padding = new Thickness(0); + Button1.BackgroundColor = Color.Transparent; + } + if(Button2 != null) + { + Button2.Padding = new Thickness(0); + Button2.BackgroundColor = Color.Transparent; + } + containerStackLayout.AdjustPaddingForDevice(); } diff --git a/src/App/Models/Page/VaultViewSitePageModel.cs b/src/App/Models/Page/VaultViewSitePageModel.cs index 32e2ac42c..e72fc0529 100644 --- a/src/App/Models/Page/VaultViewSitePageModel.cs +++ b/src/App/Models/Page/VaultViewSitePageModel.cs @@ -87,7 +87,7 @@ namespace Bit.App.Models.Page { return Device.GetNamedSize(NamedSize.Micro, typeof(Label)); } - else if(length > 15) + else if(length > 20) { return Device.GetNamedSize(NamedSize.Small, typeof(Label)); } diff --git a/src/App/Pages/Vault/VaultAddSitePage.cs b/src/App/Pages/Vault/VaultAddSitePage.cs index c4fcfab2e..4cf67476d 100644 --- a/src/App/Pages/Vault/VaultAddSitePage.cs +++ b/src/App/Pages/Vault/VaultAddSitePage.cs @@ -106,6 +106,10 @@ namespace Bit.App.Pages table.RowHeight = -1; table.EstimatedRowHeight = 70; } + else if(Device.OS == TargetPlatform.Android) + { + PasswordCell.Button.WidthRequest = 40; + } var saveToolBarItem = new ToolbarItem(AppResources.Save, null, async () => { diff --git a/src/App/Pages/Vault/VaultEditSitePage.cs b/src/App/Pages/Vault/VaultEditSitePage.cs index 52fe570e7..121e80147 100644 --- a/src/App/Pages/Vault/VaultEditSitePage.cs +++ b/src/App/Pages/Vault/VaultEditSitePage.cs @@ -135,6 +135,10 @@ namespace Bit.App.Pages table.RowHeight = -1; table.EstimatedRowHeight = 70; } + else if(Device.OS == TargetPlatform.Android) + { + PasswordCell.Button.WidthRequest = 40; + } var saveToolBarItem = new ToolbarItem(AppResources.Save, null, async () => { diff --git a/src/App/Pages/Vault/VaultViewSitePage.cs b/src/App/Pages/Vault/VaultViewSitePage.cs index 18ebe75a1..b4ada9279 100644 --- a/src/App/Pages/Vault/VaultViewSitePage.cs +++ b/src/App/Pages/Vault/VaultViewSitePage.cs @@ -107,6 +107,13 @@ namespace Bit.App.Pages Table.RowHeight = -1; Table.EstimatedRowHeight = 70; } + else if(Device.OS == TargetPlatform.Android) + { + PasswordCell.Button1.WidthRequest = 40; + PasswordCell.Button2.WidthRequest = 55; + UsernameCell.Button1.WidthRequest = 55; + UriCell.Button1.WidthRequest = 71; + } Title = "View Site"; Content = Table;