1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-08 11:33:31 +00:00

[PM-6496] Improved iOS extensions cipher cell UI (#3058)

* PM-6496 Improved iOS extensions cipher list to have an updated UI for each cell

* PM-6496 Improved UI on iOS extensions list cells
This commit is contained in:
Federico Maccaroni
2024-03-08 13:59:15 -03:00
committed by GitHub
parent 39187732c0
commit 67f7b3156e
8 changed files with 208 additions and 40 deletions

View File

@@ -1,4 +1,5 @@
using Bit.Core.Services;
using Bit.iOS.Core.Utilities;
using Foundation;
using ObjCRuntime;
using UIKit;
@@ -27,9 +28,9 @@ namespace Bit.iOS.Autofill.ListItems
{
try
{
_header.TextColor = UIColor.FromName(ColorConstants.LIGHT_TEXT_MUTED);
_header.Font = UIFont.SystemFontOfSize(15);
_separator.BackgroundColor = UIColor.FromName(ColorConstants.LIGHT_SECONDARY_300);
_header.TextColor = ThemeHelpers.TextColor;
_header.Font = UIFont.SystemFontOfSize(15, UIFontWeight.Semibold);
_separator.BackgroundColor = ThemeHelpers.SeparatorColor;
_header.TranslatesAutoresizingMaskIntoConstraints = false;
_separator.TranslatesAutoresizingMaskIntoConstraints = false;
@@ -39,14 +40,14 @@ namespace Bit.iOS.Autofill.ListItems
NSLayoutConstraint.ActivateConstraints(new NSLayoutConstraint[]
{
_header.LeadingAnchor.ConstraintEqualTo(ContentView.LayoutMarginsGuide.LeadingAnchor, 9),
_header.TrailingAnchor.ConstraintEqualTo(ContentView.LayoutMarginsGuide.TrailingAnchor, 9),
_header.TopAnchor.ConstraintEqualTo(ContentView.LayoutMarginsGuide.TopAnchor, 3),
_header.LeadingAnchor.ConstraintEqualTo(ContentView.LeadingAnchor, 9),
_header.TrailingAnchor.ConstraintEqualTo(ContentView.TrailingAnchor, 9),
_header.TopAnchor.ConstraintEqualTo(ContentView.LayoutMarginsGuide.TopAnchor, 10),
_separator.HeightAnchor.ConstraintEqualTo(2),
_separator.TopAnchor.ConstraintEqualTo(_header.BottomAnchor, 8),
_separator.LeadingAnchor.ConstraintEqualTo(ContentView.LayoutMarginsGuide.LeadingAnchor, 5),
_separator.TrailingAnchor.ConstraintEqualTo(ContentView.LayoutMarginsGuide.TrailingAnchor, 5),
_separator.HeightAnchor.ConstraintEqualTo(1),
_separator.TopAnchor.ConstraintEqualTo(_header.BottomAnchor, 12),
_separator.LeadingAnchor.ConstraintEqualTo(ContentView.LeadingAnchor, 7),
_separator.TrailingAnchor.ConstraintEqualTo(ContentView.TrailingAnchor, -7),
_separator.BottomAnchor.ConstraintEqualTo(ContentView.LayoutMarginsGuide.BottomAnchor, 2)
});
}

View File

@@ -61,10 +61,12 @@ namespace Bit.iOS.Autofill
NavItem.Title = Context.IsCreatingPasskey ? AppResources.SavePasskey : AppResources.Items;
_cancelButton.Title = AppResources.Cancel;
TableView.RowHeight = UITableView.AutomaticDimension;
TableView.EstimatedRowHeight = 44;
TableView.BackgroundColor = ThemeHelpers.BackgroundColor;
TableView.Source = new TableSource(this);
var tableSource = new TableSource(this);
TableView.Source = tableSource;
tableSource.RegisterTableViewCells(TableView);
if (Context.IsCreatingPasskey)
{
TableView.SectionHeaderHeight = 55;

View File

@@ -35,7 +35,11 @@ namespace Bit.iOS.Autofill
TableView.RowHeight = UITableView.AutomaticDimension;
TableView.EstimatedRowHeight = 44;
TableView.Source = new TableSource(this);
var tableSource = new TableSource(this);
TableView.Source = tableSource;
tableSource.RegisterTableViewCells(TableView);
SearchBar.Delegate = new ExtensionSearchDelegate(TableView);
await ((TableSource)TableView.Source).LoadAsync(false, SearchBar.Text);
}