diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index 2d0a6a541..0bf005337 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -196,6 +196,8 @@ + + diff --git a/src/Android/Controls/ExtendedEditorRenderer.cs b/src/Android/Controls/ExtendedEditorRenderer.cs new file mode 100644 index 000000000..253332cab --- /dev/null +++ b/src/Android/Controls/ExtendedEditorRenderer.cs @@ -0,0 +1,48 @@ +using System; +using System.ComponentModel; +using Bit.Android.Controls; +using Bit.App.Controls; +using Xamarin.Forms; +using Xamarin.Forms.Platform.Android; + +[assembly: ExportRenderer(typeof(ExtendedEditor), typeof(ExtendedEditorRenderer))] +namespace Bit.Android.Controls +{ + public class ExtendedEditorRenderer : EditorRenderer + { + protected override void OnElementChanged(ElementChangedEventArgs e) + { + base.OnElementChanged(e); + + var view = (ExtendedEditor)Element; + + SetBorder(view); + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) + { + var view = (ExtendedEditor)Element; + + if(e.PropertyName == ExtendedEditor.HasBorderProperty.PropertyName) + { + SetBorder(view); + } + else + { + base.OnElementPropertyChanged(sender, e); + if(e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName) + { + Control.SetBackgroundColor(view.BackgroundColor.ToAndroid()); + } + } + } + + private void SetBorder(ExtendedEditor view) + { + if(!view.HasBorder) + { + Control.SetBackgroundColor(global::Android.Graphics.Color.Transparent); + } + } + } +} diff --git a/src/Android/Controls/ExtendedEntryRenderer.cs b/src/Android/Controls/ExtendedEntryRenderer.cs index dada4bc15..2cc4a257e 100644 --- a/src/Android/Controls/ExtendedEntryRenderer.cs +++ b/src/Android/Controls/ExtendedEntryRenderer.cs @@ -51,7 +51,14 @@ namespace Bit.Android.Controls private void SetBorder(ExtendedEntry view) { - //Not suported on Android + if(!view.HasBorder) + { + Control.SetBackgroundColor(global::Android.Graphics.Color.Transparent); + } + else + { + Control.SetBackgroundColor(view.BottomBorderColor.ToAndroid()); + } } private void SetMaxLength(ExtendedEntry view) diff --git a/src/Android/Controls/ExtendedPickerRenderer.cs b/src/Android/Controls/ExtendedPickerRenderer.cs new file mode 100644 index 000000000..247277fcc --- /dev/null +++ b/src/Android/Controls/ExtendedPickerRenderer.cs @@ -0,0 +1,48 @@ +using System; +using System.ComponentModel; +using Bit.Android.Controls; +using Bit.App.Controls; +using Xamarin.Forms; +using Xamarin.Forms.Platform.Android; + +[assembly: ExportRenderer(typeof(ExtendedPicker), typeof(ExtendedPickerRenderer))] +namespace Bit.Android.Controls +{ + public class ExtendedPickerRenderer : PickerRenderer + { + protected override void OnElementChanged(ElementChangedEventArgs e) + { + base.OnElementChanged(e); + + var view = (ExtendedPicker)Element; + + SetBorder(view); + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) + { + var view = (ExtendedPicker)Element; + + if(e.PropertyName == ExtendedPicker.HasBorderProperty.PropertyName) + { + SetBorder(view); + } + else + { + base.OnElementPropertyChanged(sender, e); + if(e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName) + { + Control.SetBackgroundColor(view.BackgroundColor.ToAndroid()); + } + } + } + + private void SetBorder(ExtendedPicker view) + { + if(!view.HasBorder) + { + Control.SetBackgroundColor(global::Android.Graphics.Color.Transparent); + } + } + } +} diff --git a/src/Android/Resources/Resource.Designer.cs b/src/Android/Resources/Resource.Designer.cs index d19ac139b..c60b1c81d 100644 --- a/src/Android/Resources/Resource.Designer.cs +++ b/src/Android/Resources/Resource.Designer.cs @@ -1166,32 +1166,32 @@ namespace Bit.Android public partial class Color { - // aapt resource value: 0x7f0b004d - public const int abc_background_cache_hint_selector_material_dark = 2131427405; - // aapt resource value: 0x7f0b004e - public const int abc_background_cache_hint_selector_material_light = 2131427406; + public const int abc_background_cache_hint_selector_material_dark = 2131427406; // aapt resource value: 0x7f0b004f - public const int abc_color_highlight_material = 2131427407; + public const int abc_background_cache_hint_selector_material_light = 2131427407; + + // aapt resource value: 0x7f0b0050 + public const int abc_color_highlight_material = 2131427408; // aapt resource value: 0x7f0b0004 public const int abc_input_method_navigation_guard = 2131427332; - // aapt resource value: 0x7f0b0050 - public const int abc_primary_text_disable_only_material_dark = 2131427408; - // aapt resource value: 0x7f0b0051 - public const int abc_primary_text_disable_only_material_light = 2131427409; + public const int abc_primary_text_disable_only_material_dark = 2131427409; // aapt resource value: 0x7f0b0052 - public const int abc_primary_text_material_dark = 2131427410; + public const int abc_primary_text_disable_only_material_light = 2131427410; // aapt resource value: 0x7f0b0053 - public const int abc_primary_text_material_light = 2131427411; + public const int abc_primary_text_material_dark = 2131427411; // aapt resource value: 0x7f0b0054 - public const int abc_search_url_text = 2131427412; + public const int abc_primary_text_material_light = 2131427412; + + // aapt resource value: 0x7f0b0055 + public const int abc_search_url_text = 2131427413; // aapt resource value: 0x7f0b0005 public const int abc_search_url_text_normal = 2131427333; @@ -1202,14 +1202,14 @@ namespace Bit.Android // aapt resource value: 0x7f0b0007 public const int abc_search_url_text_selected = 2131427335; - // aapt resource value: 0x7f0b0055 - public const int abc_secondary_text_material_dark = 2131427413; - // aapt resource value: 0x7f0b0056 - public const int abc_secondary_text_material_light = 2131427414; + public const int abc_secondary_text_material_dark = 2131427414; - // aapt resource value: 0x7f0b004c - public const int accent = 2131427404; + // aapt resource value: 0x7f0b0057 + public const int abc_secondary_text_material_light = 2131427415; + + // aapt resource value: 0x7f0b004d + public const int accent = 2131427405; // aapt resource value: 0x7f0b0008 public const int accent_material_dark = 2131427336; @@ -1331,6 +1331,9 @@ namespace Bit.Android // aapt resource value: 0x7f0b001f public const int hint_foreground_material_light = 2131427359; + // aapt resource value: 0x7f0b004b + public const int lightgray = 2131427403; + // aapt resource value: 0x7f0b0020 public const int material_blue_grey_800 = 2131427360; @@ -1367,8 +1370,8 @@ namespace Bit.Android // aapt resource value: 0x7f0b002b public const int material_grey_900 = 2131427371; - // aapt resource value: 0x7f0b004b - public const int primary = 2131427403; + // aapt resource value: 0x7f0b004c + public const int primary = 2131427404; // aapt resource value: 0x7f0b002c public const int primary_dark_material_dark = 2131427372; @@ -1418,11 +1421,11 @@ namespace Bit.Android // aapt resource value: 0x7f0b003b public const int switch_thumb_disabled_material_light = 2131427387; - // aapt resource value: 0x7f0b0057 - public const int switch_thumb_material_dark = 2131427415; - // aapt resource value: 0x7f0b0058 - public const int switch_thumb_material_light = 2131427416; + public const int switch_thumb_material_dark = 2131427416; + + // aapt resource value: 0x7f0b0059 + public const int switch_thumb_material_light = 2131427417; // aapt resource value: 0x7f0b003c public const int switch_thumb_normal_material_dark = 2131427388; diff --git a/src/Android/Resources/values-v21/styles.xml b/src/Android/Resources/values-v21/styles.xml index 3f5cd69cb..7c675d03d 100644 --- a/src/Android/Resources/values-v21/styles.xml +++ b/src/Android/Resources/values-v21/styles.xml @@ -4,6 +4,6 @@ @color/primary @color/darkgray @color/accent - @color/white + @color/lightgray diff --git a/src/Android/Resources/values/colors.xml b/src/Android/Resources/values/colors.xml index 56cc94782..12a3b18d9 100644 --- a/src/Android/Resources/values/colors.xml +++ b/src/Android/Resources/values/colors.xml @@ -3,6 +3,7 @@ #FFFFFF #333333 #738182 + #ecf0f5 #222d32 #3c8dbc diff --git a/src/Android/Resources/values/styles.xml b/src/Android/Resources/values/styles.xml index c3a06ef5d..72d59efda 100644 --- a/src/Android/Resources/values/styles.xml +++ b/src/Android/Resources/values/styles.xml @@ -4,6 +4,6 @@ @color/primary @color/darkgray @color/accent - @color/white + @color/lightgray diff --git a/src/App/App.csproj b/src/App/App.csproj index 4336da617..4a770c52c 100644 --- a/src/App/App.csproj +++ b/src/App/App.csproj @@ -45,6 +45,8 @@ + + diff --git a/src/App/Controls/ExtendedEditor.cs b/src/App/Controls/ExtendedEditor.cs new file mode 100644 index 000000000..76c24ef5c --- /dev/null +++ b/src/App/Controls/ExtendedEditor.cs @@ -0,0 +1,17 @@ +using System; +using Xamarin.Forms; + +namespace Bit.App.Controls +{ + public class ExtendedEditor : Editor + { + public static readonly BindableProperty HasBorderProperty = + BindableProperty.Create(nameof(HasBorder), typeof(bool), typeof(ExtendedEditor), true); + + public bool HasBorder + { + get { return (bool)GetValue(HasBorderProperty); } + set { SetValue(HasBorderProperty, value); } + } + } +} diff --git a/src/App/Controls/ExtendedTableView.cs b/src/App/Controls/ExtendedTableView.cs new file mode 100644 index 000000000..4f782a309 --- /dev/null +++ b/src/App/Controls/ExtendedTableView.cs @@ -0,0 +1,9 @@ +using System; +using Xamarin.Forms; + +namespace Bit.App.Controls +{ + public class ExtendedTableView : TableView + { + } +} diff --git a/src/App/Pages/VaultAddSitePage.cs b/src/App/Pages/VaultAddSitePage.cs index c4b851c0a..9edbd9132 100644 --- a/src/App/Pages/VaultAddSitePage.cs +++ b/src/App/Pages/VaultAddSitePage.cs @@ -43,7 +43,7 @@ namespace Bit.App.Pages } var usernameEntry = new ExtendedEntry { HasBorder = false }; var passwordEntry = new ExtendedEntry { IsPassword = true, HasBorder = false }; - var notesEditor = new Editor { HeightRequest = 75 }; + var notesEditor = new ExtendedEditor { HeightRequest = Device.OS == TargetPlatform.iOS ? 70 : 90, HasBorder = false }; var uriStackLayout = new FormEntryStackLayout(); uriStackLayout.Children.Add(new EntryLabel { Text = AppResources.URI }); @@ -76,15 +76,13 @@ namespace Bit.App.Pages passwordCell.View = passwordStackLayout; var notesStackLayout = new FormEntryStackLayout(); - notesStackLayout.Children.Add(new EntryLabel { Text = AppResources.Notes }); notesStackLayout.Children.Add(notesEditor); var notesCell = new ViewCell(); notesCell.View = notesStackLayout; - var table = new TableView + var mainTable = new ExtendedTableView { - Intent = TableIntent.Form, - RowHeight = 65, + Intent = TableIntent.Settings, HasUnevenRows = true, Root = new TableRoot { @@ -94,15 +92,37 @@ namespace Bit.App.Pages nameCell, folderCell, usernameCell, - passwordCell, + passwordCell + } + } + }; + + var notesTable = new ExtendedTableView + { + Intent = TableIntent.Settings, + HasUnevenRows = true, + Root = new TableRoot + { + new TableSection(AppResources.Notes) + { notesCell } } }; + if(Device.OS == TargetPlatform.iOS) + { + mainTable.RowHeight = 70; + notesTable.RowHeight = 90; + } + + var tablesStackLayout = new StackLayout(); + tablesStackLayout.Children.Add(mainTable); + tablesStackLayout.Children.Add(notesTable); + var scrollView = new ScrollView { - Content = table, + Content = tablesStackLayout, Orientation = ScrollOrientation.Vertical }; @@ -169,6 +189,7 @@ namespace Bit.App.Pages public FormEntryStackLayout() { Padding = new Thickness(15, 15, 15, 0); + BackgroundColor = Color.White; } } } diff --git a/src/iOS/Controls/ExtendedTableViewRenderer.cs b/src/iOS/Controls/ExtendedTableViewRenderer.cs new file mode 100644 index 000000000..3091f1cbb --- /dev/null +++ b/src/iOS/Controls/ExtendedTableViewRenderer.cs @@ -0,0 +1,39 @@ +using System; +using System.ComponentModel; +using Bit.App.Controls; +using Bit.iOS.Controls; +using UIKit; +using Xamarin.Forms; +using Xamarin.Forms.Platform.iOS; + +[assembly: ExportRenderer(typeof(ExtendedTableView), typeof(ExtendedTableViewRenderer))] +namespace Bit.iOS.Controls +{ + public class ExtendedTableViewRenderer : TableViewRenderer + { + protected override void OnElementChanged(ElementChangedEventArgs e) + { + base.OnElementChanged(e); + + var view = e.NewElement as ExtendedTableView; + if(view != null) + { + CorrectMargins(view); + } + } + + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) + { + base.OnElementPropertyChanged(sender, e); + + var view = (ExtendedTableView)Element; + + CorrectMargins(view); + } + + private void CorrectMargins(ExtendedTableView view) + { + Control.ContentInset = new UIEdgeInsets(-10, 0, -100, 0); + } + } +} diff --git a/src/iOS/Info.plist b/src/iOS/Info.plist index 6d46c8d50..5d8af2243 100644 --- a/src/iOS/Info.plist +++ b/src/iOS/Info.plist @@ -31,6 +31,10 @@ 1.0 CFBundleIconFiles + Icon-72@2x.png + Icon-72.png + Icon@2x.png + Icon.png Icon-60@2x.png Icon-76.png Icon-76@2x.png @@ -39,6 +43,8 @@ Default-568h@2x.png Default-Portrait.png Default-Portrait@2x.png + Icon-Small-50@2x.png + Icon-Small-50.png Icon-Small-40.png Icon-Small-40@2x.png Icon-Small.png @@ -48,5 +54,19 @@ LaunchScreen CFBundleShortVersionString 0.0.1 + UIMainStoryboardFile~ipad + LaunchScreen + UIStatusBarTintParameters + + UINavigationBar + + Style + UIBarStyleDefault + Translucent + + BackgroundImage + + + diff --git a/src/iOS/Resources/Icon-120.png b/src/iOS/Resources/Icon-120.png new file mode 100644 index 000000000..c6dbf5a47 Binary files /dev/null and b/src/iOS/Resources/Icon-120.png differ diff --git a/src/iOS/Resources/Icon-152.png b/src/iOS/Resources/Icon-152.png new file mode 100644 index 000000000..80b32b7d4 Binary files /dev/null and b/src/iOS/Resources/Icon-152.png differ diff --git a/src/iOS/Resources/Icon-16.png b/src/iOS/Resources/Icon-16.png new file mode 100644 index 000000000..7957b6487 Binary files /dev/null and b/src/iOS/Resources/Icon-16.png differ diff --git a/src/iOS/Resources/Icon-24.png b/src/iOS/Resources/Icon-24.png new file mode 100644 index 000000000..880e8da36 Binary files /dev/null and b/src/iOS/Resources/Icon-24.png differ diff --git a/src/iOS/Resources/Icon-32.png b/src/iOS/Resources/Icon-32.png new file mode 100644 index 000000000..483ec0aec Binary files /dev/null and b/src/iOS/Resources/Icon-32.png differ diff --git a/src/iOS/Resources/Icon-40.png b/src/iOS/Resources/Icon-40.png new file mode 100644 index 000000000..91b0b9c8c Binary files /dev/null and b/src/iOS/Resources/Icon-40.png differ diff --git a/src/iOS/Resources/Icon-40@2x.png b/src/iOS/Resources/Icon-40@2x.png new file mode 100644 index 000000000..6c56a2ef6 Binary files /dev/null and b/src/iOS/Resources/Icon-40@2x.png differ diff --git a/src/iOS/Resources/Icon-40@3x.png b/src/iOS/Resources/Icon-40@3x.png new file mode 100644 index 000000000..c6dbf5a47 Binary files /dev/null and b/src/iOS/Resources/Icon-40@3x.png differ diff --git a/src/iOS/Resources/Icon-60.png b/src/iOS/Resources/Icon-60.png new file mode 100644 index 000000000..e06b9111a Binary files /dev/null and b/src/iOS/Resources/Icon-60.png differ diff --git a/src/iOS/Resources/Icon-60@2x.png b/src/iOS/Resources/Icon-60@2x.png index 4b03c4270..c6dbf5a47 100644 Binary files a/src/iOS/Resources/Icon-60@2x.png and b/src/iOS/Resources/Icon-60@2x.png differ diff --git a/src/iOS/Resources/Icon-60@3x.png b/src/iOS/Resources/Icon-60@3x.png index b03ca1bbc..db5ea8fab 100644 Binary files a/src/iOS/Resources/Icon-60@3x.png and b/src/iOS/Resources/Icon-60@3x.png differ diff --git a/src/iOS/Resources/Icon-64.png b/src/iOS/Resources/Icon-64.png new file mode 100644 index 000000000..673691710 Binary files /dev/null and b/src/iOS/Resources/Icon-64.png differ diff --git a/src/iOS/Resources/Icon-72.png b/src/iOS/Resources/Icon-72.png new file mode 100644 index 000000000..65a06865c Binary files /dev/null and b/src/iOS/Resources/Icon-72.png differ diff --git a/src/iOS/Resources/Icon-72@2x.png b/src/iOS/Resources/Icon-72@2x.png new file mode 100644 index 000000000..5b88f8b7a Binary files /dev/null and b/src/iOS/Resources/Icon-72@2x.png differ diff --git a/src/iOS/Resources/Icon-76.png b/src/iOS/Resources/Icon-76.png index 587982e2a..46f1fe308 100644 Binary files a/src/iOS/Resources/Icon-76.png and b/src/iOS/Resources/Icon-76.png differ diff --git a/src/iOS/Resources/Icon-76@2x.png b/src/iOS/Resources/Icon-76@2x.png index cd4e2c8fe..80b32b7d4 100644 Binary files a/src/iOS/Resources/Icon-76@2x.png and b/src/iOS/Resources/Icon-76@2x.png differ diff --git a/src/iOS/Resources/Icon-Small-40.png b/src/iOS/Resources/Icon-Small-40.png index 6acff9441..91b0b9c8c 100644 Binary files a/src/iOS/Resources/Icon-Small-40.png and b/src/iOS/Resources/Icon-Small-40.png differ diff --git a/src/iOS/Resources/Icon-Small-40@2x.png b/src/iOS/Resources/Icon-Small-40@2x.png index b833aac26..6c56a2ef6 100644 Binary files a/src/iOS/Resources/Icon-Small-40@2x.png and b/src/iOS/Resources/Icon-Small-40@2x.png differ diff --git a/src/iOS/Resources/Icon-Small-40@3x.png b/src/iOS/Resources/Icon-Small-40@3x.png index ab8654e49..c6dbf5a47 100644 Binary files a/src/iOS/Resources/Icon-Small-40@3x.png and b/src/iOS/Resources/Icon-Small-40@3x.png differ diff --git a/src/iOS/Resources/Icon-Small-50.png b/src/iOS/Resources/Icon-Small-50.png new file mode 100644 index 000000000..6bf4752aa Binary files /dev/null and b/src/iOS/Resources/Icon-Small-50.png differ diff --git a/src/iOS/Resources/Icon-Small-50@2x.png b/src/iOS/Resources/Icon-Small-50@2x.png new file mode 100644 index 000000000..aedad818b Binary files /dev/null and b/src/iOS/Resources/Icon-Small-50@2x.png differ diff --git a/src/iOS/Resources/Icon-Small.png b/src/iOS/Resources/Icon-Small.png index 33db7e714..d57bb86cc 100644 Binary files a/src/iOS/Resources/Icon-Small.png and b/src/iOS/Resources/Icon-Small.png differ diff --git a/src/iOS/Resources/Icon-Small@2x.png b/src/iOS/Resources/Icon-Small@2x.png index bf45e2592..b75318029 100644 Binary files a/src/iOS/Resources/Icon-Small@2x.png and b/src/iOS/Resources/Icon-Small@2x.png differ diff --git a/src/iOS/Resources/Icon-Small@3x.png b/src/iOS/Resources/Icon-Small@3x.png index 7ad3891b9..cc8e0a8f0 100644 Binary files a/src/iOS/Resources/Icon-Small@3x.png and b/src/iOS/Resources/Icon-Small@3x.png differ diff --git a/src/iOS/Resources/Icon.png b/src/iOS/Resources/Icon.png new file mode 100644 index 000000000..cf5c4a422 Binary files /dev/null and b/src/iOS/Resources/Icon.png differ diff --git a/src/iOS/Resources/Icon@2x.png b/src/iOS/Resources/Icon@2x.png new file mode 100644 index 000000000..06c12f1ee Binary files /dev/null and b/src/iOS/Resources/Icon@2x.png differ diff --git a/src/iOS/Resources/Icon@3x.png b/src/iOS/Resources/Icon@3x.png new file mode 100644 index 000000000..f3d41121e Binary files /dev/null and b/src/iOS/Resources/Icon@3x.png differ diff --git a/src/iOS/Resources/iTunesArtwork.png b/src/iOS/Resources/iTunesArtwork.png new file mode 100644 index 000000000..2ad613f0a Binary files /dev/null and b/src/iOS/Resources/iTunesArtwork.png differ diff --git a/src/iOS/Resources/iTunesArtwork@2x.png b/src/iOS/Resources/iTunesArtwork@2x.png new file mode 100644 index 000000000..594f46f84 Binary files /dev/null and b/src/iOS/Resources/iTunesArtwork@2x.png differ diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj index 7ccb8493f..58f85d987 100644 --- a/src/iOS/iOS.csproj +++ b/src/iOS/iOS.csproj @@ -101,6 +101,7 @@ Entitlements.plist + @@ -112,8 +113,6 @@ - - @@ -273,6 +272,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/iOS/iTunesArtwork b/src/iOS/iTunesArtwork deleted file mode 100644 index 94c8ebd6b..000000000 Binary files a/src/iOS/iTunesArtwork and /dev/null differ diff --git a/src/iOS/iTunesArtwork@2x b/src/iOS/iTunesArtwork@2x deleted file mode 100644 index fa2ebf72d..000000000 Binary files a/src/iOS/iTunesArtwork@2x and /dev/null differ