From d6a66d1eb05465b3d44e717d8965e535543b1b4f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 13 Aug 2016 22:07:44 -0400 Subject: [PATCH] Android styling for tools page --- src/App/Pages/Tools/ToolsPage.cs | 43 +++++++++++++++++++------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/App/Pages/Tools/ToolsPage.cs b/src/App/Pages/Tools/ToolsPage.cs index 18e7f6507..8313632a9 100644 --- a/src/App/Pages/Tools/ToolsPage.cs +++ b/src/App/Pages/Tools/ToolsPage.cs @@ -26,13 +26,26 @@ namespace Bit.App.Pages { var generatorCell = new ToolsViewCell("Password Generator", "Automatically generate strong, unique passwords for your logins.", "refresh"); generatorCell.Tapped += GeneratorCell_Tapped; - var extensionCell = new ToolsViewCell("bitwarden App Extension", "Use bitwarden in Safari and other apps to auto-fill your logins.", "upload"); - extensionCell.Tapped += ExtensionCell_Tapped; var webCell = new ToolsViewCell("bitwarden Web Vault", "Manage your logins from any web browser with the bitwarden web vault.", "globe"); webCell.Tapped += WebCell_Tapped; var importCell = new ToolsViewCell("Import Logins", "Quickly bulk import your logins from other password management apps.", "cloudup"); importCell.Tapped += ImportCell_Tapped; + var section = new TableSection { generatorCell }; + + if(Device.OS == TargetPlatform.iOS) + { + var extensionCell = new ToolsViewCell("bitwarden App Extension", "Use bitwarden in Safari and other apps to auto-fill your logins.", "upload"); + extensionCell.Tapped += (object sender, EventArgs e) => + { + Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsExtensionPage())); + }; + section.Add(extensionCell); + } + + section.Add(webCell); + section.Add(importCell); + var table = new ExtendedTableView { EnableScrolling = true, @@ -40,13 +53,7 @@ namespace Bit.App.Pages HasUnevenRows = true, Root = new TableRoot { - new TableSection - { - generatorCell, - extensionCell, - webCell, - importCell - } + section } }; @@ -60,11 +67,6 @@ namespace Bit.App.Pages Content = table; } - private void ExtensionCell_Tapped(object sender, EventArgs e) - { - Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsExtensionPage())); - } - private void GeneratorCell_Tapped(object sender, EventArgs e) { Navigation.PushModalAsync(new ExtendedNavigationPage(new ToolsPasswordGeneratorPage())); @@ -93,7 +95,6 @@ namespace Bit.App.Pages { var label = new Label { - VerticalOptions = LayoutOptions.CenterAndExpand, LineBreakMode = LineBreakMode.TailTruncation, Text = labelText }; @@ -102,11 +103,16 @@ namespace Bit.App.Pages { FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), LineBreakMode = LineBreakMode.WordWrap, - VerticalOptions = LayoutOptions.End, Style = (Style)Application.Current.Resources["text-muted"], Text = detailText }; + if(Device.OS == TargetPlatform.Android) + { + detail.FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)); + label.TextColor = Color.Black; + } + var labelDetailStackLayout = new StackLayout { HorizontalOptions = LayoutOptions.StartAndExpand, @@ -127,7 +133,10 @@ namespace Bit.App.Pages { Orientation = StackOrientation.Horizontal, Children = { image, labelDetailStackLayout }, - Padding = new Thickness(15, 25) + Padding = Device.OnPlatform( + iOS: new Thickness(15, 25), + Android: new Thickness(15, 20), + WinPhone: new Thickness(15, 25)) }; ShowDisclousure = true;