diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index 5b49afe93e..494a809a08 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -77,7 +77,6 @@ 46E7740A242CEF0A008A5E93 /* RoundedImageViewDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E772FD242CEF09008A5E93 /* RoundedImageViewDemoView.swift */; }; 46E7740C242CEF0A008A5E93 /* LoadingIndicatorViewDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E77301242CEF09008A5E93 /* LoadingIndicatorViewDemoView.swift */; }; 46E7740D242CEF0A008A5E93 /* FeedbackDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E77303242CEF09008A5E93 /* FeedbackDemoView.swift */; }; - 46E7740E242CEF0A008A5E93 /* ChristmasWishListDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E77305242CEF09008A5E93 /* ChristmasWishListDemoView.swift */; }; 46E7740F242CEF0A008A5E93 /* CalloutDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E77307242CEF09008A5E93 /* CalloutDemoView.swift */; }; 46E77410242CEF0A008A5E93 /* RibbonDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E77309242CEF09008A5E93 /* RibbonDemoView.swift */; }; 46E77411242CEF0A008A5E93 /* ViewingsListDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E7730B242CEF09008A5E93 /* ViewingsListDemoView.swift */; }; @@ -289,7 +288,6 @@ 46E772FD242CEF09008A5E93 /* RoundedImageViewDemoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoundedImageViewDemoView.swift; sourceTree = ""; }; 46E77301242CEF09008A5E93 /* LoadingIndicatorViewDemoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadingIndicatorViewDemoView.swift; sourceTree = ""; }; 46E77303242CEF09008A5E93 /* FeedbackDemoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedbackDemoView.swift; sourceTree = ""; }; - 46E77305242CEF09008A5E93 /* ChristmasWishListDemoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChristmasWishListDemoView.swift; sourceTree = ""; }; 46E77307242CEF09008A5E93 /* CalloutDemoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CalloutDemoView.swift; sourceTree = ""; }; 46E77309242CEF09008A5E93 /* RibbonDemoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RibbonDemoView.swift; sourceTree = ""; }; 46E7730B242CEF09008A5E93 /* ViewingsListDemoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewingsListDemoView.swift; sourceTree = ""; }; @@ -738,7 +736,6 @@ 46E7731F242CEF09008A5E93 /* Button */, 46E77306242CEF09008A5E93 /* Callout */, 46E77356242CEF09008A5E93 /* CheckmarkTitleView */, - 46E77304242CEF09008A5E93 /* ChristmasWishList */, 46E7731D242CEF09008A5E93 /* CollapsibleContentView */, 46E77316242CEF09008A5E93 /* ColumnListsView */, 46E77326242CEF09008A5E93 /* Consent */, @@ -983,14 +980,6 @@ path = Feedback; sourceTree = ""; }; - 46E77304242CEF09008A5E93 /* ChristmasWishList */ = { - isa = PBXGroup; - children = ( - 46E77305242CEF09008A5E93 /* ChristmasWishListDemoView.swift */, - ); - path = ChristmasWishList; - sourceTree = ""; - }; 46E77306242CEF09008A5E93 /* Callout */ = { isa = PBXGroup; children = ( @@ -1851,7 +1840,6 @@ 5DCE0885280FDF2A00ED7407 /* MonthAndYearPickerDemoView.swift in Sources */, 46E77440242CEF0A008A5E93 /* SpacingDemoView.swift in Sources */, 5DEAC3C425C164D9003376AD /* IconButtonDemoView.swift in Sources */, - 46E7740E242CEF0A008A5E93 /* ChristmasWishListDemoView.swift in Sources */, 46E7742D242CEF0A008A5E93 /* PrimingDemoView.swift in Sources */, 46E77436242CEF0A008A5E93 /* QuestionnaireDefaultData.swift in Sources */, 46E77428242CEF0A008A5E93 /* ReviewButtonViewDemoView.swift in Sources */, diff --git a/Demo/SnapshotTests/ComponentViewTests.swift b/Demo/SnapshotTests/ComponentViewTests.swift index 384833f793..06198ad73a 100644 --- a/Demo/SnapshotTests/ComponentViewTests.swift +++ b/Demo/SnapshotTests/ComponentViewTests.swift @@ -156,10 +156,6 @@ class ComponentViewTests: XCTestCase { snapshot(.visibilityDrivenTitleView) } - func testChristmasWishListView() { - snapshot(.christmasWishListView) - } - func testPriming() { snapshot(.priming) } diff --git a/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.dark_iPad.png b/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.dark_iPad.png deleted file mode 100644 index 893c10b17f..0000000000 Binary files a/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.dark_iPad.png and /dev/null differ diff --git a/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.dark_iPhone.png b/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.dark_iPhone.png deleted file mode 100644 index b0ec266cec..0000000000 Binary files a/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.dark_iPhone.png and /dev/null differ diff --git a/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.light_iPad.png b/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.light_iPad.png deleted file mode 100644 index 32445d8285..0000000000 Binary files a/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.light_iPad.png and /dev/null differ diff --git a/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.light_iPhone.png b/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.light_iPhone.png deleted file mode 100644 index 5cfc3482a9..0000000000 Binary files a/Demo/SnapshotTests/__Snapshots__/ComponentViewTests/ChristmasWishListDemoView.light_iPhone.png and /dev/null differ diff --git a/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.dark_iPad_footersharebutton.png b/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.dark_iPad_footersharebutton.png deleted file mode 100644 index bb8d0b1ee7..0000000000 Binary files a/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.dark_iPad_footersharebutton.png and /dev/null differ diff --git a/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.dark_iPhone_footersharebutton.png b/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.dark_iPhone_footersharebutton.png deleted file mode 100644 index 48d0c790dd..0000000000 Binary files a/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.dark_iPhone_footersharebutton.png and /dev/null differ diff --git a/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.light_iPad_footersharebutton.png b/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.light_iPad_footersharebutton.png deleted file mode 100644 index 319df04c71..0000000000 Binary files a/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.light_iPad_footersharebutton.png and /dev/null differ diff --git a/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.light_iPhone_footersharebutton.png b/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.light_iPhone_footersharebutton.png deleted file mode 100644 index 440a5e0125..0000000000 Binary files a/Demo/SnapshotTests/__Snapshots__/FullscreenViewTests/FavoriteAdsListDemoView.light_iPhone_footersharebutton.png and /dev/null differ diff --git a/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.dark_iPad.png b/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.dark_iPad.png index 0c07c56626..d59534af3f 100644 Binary files a/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.dark_iPad.png and b/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.dark_iPad.png differ diff --git a/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.dark_iPhone.png b/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.dark_iPhone.png index 388d1dda52..35ec85b9c0 100644 Binary files a/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.dark_iPhone.png and b/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.dark_iPhone.png differ diff --git a/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.light_iPad.png b/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.light_iPad.png index 8669351983..3e81b906aa 100644 Binary files a/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.light_iPad.png and b/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.light_iPad.png differ diff --git a/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.light_iPhone.png b/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.light_iPhone.png index 21c452bfa9..5129d9d901 100644 Binary files a/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.light_iPhone.png and b/Demo/SnapshotTests/__Snapshots__/RecyclingViewTests/FavoriteFoldersListDemoView.light_iPhone.png differ diff --git a/Demo/Sources/Components/ChristmasWishList/ChristmasWishListDemoView.swift b/Demo/Sources/Components/ChristmasWishList/ChristmasWishListDemoView.swift deleted file mode 100644 index 28f83e65ba..0000000000 --- a/Demo/Sources/Components/ChristmasWishList/ChristmasWishListDemoView.swift +++ /dev/null @@ -1,86 +0,0 @@ -// -// Copyright © 2019 FINN AS. All rights reserved. -// - -import FinniversKit -import DemoKit - -class ChristmasWishListDemoView: UIView, Demoable { - private lazy var backgroundView = UIView() - private lazy var christmasWishListView = ChristmasWishListView(withAutoLayout: true) - let viewModel = ChristmasWishListViewModel() - - // MARK: - Init - - public override init(frame: CGRect) { - super.init(frame: frame) - setup() - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - // MARK: - Setup - - private func setup() { - backgroundView.backgroundColor = .backgroundInfoSubtle - christmasWishListView.configure(with: viewModel) - - addSubview(backgroundView) - addSubview(christmasWishListView) - - christmasWishListView.dropShadow(color: .black, opacity: 0.5, offset: CGSize(width: 5, height: 5), radius: 30) - - backgroundView.fillInSuperview() - - NSLayoutConstraint.activate([ - christmasWishListView.widthAnchor.constraint(equalToConstant: 337), - christmasWishListView.heightAnchor.constraint(equalToConstant: 463), - christmasWishListView.centerXAnchor.constraint(equalTo: centerXAnchor), - christmasWishListView.centerYAnchor.constraint(equalTo: centerYAnchor) - ]) - } -} - -extension ChristmasWishListViewModel { - init() { - self.init( - firstPage: Page( - title: "Ønsk deg brukte gaver til jul!", - text: "Gjør det enkelt for dine nærmeste ved å dele ønskelisten din!", - accessoryButtonTitle: "Les mer om brukte julegaver", - actionButtonIcon: UIImage(named: .gift), - actionButtonTitle: "Lag ønskeliste" - ), - secondPage: Page( - title: "Ønskelisten din er nå opprettet", - text: "Du vil nå kunne finne en helt nystrøken ønskeliste blant dine favorittlister.", - accessoryButtonTitle: nil, - actionButtonIcon: nil, - actionButtonTitle: "Den er god! God jul!" - ) - ) - } -} - -#if canImport(SwiftUI) && DEBUG -import SwiftUI - -// swiftlint:disable:next superfluous_disable_command type_name -struct ChristmasWishListDemoView_Previews: PreviewProvider { - static var previews: some View { - Group { - DemoWrapperView(view: ChristmasWishListDemoView()) - - DemoWrapperView(view: ChristmasWishListDemoView()) - .environment(\.colorScheme, ColorScheme.dark) - .previewDisplayName("Dark") - - DemoWrapperView(view: ChristmasWishListDemoView()) - .previewDevice(PreviewDevice.init(stringLiteral: "iPhone SE")) - .previewDisplayName("iPhone SE") - } - } -} -#endif diff --git a/Demo/Sources/Demo/DemoViews/ComponentDemoViews.swift b/Demo/Sources/Demo/DemoViews/ComponentDemoViews.swift index ed6cffc31c..96789f8805 100644 --- a/Demo/Sources/Demo/DemoViews/ComponentDemoViews.swift +++ b/Demo/Sources/Demo/DemoViews/ComponentDemoViews.swift @@ -13,7 +13,6 @@ enum ComponentDemoViews: String, CaseIterable, DemoGroup, DemoGroupItem { case callout case checkbox case checkmarkTitleView - case christmasWishListView case cogWheelButton case collapsibleContentView case columnListsView @@ -157,8 +156,6 @@ enum ComponentDemoViews: String, CaseIterable, DemoGroup, DemoGroupItem { return FeedbackDemoView() case .happinessRating: return HappinessRatingDemoView() - case .christmasWishListView: - return ChristmasWishListDemoView() case .nativeAdvert: return NativeAdvertDemoView() case .callout: diff --git a/Demo/Sources/Fullscreen/FavoriteAdsListView/FavoriteAdsListDemoViewController.swift b/Demo/Sources/Fullscreen/FavoriteAdsListView/FavoriteAdsListDemoViewController.swift index 6f8759eb92..1ee2d2b921 100644 --- a/Demo/Sources/Fullscreen/FavoriteAdsListView/FavoriteAdsListDemoViewController.swift +++ b/Demo/Sources/Fullscreen/FavoriteAdsListView/FavoriteAdsListDemoViewController.swift @@ -27,7 +27,6 @@ class FavoriteAdsListDemoView: UIView { view.title = folderTitle view.subtitle = "\(viewModels.count) favoritter" view.sortingTitle = currentSorting.rawValue - view.isFooterShareButtonHidden = true view.configure(scrollShadowHeight: 44) return view }() @@ -94,7 +93,6 @@ extension FavoriteAdsListDemoView: TweakableDemo { case sharedPersonalFolder case readOnlyFolderDefaultModels case readOnlyFolderNoFavorites - case footerShareButton } var numberOfTweaks: Int { Tweaks.allCases.count } @@ -112,13 +110,11 @@ extension FavoriteAdsListDemoView: TweakableDemo { setReadOnly(false) favoritesListView.setEditing(false) resetHeader() - favoritesListView.isFooterShareButtonHidden = true case .selectionModeWithMessages: resetViewModels() setReadOnly(false) favoritesListView.setEditing(false) resetHeader() - favoritesListView.isFooterShareButtonHidden = true favoritesListView.configure(infoMessages: [ .message( "This is a single demo message. It's kinda long, but it should still present as needed", @@ -136,52 +132,39 @@ extension FavoriteAdsListDemoView: TweakableDemo { favoritesListView.setEditing(false) resetHeader() setTitle("Veldig langt navn, ganske nøyaktig 50 tegn faktisk") - favoritesListView.isFooterShareButtonHidden = true case .emptyFolder: setReadOnly(false) setViewModels([]) favoritesListView.setEditing(false) resetHeader() - favoritesListView.isFooterShareButtonHidden = true case .editModeNoneSelected: resetViewModels() setReadOnly(false) favoritesListView.setEditing(true) favoritesListView.selectAllRows(false, animated: false) resetHeader() - favoritesListView.isFooterShareButtonHidden = true case .editModeAllSelected: resetViewModels() setReadOnly(false) favoritesListView.setEditing(true) favoritesListView.selectAllRows(true, animated: false) resetHeader() - favoritesListView.isFooterShareButtonHidden = true case .sharedPersonalFolder: resetViewModels() setReadOnly(false) favoritesListView.setEditing(false) resetHeader() favoritesListView.isShared = true - favoritesListView.isFooterShareButtonHidden = true case .readOnlyFolderDefaultModels: resetViewModels() setReadOnly(true) favoritesListView.setEditing(false) resetHeader() - favoritesListView.isFooterShareButtonHidden = true case .readOnlyFolderNoFavorites: setViewModels([]) setReadOnly(true) favoritesListView.setEditing(false) resetHeader() - favoritesListView.isFooterShareButtonHidden = true - case .footerShareButton: - resetViewModels() - setReadOnly(false) - favoritesListView.setEditing(false) - resetHeader() - favoritesListView.isFooterShareButtonHidden = false } } } @@ -284,7 +267,6 @@ extension FavoriteAdsListViewModel { static let `default` = FavoriteAdsListViewModel( searchBarPlaceholder: "Søk etter en av dine favoritter", headerShareButtonTitle: "Delt liste", - footerShareButtonTitle: "Del ønskelisten din", addCommentActionTitle: "Skriv\nnotat", editCommentActionTitle: "Rediger\nnotat", deleteAdActionTitle: "Slett", diff --git a/Demo/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListDemoView.swift b/Demo/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListDemoView.swift index c5354b3b44..9b95d2b08c 100644 --- a/Demo/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListDemoView.swift +++ b/Demo/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListDemoView.swift @@ -53,7 +53,6 @@ extension FavoriteFoldersListDemoView: TweakableDemo { enum Tweaks: String, CaseIterable, TweakingOption { case toggleMode case editMode - case xmasButton } var shouldSnapshotTweaks: Bool { false } @@ -70,15 +69,10 @@ extension FavoriteFoldersListDemoView: TweakableDemo { isEditing = false allFavorites = FavoriteFoldersFactory.create() view.setEditing(false) - view.hideXmasButton() case .editMode: isEditing = true allFavorites = FavoriteFoldersFactory.create(withSelectedItems: false) view.setEditing(true) - view.hideXmasButton() - case .xmasButton: - let text = "Tips! Nå kan du endelig opprette og dele din egen juleønskeliste! Her er i såfall knappen for å gjøre det! God jul!" - view.showXmasButton(withCalloutText: text) } } } @@ -116,10 +110,6 @@ extension FavoriteFoldersListDemoView: FavoriteFoldersListViewDelegate { func favoriteFoldersListViewDidFocusSearchBar(_ view: FavoriteFoldersListView) { // Set bottomSheet to expanded here, if needed. } - - func favoriteFoldersListViewDidSelectXmasButton(_ view: FavoriteFoldersListView) { - view.hideXmasButton() - } } // MARK: - FavoriteFoldersListViewDataSource diff --git a/Demo/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListViewDemoViewHelpers.swift b/Demo/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListViewDemoViewHelpers.swift index b69a9d187e..cfc79c5813 100644 --- a/Demo/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListViewDemoViewHelpers.swift +++ b/Demo/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListViewDemoViewHelpers.swift @@ -10,7 +10,6 @@ struct FavoriteFolder: FavoriteFolderViewModel { let subtitle: String? let imagePath: String? let isDefault: Bool - let isXmas: Bool let detailText: String? = "23 annonser" let cornerRadius: CGFloat = 12 let imageViewWidth: CGFloat = 40 @@ -23,14 +22,13 @@ struct FavoriteFoldersFactory { var favorites = [FavoriteFolder]() for (index, (title, imagePath)) in zip(titles, imagePaths).enumerated() { - let isSelected = withSelectedItems ? [1, 2].contains(index) : false + let isSelected = withSelectedItems ? [0, 1].contains(index) : false let folder = FavoriteFolder( id: index, title: title, - subtitle: index == 2 ? "Delt liste" : nil, + subtitle: index == 1 ? "Delt liste" : nil, imagePath: imagePath, - isDefault: index == 1, - isXmas: index == 0, + isDefault: index == 0, isSelected: isSelected ) @@ -42,7 +40,6 @@ struct FavoriteFoldersFactory { private static var titles: [String] { return [ - "Mine julegaveønsker", "Mine funn", "We accept up to 50 characters for a folder's name", "Mansion", diff --git a/FinniversKit/FinniversKit.xcodeproj/project.pbxproj b/FinniversKit/FinniversKit.xcodeproj/project.pbxproj index eb81f4ccce..e56813baa3 100644 --- a/FinniversKit/FinniversKit.xcodeproj/project.pbxproj +++ b/FinniversKit/FinniversKit.xcodeproj/project.pbxproj @@ -244,10 +244,6 @@ 9A37DC6E6F0401357C564B93 /* RemoteImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A37D61B28BC0BA6CA6110A5 /* RemoteImageView.swift */; }; 9A37DCEF8B61CDA7813AFB16 /* VisibilityDrivenTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A37DAD39379A11C6213043C /* VisibilityDrivenTitleView.swift */; }; 9A37DFD7CA27F4F25F613DE2 /* FavoriteAdsListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A37DD79F67FC522D64A127E /* FavoriteAdsListView.swift */; }; - 9B057AA9235EEB1C007B1CF0 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B057AA8235EEB1C007B1CF0 /* ContentView.swift */; }; - 9B057AAC235EEBAA007B1CF0 /* ChristmasButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B057AAB235EEBAA007B1CF0 /* ChristmasButton.swift */; }; - 9B057AAE235EEBE9007B1CF0 /* MissionPopupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B057AAD235EEBE9007B1CF0 /* MissionPopupView.swift */; }; - 9B057AB0235EEC0F007B1CF0 /* ChristmasWishListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B057AAF235EEC0F007B1CF0 /* ChristmasWishListViewModel.swift */; }; 9B06096823F14B0A005CB592 /* SafetyElementViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B06096723F14B0A005CB592 /* SafetyElementViewModel.swift */; }; 9B06096B23F14B2F005CB592 /* ElementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B06096A23F14B2F005CB592 /* ElementView.swift */; }; 9B06096D23F14B80005CB592 /* CompactView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B06096C23F14B80005CB592 /* CompactView.swift */; }; @@ -275,7 +271,6 @@ 9BC5F40924114085007D74AC /* ResultView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC5F40824114085007D74AC /* ResultView.swift */; }; 9BCD171523CCBB680045BD61 /* CollapsibleContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BCD171423CCBB680045BD61 /* CollapsibleContentView.swift */; }; 9BCE6A3E23C7272200F37F6D /* BetaFeatureView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BCE6A3D23C7272200F37F6D /* BetaFeatureView.swift */; }; - 9BD8ABC02359B1EE001078CA /* ChristmasWishListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BD8ABBF2359B1EE001078CA /* ChristmasWishListView.swift */; }; 9BEB2878231D26C100D28BAD /* LoanCalculatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BEB2876231D240100D28BAD /* LoanCalculatorView.swift */; }; 9BEB287B231D484B00D28BAD /* LoanHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BEB2879231D482F00D28BAD /* LoanHeaderView.swift */; }; 9BEB287D231D486100D28BAD /* LoanValuesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BEB287C231D486100D28BAD /* LoanValuesView.swift */; }; @@ -364,7 +359,6 @@ CFB61374229ACA6900DE283D /* IconCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFB61373229ACA6900DE283D /* IconCollectionView.swift */; }; CFB61376229ACB0C00DE283D /* IconCollectionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFB61375229ACB0C00DE283D /* IconCollectionViewModel.swift */; }; CFB6137C229AD43400DE283D /* VerticalIconCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFB6137A229AD41600DE283D /* VerticalIconCollectionViewCell.swift */; }; - CFB775F22359D8360097C0ED /* FloatingButton+Favorites.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFB775F12359D8360097C0ED /* FloatingButton+Favorites.swift */; }; CFCC3D3123686C0D002DD4CF /* FooterButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFCC3D3023686C0D002DD4CF /* FooterButtonView.swift */; }; CFCDDA5C2273022A005E1F4A /* CalloutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFCDDA5B2273022A005E1F4A /* CalloutView.swift */; }; CFCED8D922CE2BE90049A3A0 /* FavoriteFoldersSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFCED8D822CE2BE90049A3A0 /* FavoriteFoldersSearchBar.swift */; }; @@ -699,10 +693,6 @@ 9A37DD79F67FC522D64A127E /* FavoriteAdsListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FavoriteAdsListView.swift; sourceTree = ""; }; 9A37DF20BB7306D8D1A25593 /* UITableViewCellExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITableViewCellExtensions.swift; sourceTree = ""; }; 9A37DF9788D8084AE7F0B91B /* LinkButtonView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkButtonView.swift; sourceTree = ""; }; - 9B057AA8235EEB1C007B1CF0 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 9B057AAB235EEBAA007B1CF0 /* ChristmasButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChristmasButton.swift; sourceTree = ""; }; - 9B057AAD235EEBE9007B1CF0 /* MissionPopupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MissionPopupView.swift; sourceTree = ""; }; - 9B057AAF235EEC0F007B1CF0 /* ChristmasWishListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChristmasWishListViewModel.swift; sourceTree = ""; }; 9B06096723F14B0A005CB592 /* SafetyElementViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafetyElementViewModel.swift; sourceTree = ""; }; 9B06096A23F14B2F005CB592 /* ElementView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementView.swift; sourceTree = ""; }; 9B06096C23F14B80005CB592 /* CompactView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompactView.swift; sourceTree = ""; }; @@ -730,7 +720,6 @@ 9BC5F40824114085007D74AC /* ResultView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResultView.swift; sourceTree = ""; }; 9BCD171423CCBB680045BD61 /* CollapsibleContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsibleContentView.swift; sourceTree = ""; }; 9BCE6A3D23C7272200F37F6D /* BetaFeatureView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BetaFeatureView.swift; sourceTree = ""; }; - 9BD8ABBF2359B1EE001078CA /* ChristmasWishListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChristmasWishListView.swift; sourceTree = ""; }; 9BEB2876231D240100D28BAD /* LoanCalculatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoanCalculatorView.swift; sourceTree = ""; }; 9BEB2879231D482F00D28BAD /* LoanHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoanHeaderView.swift; sourceTree = ""; }; 9BEB287C231D486100D28BAD /* LoanValuesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoanValuesView.swift; sourceTree = ""; }; @@ -820,7 +809,6 @@ CFB61373229ACA6900DE283D /* IconCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconCollectionView.swift; sourceTree = ""; }; CFB61375229ACB0C00DE283D /* IconCollectionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconCollectionViewModel.swift; sourceTree = ""; }; CFB6137A229AD41600DE283D /* VerticalIconCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerticalIconCollectionViewCell.swift; sourceTree = ""; }; - CFB775F12359D8360097C0ED /* FloatingButton+Favorites.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FloatingButton+Favorites.swift"; sourceTree = ""; }; CFCC3D3023686C0D002DD4CF /* FooterButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooterButtonView.swift; sourceTree = ""; }; CFCDDA5B2273022A005E1F4A /* CalloutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalloutView.swift; sourceTree = ""; }; CFCED8D822CE2BE90049A3A0 /* FavoriteFoldersSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavoriteFoldersSearchBar.swift; sourceTree = ""; }; @@ -1392,7 +1380,6 @@ 4447F6651FDB2B110033DBC1 /* Button */, CFCDDA5A22730213005E1F4A /* Callout */, F2BE6C0A236C29BA0085A05A /* CheckmarkTitleView */, - 9BD8ABBE2359B1CE001078CA /* ChristmasWishListView */, 9BCD171323CCBB590045BD61 /* CollapsibleContentView */, 9B1B12C423D5ACCB00282F3E /* ColumnListsView */, 45B2E06B207E181C00C68B92 /* Consent */, @@ -2190,16 +2177,6 @@ path = Subviews; sourceTree = ""; }; - 9B057AAA235EEB1F007B1CF0 /* Views */ = { - isa = PBXGroup; - children = ( - 9B057AA8235EEB1C007B1CF0 /* ContentView.swift */, - 9B057AAB235EEBAA007B1CF0 /* ChristmasButton.swift */, - 9B057AAD235EEBE9007B1CF0 /* MissionPopupView.swift */, - ); - path = Views; - sourceTree = ""; - }; 9B06096623F14AF4005CB592 /* SafetyElementsView */ = { isa = PBXGroup; children = ( @@ -2321,16 +2298,6 @@ path = CollapsibleContentView; sourceTree = ""; }; - 9BD8ABBE2359B1CE001078CA /* ChristmasWishListView */ = { - isa = PBXGroup; - children = ( - 9BD8ABBF2359B1EE001078CA /* ChristmasWishListView.swift */, - 9B057AAA235EEB1F007B1CF0 /* Views */, - 9B057AAF235EEC0F007B1CF0 /* ChristmasWishListViewModel.swift */, - ); - path = ChristmasWishListView; - sourceTree = ""; - }; 9BEB2875231D23F500D28BAD /* LoanCalculator */ = { isa = PBXGroup; children = ( @@ -2650,7 +2617,6 @@ CFCED8E422CF71AC0049A3A0 /* FavoriteFoldersFooterView.swift */, CFCED8D822CE2BE90049A3A0 /* FavoriteFoldersSearchBar.swift */, CF05BA01233B78BC003A7F1C /* FavoriteSearchEmptyView.swift */, - CFB775F12359D8360097C0ED /* FloatingButton+Favorites.swift */, ); path = Subviews; sourceTree = ""; @@ -3212,7 +3178,6 @@ CF164D15230FFB7400250822 /* FavoriteAdActionViewModel.swift in Sources */, CF136ACD2203211100247B30 /* InfoboxView.swift in Sources */, 4447F6D21FDB2B110033DBC1 /* Label.swift in Sources */, - 9B057AA9235EEB1C007B1CF0 /* ContentView.swift in Sources */, 179D06A92906A39D00A65E3A /* HTMLStringParser.swift in Sources */, 9B06097023F14BB4005CB592 /* HeaderView.swift in Sources */, AF91BBA1202C8B72003E6366 /* Broadcast+Style.swift in Sources */, @@ -3259,7 +3224,6 @@ 4447F7031FDB2B110033DBC1 /* Config.swift in Sources */, DAA9A3AC210215400021F7DC /* AnimatedSelectionView.swift in Sources */, 27AE25A6298957D00091E957 /* Toast.swift in Sources */, - 9BD8ABC02359B1EE001078CA /* ChristmasWishListView.swift in Sources */, 27D4BE1C29657A960077D1A4 /* FrontPageHeaderView.swift in Sources */, 4DA1C74E27EC987F00B615A3 /* PromotionViewModel.swift in Sources */, CF0F6B972360781E00CA62FD /* PrimingView.swift in Sources */, @@ -3299,7 +3263,6 @@ 17538723291ABC1B00DA57D2 /* HTMLElement.swift in Sources */, 441D699D1FEA947600CD919A /* Layout.swift in Sources */, 44898D621FE5B9C200F6017B /* UIImageExtensions.swift in Sources */, - CFB775F22359D8360097C0ED /* FloatingButton+Favorites.swift in Sources */, 441FE44B209A2F2C00B04EF1 /* NotificationsListViewCell.swift in Sources */, B26B582E2B4BD695000E0245 /* NMPInfoboxView.swift in Sources */, CF0F6B992360784C00CA62FD /* PrimingViewModel.swift in Sources */, @@ -3446,7 +3409,6 @@ 714B9355253730D900801C99 /* SendInviteViewModel.swift in Sources */, CFCED8DD22CE3EAA0049A3A0 /* AddFavoriteFolderButton.swift in Sources */, DAB7FAA921B690DD00BF8CC6 /* BottomSheetAnimationController.swift in Sources */, - 9B057AAE235EEBE9007B1CF0 /* MissionPopupView.swift in Sources */, 0884C6CE22B7BE360015474D /* DisclaimerViewModel.swift in Sources */, 1753871D291AA55000DA57D2 /* HTMLStringParserTextTranslator.swift in Sources */, F2BE6C09236AD24B0085A05A /* CheckmarkTitleView.swift in Sources */, @@ -3464,7 +3426,6 @@ CFFDF89722F311F600FE68EA /* NeighborhoodProfileView.swift in Sources */, CF0647FC2368834B00863D07 /* TopShadowView.swift in Sources */, 44A557AF22E7211E001667AE /* RemoteImageTableViewCellViewModel.swift in Sources */, - 9B057AB0235EEC0F007B1CF0 /* ChristmasWishListViewModel.swift in Sources */, 712B0812254ADB1F00791C6B /* MessageUserRequiredView.swift in Sources */, 714B9352253728EC00801C99 /* SendInviteView.swift in Sources */, CF13D6CD2292D2300087DA37 /* PhaseListView.swift in Sources */, @@ -3500,7 +3461,6 @@ 4441F9F322CCF76300DCFD2F /* AddressMapView.swift in Sources */, 9BEB287D231D486100D28BAD /* LoanValuesView.swift in Sources */, 9BB680322462F7AC001ADACF /* View+Extensions.swift in Sources */, - 9B057AAC235EEBAA007B1CF0 /* ChristmasButton.swift in Sources */, DAE6A55C21CA524B00837BFA /* CGPoint.swift in Sources */, 2714D6932B69258600EF82E1 /* SelectableImageView.swift in Sources */, 43BACE6C21117D530052114C /* BuyerPickerViewModel.swift in Sources */, diff --git a/FinniversKit/Sources/Assets/Assets.xcassets/christmasWishListBanner.imageset/Contents.json b/FinniversKit/Sources/Assets/Assets.xcassets/christmasWishListBanner.imageset/Contents.json deleted file mode 100644 index 0f3e63b5cb..0000000000 --- a/FinniversKit/Sources/Assets/Assets.xcassets/christmasWishListBanner.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "christmasWishListBanner.png" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/FinniversKit/Sources/Assets/Assets.xcassets/christmasWishListBanner.imageset/christmasWishListBanner.png b/FinniversKit/Sources/Assets/Assets.xcassets/christmasWishListBanner.imageset/christmasWishListBanner.png deleted file mode 100644 index 772c55c847..0000000000 Binary files a/FinniversKit/Sources/Assets/Assets.xcassets/christmasWishListBanner.imageset/christmasWishListBanner.png and /dev/null differ diff --git a/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasButton.imageset/Contents.json b/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasButton.imageset/Contents.json deleted file mode 100644 index 28525f8e53..0000000000 --- a/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasButton.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "favoriteXmass.pdf" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasButton.imageset/favoriteXmass.pdf b/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasButton.imageset/favoriteXmass.pdf deleted file mode 100644 index 8297d61d29..0000000000 Binary files a/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasButton.imageset/favoriteXmass.pdf and /dev/null differ diff --git a/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasFolder.imageset/Contents.json b/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasFolder.imageset/Contents.json deleted file mode 100644 index e25cf7d488..0000000000 --- a/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasFolder.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "favoritesXmasFolder.pdf" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasFolder.imageset/favoritesXmasFolder.pdf b/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasFolder.imageset/favoritesXmasFolder.pdf deleted file mode 100644 index fd62c0b801..0000000000 Binary files a/FinniversKit/Sources/Assets/Icons.xcassets/Favorites/favoritesXmasFolder.imageset/favoritesXmasFolder.pdf and /dev/null differ diff --git a/FinniversKit/Sources/Assets/ImageAsset.swift b/FinniversKit/Sources/Assets/ImageAsset.swift index 767d096b42..1301de9f93 100644 --- a/FinniversKit/Sources/Assets/ImageAsset.swift +++ b/FinniversKit/Sources/Assets/ImageAsset.swift @@ -56,7 +56,6 @@ enum ImageAsset: String { case checkmark case checkmarkBig case checkmarkBlue - case christmasWishListBanner case close case confetti1 case confetti2 @@ -90,8 +89,6 @@ enum ImageAsset: String { case favoritesSortAdStatus case favoritesSortDistance case favoritesSortLastAdded - case favoritesXmasButton - case favoritesXmasFolder case favouriteAddImg case favouriteAdded case favouriteAddedImg @@ -187,7 +184,6 @@ enum ImageAsset: String { .checkmark, .checkmarkBig, .checkmarkBlue, - .christmasWishListBanner, .close, .confetti1, .confetti2, @@ -221,8 +217,6 @@ enum ImageAsset: String { .favoritesSortAdStatus, .favoritesSortDistance, .favoritesSortLastAdded, - .favoritesXmasButton, - .favoritesXmasFolder, .favouriteAddImg, .favouriteAdded, .favouriteAddedImg, diff --git a/FinniversKit/Sources/Cells/RemoteImageTableViewCell/RemoteImageTableViewCell.swift b/FinniversKit/Sources/Cells/RemoteImageTableViewCell/RemoteImageTableViewCell.swift index 059f740da9..2f6b8a4c62 100644 --- a/FinniversKit/Sources/Cells/RemoteImageTableViewCell/RemoteImageTableViewCell.swift +++ b/FinniversKit/Sources/Cells/RemoteImageTableViewCell/RemoteImageTableViewCell.swift @@ -12,7 +12,6 @@ public class RemoteImageTableViewCell: BasicTableViewCell { remoteImageView.dataSource = dataSource } } - public var isLoadingEnabled = true public var fallbackImage: UIImage = UIImage(named: .noImage) private var viewModel: RemoteImageTableViewCellViewModel? @@ -65,7 +64,7 @@ public class RemoteImageTableViewCell: BasicTableViewCell { } public func loadImage() { - guard let viewModel = viewModel, let imagePath = viewModel.imagePath, isLoadingEnabled else { + guard let viewModel = viewModel, let imagePath = viewModel.imagePath else { remoteImageView.setImage(fallbackImage, animated: false) return } diff --git a/FinniversKit/Sources/Components/ChristmasWishListView/ChristmasWishListView.swift b/FinniversKit/Sources/Components/ChristmasWishListView/ChristmasWishListView.swift deleted file mode 100644 index 0e735a443c..0000000000 --- a/FinniversKit/Sources/Components/ChristmasWishListView/ChristmasWishListView.swift +++ /dev/null @@ -1,168 +0,0 @@ -// -// Copyright © 2019 FINN AS. All rights reserved. -// - -import Foundation -import Warp - -public protocol ChristmasWishListViewDelegate: AnyObject { - func christmasWishListViewDidSelectReadMore(_ view: ChristmasWishListView) - func christmasWishListViewDidSelectCreateWishList(_ view: ChristmasWishListView) - func christmasWishListViewDidSelectDone(_ view: ChristmasWishListView) - func christmasWishListViewDidSelectClose(_ view: ChristmasWishListView) -} - -public class ChristmasWishListView: UIView { - // MARK: - Public properties - public weak var delegate: ChristmasWishListViewDelegate? - - // MARK: - Private properties - - private lazy var bannerImageView: UIView = { - let imageView = UIImageView(withAutoLayout: true) - imageView.image = UIImage(named: .christmasWishListBanner) - return imageView - }() - - private lazy var missionPopupView: MissionPopupView = { - let view = MissionPopupView( - withAutoLayout: true, - headerView: bannerImageView, - contentView: stackedContentView, - actionView: stackedButtons - ) - view.delegate = self - - return view - }() - - private lazy var firstPageView: ContentView = { - let view = ContentView(withAutoLayout: true) - view.delegate = self - return view - }() - - private lazy var secondPageView: ContentView = { - let view = ContentView(withAutoLayout: true) - view.delegate = self - return view - }() - - /// In order to create a sliding effect between the first and second page, I decided to use a view that stacks - /// both pages along the Z-axis and use translation transforms along the X-axis to do the page animation - private lazy var stackedContentView: UIView = { - let view = UIView(withAutoLayout: true) - - view.addSubview(firstPageView) - view.addSubview(secondPageView) - - firstPageView.fillInSuperview() - secondPageView.fillInSuperview() - - return view - }() - - private lazy var stackedButtons: UIView = { - let view = UIView(withAutoLayout: true) - - let margin: CGFloat = Warp.Spacing.spacing200 * 1.5 - view.layoutMargins = UIEdgeInsets(top: Warp.Spacing.spacing100, leading: margin, bottom: margin, trailing: margin) - - view.addSubview(firstPageButton) - view.addSubview(secondPageButton) - - firstPageButton.fillInSuperviewLayoutMargins() - secondPageButton.fillInSuperviewLayoutMargins() - - return view - }() - - private lazy var firstPageButton: ChristmasButton = { - let button = ChristmasButton() - button.addTarget(self, action: #selector(firstPageButtonTap), for: .touchUpInside) - - return button - }() - - private lazy var secondPageButton: ChristmasButton = { - let button = ChristmasButton() - button.addTarget(self, action: #selector(secondPageButtonTap), for: .touchUpInside) - - return button - }() - - // MARK: - Initializers - - public override init(frame: CGRect) { - super.init(frame: frame) - setup() - } - - public required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - setup() - } - - // MARK: - Overrides - public override func layoutSubviews() { - super.layoutSubviews() - - if firstPageView.transform == .identity { - secondPageView.transform = CGAffineTransform(translationX: bounds.width, y: 0) - secondPageButton.transform = CGAffineTransform(translationX: bounds.width, y: 0) - } - } - - // MARK: - Public methods - - public func configure(with viewModel: ChristmasWishListViewModel) { - firstPageView.configure(with: viewModel.firstPage) - secondPageView.configure(with: viewModel.secondPage) - - firstPageButton.setTitle(viewModel.firstPage.actionButtonTitle, for: .normal) - firstPageButton.setImage(viewModel.firstPage.actionButtonIcon?.withRenderingMode(.alwaysTemplate), for: .normal) - - secondPageButton.setTitle(viewModel.secondPage.actionButtonTitle, for: .normal) - secondPageButton.setImage(viewModel.secondPage.actionButtonIcon?.withRenderingMode(.alwaysTemplate), for: .normal) - } - - // MARK: - Private methods - - private func setup() { - addSubview(missionPopupView) - missionPopupView.fillInSuperview() - - NSLayoutConstraint.activate([ - bannerImageView.heightAnchor.constraint(equalToConstant: 225), - ]) - } - - @objc private func firstPageButtonTap() { - UIView.animate(withDuration: 0.3) { - self.firstPageButton.transform = CGAffineTransform(translationX: -self.bounds.width, y: 0) - self.secondPageButton.transform = .identity - - self.firstPageView.transform = CGAffineTransform(translationX: -self.bounds.width, y: 0) - self.secondPageView.transform = .identity - } - delegate?.christmasWishListViewDidSelectCreateWishList(self) - } - - @objc private func secondPageButtonTap() { - delegate?.christmasWishListViewDidSelectDone(self) - } -} - -// MARK: - MissionPopupViewDelegate -extension ChristmasWishListView: MissionPopupViewDelegate { - public func missionPopupViewDidSelectClose(_ view: MissionPopupView) { - delegate?.christmasWishListViewDidSelectClose(self) - } -} - -// MARK: - ChristmasWishListContentViewDelegate -extension ChristmasWishListView: ChristmasWishListContentViewDelegate { - func christmasWishListContentDidSelectAccessoryButton(_ view: ContentView) { - delegate?.christmasWishListViewDidSelectReadMore(self) - } -} diff --git a/FinniversKit/Sources/Components/ChristmasWishListView/ChristmasWishListViewModel.swift b/FinniversKit/Sources/Components/ChristmasWishListView/ChristmasWishListViewModel.swift deleted file mode 100644 index e530749a55..0000000000 --- a/FinniversKit/Sources/Components/ChristmasWishListView/ChristmasWishListViewModel.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright © 2019 FINN AS. All rights reserved. -// - -import Foundation - -public struct ChristmasWishListViewModel { - public struct Page { - let title: String - let text: String - let accessoryButtonTitle: String? - let actionButtonIcon: UIImage? - let actionButtonTitle: String - - public init(title: String, text: String, accessoryButtonTitle: String?, actionButtonIcon: UIImage?, actionButtonTitle: String) { - self.title = title - self.text = text - self.accessoryButtonTitle = accessoryButtonTitle - self.actionButtonIcon = actionButtonIcon - self.actionButtonTitle = actionButtonTitle - } - } - - let firstPage: Page - let secondPage: Page - - public init(firstPage: Page, secondPage: Page) { - self.firstPage = firstPage - self.secondPage = secondPage - } -} diff --git a/FinniversKit/Sources/Components/ChristmasWishListView/Views/ChristmasButton.swift b/FinniversKit/Sources/Components/ChristmasWishListView/Views/ChristmasButton.swift deleted file mode 100644 index ca34d0abd8..0000000000 --- a/FinniversKit/Sources/Components/ChristmasWishListView/Views/ChristmasButton.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// Copyright © 2019 FINN AS. All rights reserved. -// -import Warp - -extension ChristmasWishListView { - /// A custom call-to-action like button for the christmas wish list - class ChristmasButton: UIButton { - init() { - super.init(frame: .zero) - setup() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override var isHighlighted: Bool { - didSet { - backgroundColor = isHighlighted ? .christmasCallToActionHighlighted : .christmasCallToAction - } - } - - private func setup() { - translatesAutoresizingMaskIntoConstraints = false - setTitleColor(.textInverted, for: .normal) - imageView?.tintColor = .iconInverted - backgroundColor = .christmasCallToAction - - layer.cornerRadius = Warp.Spacing.spacing100 - imageEdgeInsets = UIEdgeInsets(trailing: Warp.Spacing.spacing100) - titleLabel?.font = UIFont.bodyStrong - contentEdgeInsets = UIEdgeInsets(all: Warp.Spacing.spacing100 * 1.5) - adjustsImageWhenHighlighted = false - } - } -} - -private extension UIColor { - class var christmasCallToAction: UIColor? { - return .backgroundNegative - } - - class var christmasCallToActionHighlighted: UIColor? { - return christmasCallToAction?.withAlphaComponent(0.8) - } -} diff --git a/FinniversKit/Sources/Components/ChristmasWishListView/Views/ContentView.swift b/FinniversKit/Sources/Components/ChristmasWishListView/Views/ContentView.swift deleted file mode 100644 index 4211d1ad22..0000000000 --- a/FinniversKit/Sources/Components/ChristmasWishListView/Views/ContentView.swift +++ /dev/null @@ -1,101 +0,0 @@ -// -// Copyright © 2019 FINN AS. All rights reserved. -// -import Warp - -protocol ChristmasWishListContentViewDelegate: AnyObject { - func christmasWishListContentDidSelectAccessoryButton(_ view: ChristmasWishListView.ContentView) -} - -extension ChristmasWishListView { - class ContentView: UIView { - // MARK: - Public properties - weak var delegate: ChristmasWishListContentViewDelegate? - - // MARK: - Private properties - private lazy var titleLabel: UILabel = { - let label = UILabel(withAutoLayout: true) - let font = UIFont.font(ofSize: 22, weight: .bold, textStyle: .title2) - label.font = font - label.textAlignment = .center - label.textColor = .text - label.adjustsFontForContentSizeCategory = true - label.numberOfLines = 0 - label.setContentHuggingPriority(.defaultHigh, for: .vertical) - return label - }() - - private lazy var bodyTextLabel: UILabel = { - let label = Label(style: .body, withAutoLayout: true) - label.numberOfLines = 0 - label.textAlignment = .center - label.setContentHuggingPriority(.defaultHigh, for: .vertical) - label.setContentCompressionResistancePriority(.defaultHigh + 1, for: .vertical) - return label - }() - - private lazy var accessoryButton: UIButton = { - let button = Button(style: .link, size: .small, withAutoLayout: true) - button.titleLabel?.font = .captionStrong - button.titleLabel?.numberOfLines = 0 - button.titleLabel?.adjustsFontForContentSizeCategory = true - button.addTarget(self, action: #selector(handleTapOnAccessoryButton), for: .touchUpInside) - button.setContentHuggingPriority(.defaultHigh, for: .vertical) - return button - }() - - // MARK: - Init - - override init(frame: CGRect) { - super.init(frame: frame) - setup() - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - // MARK: - Internal methods - - func configure(with viewModel: ChristmasWishListViewModel.Page) { - titleLabel.text = viewModel.title - bodyTextLabel.text = viewModel.text - accessoryButton.isHidden = viewModel.accessoryButtonTitle == nil - accessoryButton.setTitle(viewModel.accessoryButtonTitle, for: .normal) - } - - // MARK: - Private methods - - private func setup() { - backgroundColor = .background - let spacing = Warp.Spacing.spacing200 * 1.5 - layoutMargins = UIEdgeInsets(top: spacing, leading: spacing, bottom: 0, trailing: spacing) - - addSubview(titleLabel) - addSubview(bodyTextLabel) - addSubview(accessoryButton) - - let margins = layoutMarginsGuide - - NSLayoutConstraint.activate([ - titleLabel.topAnchor.constraint(equalTo: margins.topAnchor), - titleLabel.leadingAnchor.constraint(equalTo: margins.leadingAnchor), - titleLabel.trailingAnchor.constraint(equalTo: margins.trailingAnchor), - - bodyTextLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: Warp.Spacing.spacing50), - bodyTextLabel.leadingAnchor.constraint(equalTo: margins.leadingAnchor), - bodyTextLabel.trailingAnchor.constraint(equalTo: margins.trailingAnchor), - - accessoryButton.topAnchor.constraint(equalTo: bodyTextLabel.bottomAnchor, constant: Warp.Spacing.spacing200), - accessoryButton.leadingAnchor.constraint(equalTo: margins.leadingAnchor), - accessoryButton.trailingAnchor.constraint(equalTo: margins.trailingAnchor), - accessoryButton.heightAnchor.constraint(greaterThanOrEqualToConstant: Warp.Spacing.spacing400), - accessoryButton.bottomAnchor.constraint(equalTo: margins.bottomAnchor), - ]) - } - - @objc private func handleTapOnAccessoryButton() { - delegate?.christmasWishListContentDidSelectAccessoryButton(self) - } - } -} diff --git a/FinniversKit/Sources/Components/ChristmasWishListView/Views/MissionPopupView.swift b/FinniversKit/Sources/Components/ChristmasWishListView/Views/MissionPopupView.swift deleted file mode 100644 index 880ec7b3a8..0000000000 --- a/FinniversKit/Sources/Components/ChristmasWishListView/Views/MissionPopupView.swift +++ /dev/null @@ -1,139 +0,0 @@ -// -// Copyright © 2019 FINN AS. All rights reserved. -// -import Warp - -public protocol MissionPopupViewDelegate: AnyObject { - func missionPopupViewDidSelectClose(_ view: MissionPopupView) -} - -/// An attempt to create a generic pop-up like container to create views like the klimabrølet pop up -public class MissionPopupView: UIView { - // MARK: - Public properties - public weak var delegate: MissionPopupViewDelegate? - - // MARK: - Private properties - private var headerView: UIView - private var contentView: UIView - private var actionView: UIView - - private var shadowAnimationDuration = 0.12 - private var shadowOpacityLevel: Float = 0.2 - - private lazy var closeButton: UIButton = { - let button = UIButton(withAutoLayout: true) - button.tintColor = .background - button.setImage(UIImage(named: .cross), for: .normal) - button.backgroundColor = UIColor.black.withAlphaComponent(0.6) - button.contentEdgeInsets = UIEdgeInsets(all: 6) - button.addTarget(self, action: #selector(handleTapOnCloseButton), for: .touchUpInside) - - return button - }() - - private lazy var scrollView: UIScrollView = { - let scrollView = UIScrollView(withAutoLayout: true) - scrollView.bounces = true - scrollView.contentInset = UIEdgeInsets(bottom: Warp.Spacing.spacing400) - scrollView.delaysContentTouches = false - scrollView.delegate = self - return scrollView - }() - - private lazy var scrollableContentView: UIView = { - let view = UIView(withAutoLayout: true) - view.accessibilityLabel = "scrollableContent" - return view - }() - - // MARK: - Initializers - public required init?(coder aDecoder: NSCoder) { - fatalError("Use the initializer init(withAutoLayout:headerView:contentView:actionView) instead") - } - - public init(withAutoLayout: Bool, headerView: UIView, contentView: UIView, actionView: UIView) { - self.headerView = headerView - self.contentView = contentView - self.actionView = actionView - super.init(frame: .zero) - self.translatesAutoresizingMaskIntoConstraints = !withAutoLayout - setup() - } - - // MARK: - Overrides - public override func layoutSubviews() { - super.layoutSubviews() - closeButton.layer.cornerRadius = closeButton.bounds.width / 2.0 - } - - // MARK: - Private methods - private func setup() { - backgroundColor = .background - layer.cornerRadius = 20 - clipsToBounds = true - - scrollableContentView.addSubview(headerView) - scrollableContentView.addSubview(contentView) - - scrollView.addSubview(scrollableContentView) - - addSubview(scrollView) - addSubview(actionView) - addSubview(closeButton) - - actionView.setContentHuggingPriority(.required, for: .vertical) - actionView.backgroundColor = backgroundColor - scrollableContentView.fillInSuperview() - - NSLayoutConstraint.activate([ - headerView.topAnchor.constraint(equalTo: scrollableContentView.topAnchor), - headerView.leadingAnchor.constraint(equalTo: scrollableContentView.leadingAnchor), - headerView.trailingAnchor.constraint(equalTo: scrollableContentView.trailingAnchor), - headerView.bottomAnchor.constraint(equalTo: contentView.topAnchor), - - contentView.leadingAnchor.constraint(equalTo: scrollableContentView.leadingAnchor), - contentView.trailingAnchor.constraint(equalTo: scrollableContentView.trailingAnchor), - contentView.bottomAnchor.constraint(equalTo: scrollableContentView.bottomAnchor), - - scrollableContentView.widthAnchor.constraint(equalTo: scrollView.widthAnchor), - scrollableContentView.heightAnchor.constraint(greaterThanOrEqualTo: scrollView.heightAnchor), - - closeButton.topAnchor.constraint(equalTo: topAnchor, constant: Warp.Spacing.spacing100), - closeButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -Warp.Spacing.spacing100), - - scrollView.topAnchor.constraint(equalTo: topAnchor), - scrollView.leadingAnchor.constraint(equalTo: leadingAnchor), - scrollView.trailingAnchor.constraint(equalTo: trailingAnchor), - scrollView.bottomAnchor.constraint(equalTo: actionView.topAnchor), - - actionView.leadingAnchor.constraint(equalTo: leadingAnchor), - actionView.trailingAnchor.constraint(equalTo: trailingAnchor), - actionView.bottomAnchor.constraint(equalTo: bottomAnchor), - ]) - } - - @objc private func handleTapOnCloseButton() { - delegate?.missionPopupViewDidSelectClose(self) - } -} - -// MARK: - UIScrollViewDelegate -extension MissionPopupView: UIScrollViewDelegate { - public func scrollViewDidScroll(_ scrollView: UIScrollView) { - if scrollView.contentOffset.y + scrollView.frame.height < scrollableContentView.intrinsicContentSize.height { - animateShadow(fromValue: shadowOpacityLevel, toValue: 0, duration: shadowAnimationDuration) - } else { - animateShadow(fromValue: 0, toValue: shadowOpacityLevel, duration: shadowAnimationDuration) - } - } - - func animateShadow(fromValue from: Float, toValue to: Float, duration: Double) { - guard actionView.layer.shadowOpacity != to else { return } - let animation = CABasicAnimation(keyPath: "shadowOpacity") - animation.fromValue = from - animation.toValue = to - animation.duration = duration - actionView.layer.add(animation, forKey: nil) - actionView.layer.shadowOpacity = to - } -} diff --git a/FinniversKit/Sources/Fullscreen/FavoriteAdsList/FavoriteAdsListView.swift b/FinniversKit/Sources/Fullscreen/FavoriteAdsList/FavoriteAdsListView.swift index 802f157ee1..da6f17c1f5 100644 --- a/FinniversKit/Sources/Fullscreen/FavoriteAdsList/FavoriteAdsListView.swift +++ b/FinniversKit/Sources/Fullscreen/FavoriteAdsList/FavoriteAdsListView.swift @@ -45,7 +45,6 @@ public class FavoriteAdsListView: UIView { public var isReadOnly: Bool { didSet { reloadData(scrollToTop: true) - setFooterVewHidden(isReadOnly || isFooterShareButtonHidden) } } @@ -85,22 +84,13 @@ public class FavoriteAdsListView: UIView { } } - public var isFooterShareButtonHidden = true { - didSet { - setFooterVewHidden(isFooterShareButtonHidden) - } - } - // MARK: - Private properties private let viewModel: FavoriteAdsListViewModel private let imageCache = ImageMemoryCache() private var sendScrollUpdates: Bool = true - private var contentSizeObserver: NSKeyValueObservation? private lazy var scrollShadowView = BottomShadowView(withAutoLayout: true) private lazy var tableViewTopConstraint = tableView.topAnchor.constraint(equalTo: topAnchor) - private lazy var tableViewBottomConstraint = tableView.bottomAnchor.constraint(equalTo: bottomAnchor) - private lazy var tableViewFooterBottomConstraint = tableView.bottomAnchor.constraint(equalTo: footerView.topAnchor) private lazy var scrollShadowViewTopConstraint = scrollShadowView.topAnchor.constraint(equalTo: topAnchor, constant: 0) private lazy var scrollShadowViewHeightConstraint = scrollShadowView.heightAnchor.constraint(equalToConstant: 0) @@ -142,14 +132,6 @@ public class FavoriteAdsListView: UIView { return emptyView }() - private lazy var footerView: FooterButtonView = { - let view = FooterButtonView(withAutoLayout: true) - view.buttonTitle = viewModel.footerShareButtonTitle - view.isHidden = true - view.delegate = self - return view - }() - // MARK: - Init public init(viewModel: FavoriteAdsListViewModel, isReadOnly: Bool = false) { @@ -161,16 +143,10 @@ public class FavoriteAdsListView: UIView { required init?(coder aDecoder: NSCoder) { fatalError() } - deinit { - contentSizeObserver?.invalidate() - contentSizeObserver = nil - } - // MARK: - Setup private func setup() { addSubview(tableView) - addSubview(footerView) addSubview(scrollShadowView) tableView.addSubview(emptySearchView) @@ -180,11 +156,7 @@ public class FavoriteAdsListView: UIView { tableViewTopConstraint, tableView.leadingAnchor.constraint(equalTo: leadingAnchor), tableView.trailingAnchor.constraint(equalTo: trailingAnchor), - tableViewBottomConstraint, - - footerView.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor), - footerView.leadingAnchor.constraint(equalTo: leadingAnchor), - footerView.trailingAnchor.constraint(equalTo: trailingAnchor), + tableView.bottomAnchor.constraint(equalTo: bottomAnchor), scrollShadowViewTopConstraint, scrollShadowViewHeightConstraint, @@ -197,10 +169,6 @@ public class FavoriteAdsListView: UIView { emptyListView.configure(withImage: viewModel.emptyListViewImage, title: viewModel.emptyListViewTitle, body: viewModel.emptyListViewBody) - - contentSizeObserver = tableView.observe(\UITableView.contentSize, options: [.new], changeHandler: { [weak self] tableView, _ in - self?.footerView.updateShadow(using: tableView) - }) } // MARK: - Overrides @@ -249,8 +217,6 @@ public class FavoriteAdsListView: UIView { let hasScrolledPastTableHeader = tableView.contentOffset.y >= tableHeaderHeight let isContentTallEnoughForAnimatingOffset = tableView.contentSize.height > bounds.height + tableHeaderHeight - setFooterVewHidden(editing || isFooterShareButtonHidden) - if !editing { sendScrollUpdates = true setTableHeader() @@ -332,7 +298,6 @@ public class FavoriteAdsListView: UIView { let shouldShowEmptySearchView = numberOfSections(in: tableView) == 0 emptySearchView.isHidden = !shouldShowEmptySearchView tableHeaderView.isSortingViewHidden = shouldShowEmptySearchView - setFooterVewHidden(shouldShowEmptySearchView || isFooterShareButtonHidden) setTableHeader() } @@ -344,12 +309,6 @@ public class FavoriteAdsListView: UIView { emptyListView.frame = emptySearchView.frame } - private func setFooterVewHidden(_ hidden: Bool) { - footerView.isHidden = hidden - tableViewBottomConstraint.isActive = hidden - tableViewFooterBottomConstraint.isActive = !hidden - } - /// Calculates the correct frame for the `tableHeaderView` on each call to `layoutSubviews`. /// Slightly modified of https://stackoverflow.com/a/54237526 private func layoutTableHeaderView() { @@ -468,7 +427,6 @@ extension FavoriteAdsListView: UITableViewDelegate { public func scrollViewDidScroll(_ scrollView: UIScrollView) { scrollShadowView.updateShadow(using: scrollView) - footerView.updateShadow(using: scrollView) if sendScrollUpdates { let isTitleViewVisible = scrollView.bounds.intersects(tableHeaderView.titleLabelFrame) diff --git a/FinniversKit/Sources/Fullscreen/FavoriteAdsList/FavoriteAdsListViewModel.swift b/FinniversKit/Sources/Fullscreen/FavoriteAdsList/FavoriteAdsListViewModel.swift index ec96f01377..8c17310dfe 100644 --- a/FinniversKit/Sources/Fullscreen/FavoriteAdsList/FavoriteAdsListViewModel.swift +++ b/FinniversKit/Sources/Fullscreen/FavoriteAdsList/FavoriteAdsListViewModel.swift @@ -5,7 +5,6 @@ public struct FavoriteAdsListViewModel { public let searchBarPlaceholder: String public let headerShareButtonTitle: String - public let footerShareButtonTitle: String public let addCommentActionTitle: String public let editCommentActionTitle: String public let deleteAdActionTitle: String @@ -17,7 +16,6 @@ public struct FavoriteAdsListViewModel { public init( searchBarPlaceholder: String, headerShareButtonTitle: String, - footerShareButtonTitle: String, addCommentActionTitle: String, editCommentActionTitle: String, deleteAdActionTitle: String, @@ -28,7 +26,6 @@ public struct FavoriteAdsListViewModel { ) { self.searchBarPlaceholder = searchBarPlaceholder self.headerShareButtonTitle = headerShareButtonTitle - self.footerShareButtonTitle = footerShareButtonTitle self.addCommentActionTitle = addCommentActionTitle self.editCommentActionTitle = editCommentActionTitle self.deleteAdActionTitle = deleteAdActionTitle diff --git a/FinniversKit/Sources/Fullscreen/FavoriteFolderActions/FavoriteFolderActionView.swift b/FinniversKit/Sources/Fullscreen/FavoriteFolderActions/FavoriteFolderActionView.swift index bec8c45921..1a5529071c 100644 --- a/FinniversKit/Sources/Fullscreen/FavoriteFolderActions/FavoriteFolderActionView.swift +++ b/FinniversKit/Sources/Fullscreen/FavoriteFolderActions/FavoriteFolderActionView.swift @@ -71,7 +71,7 @@ public final class FavoriteFolderActionView: UIView { let constant = isShared ? rowHeight : 0 switch self.viewModel.appearance { - case .regular, .xmasFolder: + case .regular: return deleteButton.topAnchor.constraint(equalTo: shareToggleView.bottomAnchor, constant: constant) case .defaultFolder: return shareLinkView.topAnchor.constraint(equalTo: shareToggleView.topAnchor, constant: constant) @@ -188,13 +188,6 @@ public final class FavoriteFolderActionView: UIView { constraints.append(contentsOf: [ shareToggleView.topAnchor.constraint(equalTo: editButton.bottomAnchor) ]) - case .xmasFolder: - addSubview(deleteButton) - - constraints.append(contentsOf: [ - shareToggleView.topAnchor.constraint(equalTo: editButton.bottomAnchor), - shareLinkView.bottomAnchor.constraint(equalTo: deleteButton.topAnchor) - ] + deleteButtonConstraints) } constraints.append(animatingConstraint) @@ -239,8 +232,6 @@ private extension FavoriteFolderActionViewModel.Appearance { return Set(FavoriteFolderAction.allCases) case .defaultFolder: return Set([.edit, .toggleSharing, .shareLink]) - case .xmasFolder: - return Set([.edit, .toggleSharing, .shareLink, .delete]) } } } diff --git a/FinniversKit/Sources/Fullscreen/FavoriteFolderActions/ViewModels/FavoriteFolderActionViewModel.swift b/FinniversKit/Sources/Fullscreen/FavoriteFolderActions/ViewModels/FavoriteFolderActionViewModel.swift index c29a3da04a..6ff3faf9a1 100644 --- a/FinniversKit/Sources/Fullscreen/FavoriteFolderActions/ViewModels/FavoriteFolderActionViewModel.swift +++ b/FinniversKit/Sources/Fullscreen/FavoriteFolderActions/ViewModels/FavoriteFolderActionViewModel.swift @@ -8,7 +8,6 @@ public struct FavoriteFolderActionViewModel { public enum Appearance { case regular case defaultFolder - case xmasFolder } public let appearance: Appearance diff --git a/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListView.swift b/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListView.swift index 4f34f778d9..82c06afa11 100644 --- a/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListView.swift +++ b/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/FavoriteFoldersListView.swift @@ -12,7 +12,6 @@ public protocol FavoriteFoldersListViewDelegate: AnyObject { func favoriteFoldersListViewDidSelectAddButton(_ view: FavoriteFoldersListView, withSearchText searchText: String?) func favoriteFoldersListViewDidFocusSearchBar(_ view: FavoriteFoldersListView) func favoriteFoldersListView(_ view: FavoriteFoldersListView, didChangeSearchText searchText: String) - func favoriteFoldersListViewDidSelectXmasButton(_ view: FavoriteFoldersListView) } public protocol FavoriteFoldersListViewDataSource: AnyObject { @@ -97,20 +96,6 @@ public class FavoriteFoldersListView: UIView { return emptyView }() - private lazy var xmasButton: FloatingButton = { - let button = FloatingButton.favoritesXmasButton() - button.isHidden = true - button.addTarget(self, action: #selector(handleXmasButtonTap), for: .touchUpInside) - return button - }() - - private lazy var xmasCalloutView: CalloutView = { - let view = CalloutView(direction: .down, arrowAlignment: .right(24)) - view.translatesAutoresizingMaskIntoConstraints = false - view.isHidden = true - return view - }() - private lazy var searchBarTop = searchBar.topAnchor.constraint(equalTo: topAnchor) private lazy var footerViewTop = footerView.topAnchor.constraint(equalTo: bottomAnchor) @@ -237,80 +222,18 @@ public class FavoriteFoldersListView: UIView { } } - // MARK: - Xmas button - - public func showXmasButton(withCalloutText text: String?, delay: TimeInterval = 1) { - guard xmasButton.isHidden else { - return - } - - setXmasButtonHidden(false, delay: delay, completion: { - if let text = text { - self.xmasCalloutView.isHidden = false - self.xmasCalloutView.alpha = 0 - self.xmasCalloutView.show(withText: text) - UIImpactFeedbackGenerator(style: .medium).impactOccurred() - } else { - self.xmasCalloutView.isHidden = true - } - }) - } - - public func hideXmasButton(delay: TimeInterval = 0) { - if !xmasCalloutView.isHidden { - xmasCalloutView.hide() - } - - if !xmasButton.isHidden { - setXmasButtonHidden(true, delay: delay, completion: { - self.xmasCalloutView.isHidden = true - }) - } - } - - private func setXmasButtonHidden(_ hidden: Bool, delay: TimeInterval = 0, completion: @escaping () -> Void) { - let customTransform = CGAffineTransform.identity.rotated(by: -1/2 * .pi).scaledBy(x: 0.001, y: 0.001) - xmasButton.isHidden = false - xmasButton.alpha = hidden ? 1 : 0 - xmasButton.transform = hidden ? .identity : customTransform - - UIView.animate( - withDuration: 0.7, - delay: delay, - usingSpringWithDamping: 0.4, - initialSpringVelocity: 7, - options: .curveEaseInOut, - animations: { - self.xmasButton.alpha = hidden ? 0 : 1 - self.xmasButton.transform = hidden ? customTransform : .identity - }, - completion: { _ in - self.xmasButton.isHidden = hidden - completion() - } - ) - } - // MARK: - Setup private func setup() { searchBar.configure(withPlaceholder: viewModel.searchBarPlaceholder) footerView.configure(withTitle: viewModel.addFolderText) - let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: nil) - tapGestureRecognizer.delegate = self - addGestureRecognizer(tapGestureRecognizer) - addSubview(tableView) addSubview(searchBar) addSubview(footerView) - addSubview(xmasButton) - addSubview(xmasCalloutView) tableView.addSubview(emptyView) - let xmasButtonButtom: CGFloat = max(20, windowSafeAreaInsets.bottom) - NSLayoutConstraint.activate([ searchBarTop, searchBar.leadingAnchor.constraint(equalTo: leadingAnchor), @@ -325,15 +248,6 @@ public class FavoriteFoldersListView: UIView { footerView.leadingAnchor.constraint(equalTo: leadingAnchor), footerView.trailingAnchor.constraint(equalTo: trailingAnchor), footerView.heightAnchor.constraint(equalToConstant: footerHeight), - - xmasButton.bottomAnchor.constraint(equalTo: footerView.topAnchor, constant: -xmasButtonButtom), - xmasButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -20), - xmasButton.widthAnchor.constraint(equalToConstant: Warp.Spacing.spacing800), - xmasButton.heightAnchor.constraint(equalTo: xmasButton.widthAnchor), - - xmasCalloutView.bottomAnchor.constraint(equalTo: xmasButton.topAnchor, constant: -Warp.Spacing.spacing100), - xmasCalloutView.trailingAnchor.constraint(equalTo: xmasButton.trailingAnchor), - xmasCalloutView.widthAnchor.constraint(equalToConstant: 256) ]) } @@ -364,10 +278,6 @@ public class FavoriteFoldersListView: UIView { } } - @objc private func handleXmasButtonTap() { - delegate?.favoriteFoldersListViewDidSelectXmasButton(self) - } - @objc private func handleRefreshBegan() { delegate?.favoriteFoldersListViewDidBeginRefreshing(self) } @@ -564,14 +474,3 @@ extension FavoriteFoldersListView: FavoriteSearchEmptyViewDelegate { delegate?.favoriteFoldersListViewDidSelectAddButton(self, withSearchText: searchText) } } - -// MARK: - UIGestureRecognizerDelegate - -extension FavoriteFoldersListView: UIGestureRecognizerDelegate { - public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { - if !xmasCalloutView.isHidden && xmasCalloutView.alpha == 1 { - xmasCalloutView.hide() - } - return false - } -} diff --git a/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/Subviews/FavoriteFolderSelectableViewCell.swift b/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/Subviews/FavoriteFolderSelectableViewCell.swift index 7a98258b63..05f1133f77 100644 --- a/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/Subviews/FavoriteFolderSelectableViewCell.swift +++ b/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/Subviews/FavoriteFolderSelectableViewCell.swift @@ -85,12 +85,6 @@ public class FavoriteFolderSelectableViewCell: RemoteImageTableViewCell { titleLabel.font = titleLabelSelectedFont } - isLoadingEnabled = !viewModel.isXmas - - if viewModel.isXmas { - fallbackImage = UIImage(named: .favoritesXmasFolder) - } - checkmarkImageView.isHidden = !viewModel.isSelected || isEditing || showDetailLabel setNeedsLayout() } diff --git a/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/Subviews/FloatingButton+Favorites.swift b/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/Subviews/FloatingButton+Favorites.swift deleted file mode 100644 index 5ff6987391..0000000000 --- a/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/Subviews/FloatingButton+Favorites.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// Copyright © FINN.no AS, Inc. All rights reserved. -// - -import UIKit -import Warp - -public extension FloatingButton { - static func favoritesXmasButton(withTarget target: Any? = nil, action: Selector? = nil) -> FloatingButton { - let button = FloatingButton(withAutoLayout: true, style: .favoritesXmasButtonStyle) - button.setImage(UIImage(named: .favoritesXmasButton).withRenderingMode(.alwaysTemplate), for: .normal) - - if let target = target, let action = action { - button.addTarget(target, action: action, for: .touchUpInside) - } - - return button - } -} - -public extension FloatingButton.Style { - static var favoritesXmasButtonStyle: FloatingButton.Style { - FloatingButton.Style( - tintColor: .white, - titleColor: .textInverted, - primaryBackgroundColor: .backgroundNegative, - highlightedBackgroundColor: .backgroundNegativeActive, - borderWidth: Warp.Spacing.spacing50, - borderColor: .white, - badgeBackgroundColor: .backgroundPrimary, - badgeTextColor: .text, - badgeSize: 30, - shadowColor: .black.withAlphaComponent(0.6), - shadowOffset: CGSize(width: 0, height: 5), - shadowRadius: 8 - ) - } -} diff --git a/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/ViewModels/FavoriteFolderViewModel.swift b/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/ViewModels/FavoriteFolderViewModel.swift index 20d2c2717d..3eafbb4b58 100644 --- a/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/ViewModels/FavoriteFolderViewModel.swift +++ b/FinniversKit/Sources/Recycling/ListViews/FavoriteFolders/ViewModels/FavoriteFolderViewModel.swift @@ -7,7 +7,6 @@ import Foundation public protocol FavoriteFolderViewModel: RemoteImageTableViewCellViewModel { var isSelected: Bool { get } var isDefault: Bool { get } - var isXmas: Bool { get } } public extension FavoriteFolderViewModel {