diff --git a/src/App/Controls/ExtendedCollectionView.cs b/src/App/Controls/ExtendedCollectionView.cs index fa44c31ee..79e1bac9d 100644 --- a/src/App/Controls/ExtendedCollectionView.cs +++ b/src/App/Controls/ExtendedCollectionView.cs @@ -4,5 +4,6 @@ namespace Bit.App.Controls { public class ExtendedCollectionView : CollectionView { + public string ExtraDataForLogging { get; set; } } } diff --git a/src/App/Pages/Generator/GeneratorHistoryPage.xaml b/src/App/Pages/Generator/GeneratorHistoryPage.xaml index b110b1b70..e1a7f7733 100644 --- a/src/App/Pages/Generator/GeneratorHistoryPage.xaml +++ b/src/App/Pages/Generator/GeneratorHistoryPage.xaml @@ -48,7 +48,8 @@ IsVisible="{Binding ShowNoData, Converter={StaticResource inverseBool}}" ItemsSource="{Binding History}" VerticalOptions="FillAndExpand" - StyleClass="list, list-platform"> + StyleClass="list, list-platform" + ExtraDataForLogging="Generator History Page"> + + StyleClass="list, list-platform" + ExtraDataForLogging="Send Groupings Page" /> diff --git a/src/App/Pages/Send/SendsPage.xaml b/src/App/Pages/Send/SendsPage.xaml index 85efa8c16..fd37c5b2d 100644 --- a/src/App/Pages/Send/SendsPage.xaml +++ b/src/App/Pages/Send/SendsPage.xaml @@ -1,4 +1,4 @@ - + + StyleClass="list, list-platform" + ExtraDataForLogging="Sends Page"> + StyleClass="list, list-platform" + ExtraDataForLogging="Folders Page"> + StyleClass="list, list-platform" + ExtraDataForLogging="Settings Page" /> diff --git a/src/App/Pages/Vault/AutofillCiphersPage.xaml b/src/App/Pages/Vault/AutofillCiphersPage.xaml index 4a99f7b0e..e1cc992ff 100644 --- a/src/App/Pages/Vault/AutofillCiphersPage.xaml +++ b/src/App/Pages/Vault/AutofillCiphersPage.xaml @@ -85,7 +85,8 @@ ItemTemplate="{StaticResource listItemDataTemplateSelector}" SelectionMode="Single" SelectionChanged="RowSelected" - StyleClass="list, list-platform" /> + StyleClass="list, list-platform" + ExtraDataForLogging="Autofill Ciphers Page" /> diff --git a/src/App/Pages/Vault/CiphersPage.xaml b/src/App/Pages/Vault/CiphersPage.xaml index 8b463e1a3..b5bce8532 100644 --- a/src/App/Pages/Vault/CiphersPage.xaml +++ b/src/App/Pages/Vault/CiphersPage.xaml @@ -68,7 +68,8 @@ VerticalOptions="FillAndExpand" SelectionMode="Single" SelectionChanged="RowSelected" - StyleClass="list, list-platform"> + StyleClass="list, list-platform" + ExtraDataForLogging="Ciphers Page"> + StyleClass="list, list-platform" + ExtraDataForLogging="Groupings Page" /> diff --git a/src/App/Pages/Vault/PasswordHistoryPage.xaml b/src/App/Pages/Vault/PasswordHistoryPage.xaml index aba696576..215686c7b 100644 --- a/src/App/Pages/Vault/PasswordHistoryPage.xaml +++ b/src/App/Pages/Vault/PasswordHistoryPage.xaml @@ -39,7 +39,8 @@ IsVisible="{Binding ShowNoData, Converter={StaticResource inverseBool}}" ItemsSource="{Binding History}" VerticalOptions="FillAndExpand" - StyleClass="list, list-platform"> + StyleClass="list, list-platform" + ExtraDataForLogging="Password History Page"> > + { + protected override GroupableItemsViewController CreateController(ExtendedCollectionView itemsView, ItemsViewLayout layout) + { + return new ExtendedGroupableItemsViewController(itemsView, layout); + } + } +} diff --git a/src/iOS.Core/Renderers/CollectionView/ExtendedGroupableItemsViewController.cs b/src/iOS.Core/Renderers/CollectionView/ExtendedGroupableItemsViewController.cs new file mode 100644 index 000000000..94c15e114 --- /dev/null +++ b/src/iOS.Core/Renderers/CollectionView/ExtendedGroupableItemsViewController.cs @@ -0,0 +1,28 @@ +using System; +using Bit.App.Controls; +using Foundation; +using Xamarin.Forms.Platform.iOS; + +namespace Bit.iOS.Core.Renderers.CollectionView +{ + public class ExtendedGroupableItemsViewController : GroupableItemsViewController + where TItemsView : ExtendedCollectionView + { + public ExtendedGroupableItemsViewController(TItemsView groupableItemsView, ItemsViewLayout layout) + : base(groupableItemsView, layout) + { + } + + protected override void UpdateTemplatedCell(TemplatedCell cell, NSIndexPath indexPath) + { + try + { + base.UpdateTemplatedCell(cell, indexPath); + } + catch (Exception ex) when (ItemsView?.ExtraDataForLogging != null) + { + throw new Exception("Error in ExtendedCollectionView, extra data: " + ItemsView.ExtraDataForLogging, ex); + } + } + } +} diff --git a/src/iOS.Core/iOS.Core.csproj b/src/iOS.Core/iOS.Core.csproj index 0bb092e46..a0e0967da 100644 --- a/src/iOS.Core/iOS.Core.csproj +++ b/src/iOS.Core/iOS.Core.csproj @@ -138,6 +138,7 @@ + @@ -194,6 +195,8 @@ + +