diff --git a/ui/BankingiOSApp/BankingiOSApp/extensions/ViewExtensions.swift b/ui/BankingiOSApp/BankingiOSApp/extensions/ViewExtensions.swift index bc8dd5ea..17e869b0 100644 --- a/ui/BankingiOSApp/BankingiOSApp/extensions/ViewExtensions.swift +++ b/ui/BankingiOSApp/BankingiOSApp/extensions/ViewExtensions.swift @@ -78,6 +78,17 @@ extension View { return self.background(Color.systemGroupedBackground) } + func removeListInsets() -> some View { + return self.listRowInsets(EdgeInsets()) + } + + func removeSectionBackground() -> some View { + return self + .systemGroupedBackground() + .removeListInsets() + } + + func styleAmount(amount: CommonBigDecimal) -> some View { let amountColor = amount.decimal.isPositive() ? Styles.PositiveAmountColor : Styles.NegativeAmountColor diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/UIKit/LabelledUIKitTextFieldWithValidationLabel.swift b/ui/BankingiOSApp/BankingiOSApp/ui/UIKit/LabelledUIKitTextFieldWithValidationLabel.swift index a590b8e4..828a5c77 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/UIKit/LabelledUIKitTextFieldWithValidationLabel.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/UIKit/LabelledUIKitTextFieldWithValidationLabel.swift @@ -48,7 +48,7 @@ struct LabelledUIKitTextFieldWithValidationLabel: View { ValidationLabel(validationResult) } } - .listRowInsets(EdgeInsets()) + .removeListInsets() } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift index e5d3fd05..80c8018e 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountTransactionsDialog.swift @@ -102,8 +102,7 @@ struct AccountTransactionsDialog: View { .padding(.horizontal, 6) } .frame(maxWidth: .infinity, minHeight: 44) // has to have at least a height of 44 (iOS 14; iOS 13: 40), otherwise a white line at bottom gets displayed - .systemGroupedBackground() // TODO: extract with below .removeSectionBackground() (or create View?) - .listRowInsets(EdgeInsets()) // TODO: extract remove list insets + .removeListInsets() } if showTransactionsList { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountsDialog.swift b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountsDialog.swift index 97ea8122..01bee9e4 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountsDialog.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/dialogs/AccountsDialog.swift @@ -29,8 +29,7 @@ struct AccountsDialog: View { Section { AddAccountButtonView() } - .systemGroupedBackground() - .listRowInsets(EdgeInsets()) + .removeSectionBackground() } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/Divider.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/Divider.swift index d420e60e..788fd769 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/Divider.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/Divider.swift @@ -12,7 +12,7 @@ struct Divider: View { Rectangle() .fill(color) .frame(height: height) - .listRowInsets(EdgeInsets()) + .removeListInsets() .edgesIgnoringSafeArea(.horizontal) .padding(0) } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/InfoLabel.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/InfoLabel.swift index 91976d8d..21d6b0ec 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/InfoLabel.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/InfoLabel.swift @@ -31,8 +31,7 @@ struct InfoLabel: View { .frame(height: 18) } .font(.callout) - .systemGroupedBackground() - .listRowInsets(EdgeInsets()) + .removeSectionBackground() } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/SearchBarWithLabel.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/SearchBarWithLabel.swift index e4aa890e..224488b5 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/SearchBarWithLabel.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/SearchBarWithLabel.swift @@ -44,7 +44,7 @@ struct SearchBarWithLabel: View { .padding(.horizontal) .padding(.bottom, 8) } - .listRowInsets(EdgeInsets()) + .removeListInsets() } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift index 0b2d1aa9..d79dc3bc 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/tan/FlickerCodeTanView.swift @@ -145,7 +145,7 @@ struct FlickerCodeTanView: View { .padding(.bottom, 12) } .background(Color.black) - .listRowInsets(EdgeInsets()) + .removeListInsets() } // what a hack to be able to call animator.animate() (otherwise compiler would throw 'use of immutable self in closure' error) .executeMutatingMethod {