From 361b606137b34e8bef200234df3cedd5f03eeb13 Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 3 Sep 2020 12:23:58 +0200 Subject: [PATCH] Left aligned text of BankListItem and BankAccountListItem --- ui/BankingiOSApp/BankingiOSApp.xcodeproj/project.pbxproj | 4 ++++ ui/BankingiOSApp/BankingiOSApp/ui/Styles.swift | 7 +++++++ ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift | 2 +- ui/BankingiOSApp/BankingiOSApp/ui/views/IconView.swift | 2 +- .../BankingiOSApp/ui/views/IconedTitleView.swift | 3 +++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ui/BankingiOSApp/BankingiOSApp.xcodeproj/project.pbxproj b/ui/BankingiOSApp/BankingiOSApp.xcodeproj/project.pbxproj index ac5e8773..7af03fb1 100644 --- a/ui/BankingiOSApp/BankingiOSApp.xcodeproj/project.pbxproj +++ b/ui/BankingiOSApp/BankingiOSApp.xcodeproj/project.pbxproj @@ -19,6 +19,7 @@ 360782D324F429F80098FEFE /* FlickerCodeStripe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 360782D224F429F70098FEFE /* FlickerCodeStripe.swift */; }; 3608D6C224FBA9C6006C93A8 /* TrianglePointingDown.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3608D6C124FBA9C6006C93A8 /* TrianglePointingDown.swift */; }; 3608D6C624FBAB41006C93A8 /* TanGeneratorPositionMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3608D6C524FBAB41006C93A8 /* TanGeneratorPositionMarker.swift */; }; + 3642F00A2500F5AE005186FE /* Divider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3642F0092500F5AE005186FE /* Divider.swift */; }; 366744E224FC4E96002B235A /* SectionWithRightAlignedEditButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 366744E124FC4E96002B235A /* SectionWithRightAlignedEditButton.swift */; }; 366FA4DA24C472A90094F009 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 366FA4D924C472A90094F009 /* Extensions.swift */; }; 366FA4DC24C479120094F009 /* BankInfoListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 366FA4DB24C479120094F009 /* BankInfoListItem.swift */; }; @@ -150,6 +151,7 @@ 360782D224F429F70098FEFE /* FlickerCodeStripe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlickerCodeStripe.swift; sourceTree = ""; }; 3608D6C124FBA9C6006C93A8 /* TrianglePointingDown.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrianglePointingDown.swift; sourceTree = ""; }; 3608D6C524FBAB41006C93A8 /* TanGeneratorPositionMarker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TanGeneratorPositionMarker.swift; sourceTree = ""; }; + 3642F0092500F5AE005186FE /* Divider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Divider.swift; sourceTree = ""; }; 366744E124FC4E96002B235A /* SectionWithRightAlignedEditButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionWithRightAlignedEditButton.swift; sourceTree = ""; }; 366FA4D924C472A90094F009 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 366FA4DB24C479120094F009 /* BankInfoListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankInfoListItem.swift; sourceTree = ""; }; @@ -471,6 +473,7 @@ 3608D6C124FBA9C6006C93A8 /* TrianglePointingDown.swift */, 3608D6C524FBAB41006C93A8 /* TanGeneratorPositionMarker.swift */, 366744E124FC4E96002B235A /* SectionWithRightAlignedEditButton.swift */, + 3642F0092500F5AE005186FE /* Divider.swift */, ); path = views; sourceTree = ""; @@ -656,6 +659,7 @@ 360782D324F429F80098FEFE /* FlickerCodeStripe.swift in Sources */, 36BE06C624D080C900CBBB68 /* FaviconType.swift in Sources */, 360782CD24F1A57F0098FEFE /* LabelledUIKitTextFieldWithValidationLabel.swift in Sources */, + 3642F00A2500F5AE005186FE /* Divider.swift in Sources */, 36BCF89324C25BC3005BEC29 /* Mapper.swift in Sources */, 36FC92D724B3A3BA002B12E9 /* NSUrlWebClient.swift in Sources */, 360782D124F3F4120098FEFE /* SelectorWrapper.swift in Sources */, diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/Styles.swift b/ui/BankingiOSApp/BankingiOSApp/ui/Styles.swift index ebea9c21..81b874a3 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/Styles.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/Styles.swift @@ -2,6 +2,13 @@ import SwiftUI class Styles { + + static let DefaultIconWidth: CGFloat = 24 + + static let AccountsIconWidth: CGFloat = DefaultIconWidth + + static let DefaultSpaceBetweenIconAndText: CGFloat = 8 + static let PositiveAmountColor = Color.green diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift index 47af3fc4..9bc18bb4 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift @@ -41,7 +41,7 @@ struct BankListItem : View { ForEach(bank.accountsSorted) { account in BankAccountListItem(account: account) } - .padding(.leading, 18) + .padding(.leading, Styles.AccountsIconWidth + Styles.DefaultSpaceBetweenIconAndText) } } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/IconView.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/IconView.swift index 9c620f0c..1651901b 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/IconView.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/IconView.swift @@ -16,7 +16,7 @@ struct IconView: View { .renderingMode(Image.TemplateRenderingMode.original) .resizable() .scaledToFit() - .frame(width: 24) + .frame(width: Styles.AccountsIconWidth) } private func getBankIcon(_ iconUrl: String?) -> Image { diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/IconedTitleView.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/IconedTitleView.swift index 89ff9ab2..071144a7 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/IconedTitleView.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/IconedTitleView.swift @@ -34,6 +34,9 @@ struct IconedTitleView: View { HStack { IconView(iconUrl: self.iconUrl, defaultIconName: self.defaultIconName) + Spacer() + .frame(width: Styles.DefaultSpaceBetweenIconAndText) + getTitleView() } }