diff --git a/Mastodon.xcodeproj/project.pbxproj b/Mastodon.xcodeproj/project.pbxproj index f545b5138..14de9fc4b 100644 --- a/Mastodon.xcodeproj/project.pbxproj +++ b/Mastodon.xcodeproj/project.pbxproj @@ -37,7 +37,7 @@ 2D152A9225C2980C009AA50C /* UIFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D152A9125C2980C009AA50C /* UIFont.swift */; }; 2D198643261BF09500F0B013 /* SearchResultItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D198642261BF09500F0B013 /* SearchResultItem.swift */; }; 2D198649261C0B8500F0B013 /* SearchResultSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D198648261C0B8500F0B013 /* SearchResultSection.swift */; }; - 2D19864F261C372A00F0B013 /* SearchBottomLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D19864E261C372A00F0B013 /* SearchBottomLoader.swift */; }; + 2D19864F261C372A00F0B013 /* CommonBottomLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D19864E261C372A00F0B013 /* CommonBottomLoader.swift */; }; 2D198655261C3C4300F0B013 /* SearchViewModel+LoadOldestState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D198654261C3C4300F0B013 /* SearchViewModel+LoadOldestState.swift */; }; 2D206B7225F5D27F00143C56 /* AudioContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D206B7125F5D27F00143C56 /* AudioContainerView.swift */; }; 2D206B8025F5F45E00143C56 /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D206B7F25F5F45E00143C56 /* UIImage.swift */; }; @@ -426,7 +426,7 @@ 2D152A9125C2980C009AA50C /* UIFont.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIFont.swift; sourceTree = ""; }; 2D198642261BF09500F0B013 /* SearchResultItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultItem.swift; sourceTree = ""; }; 2D198648261C0B8500F0B013 /* SearchResultSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultSection.swift; sourceTree = ""; }; - 2D19864E261C372A00F0B013 /* SearchBottomLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBottomLoader.swift; sourceTree = ""; }; + 2D19864E261C372A00F0B013 /* CommonBottomLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonBottomLoader.swift; sourceTree = ""; }; 2D198654261C3C4300F0B013 /* SearchViewModel+LoadOldestState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SearchViewModel+LoadOldestState.swift"; sourceTree = ""; }; 2D206B7125F5D27F00143C56 /* AudioContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioContainerView.swift; sourceTree = ""; }; 2D206B7F25F5F45E00143C56 /* UIImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = ""; }; @@ -1152,7 +1152,7 @@ isa = PBXGroup; children = ( 2DFAD5362617010500F9EE7C /* SearchingTableViewCell.swift */, - 2D19864E261C372A00F0B013 /* SearchBottomLoader.swift */, + 2D19864E261C372A00F0B013 /* CommonBottomLoader.swift */, ); path = TableViewCell; sourceTree = ""; @@ -2269,7 +2269,7 @@ DBB5256E2612D5A1002F1F29 /* ProfileStatusDashboardView.swift in Sources */, 2D24E1232626ED9D00A59D4F /* UIView+Gesture.swift in Sources */, DB45FAE325CA7181005A8AC7 /* MastodonUser.swift in Sources */, - 2D19864F261C372A00F0B013 /* SearchBottomLoader.swift in Sources */, + 2D19864F261C372A00F0B013 /* CommonBottomLoader.swift in Sources */, DB2FF510260B113300ADA9FE /* ComposeStatusPollExpiresOptionCollectionViewCell.swift in Sources */, 0F202213261351F5000C64BF /* APIService+HashtagTimeline.swift in Sources */, DB0AC6FC25CD02E600D75117 /* APIService+Instance.swift in Sources */, diff --git a/Mastodon/Diffiable/Section/NotificationSection.swift b/Mastodon/Diffiable/Section/NotificationSection.swift index 74b5d6a40..01273e9f4 100644 --- a/Mastodon/Diffiable/Section/NotificationSection.swift +++ b/Mastodon/Diffiable/Section/NotificationSection.swift @@ -128,7 +128,7 @@ extension NotificationSection { return cell } case .bottomLoader: - let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: SearchBottomLoader.self)) as! SearchBottomLoader + let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: CommonBottomLoader.self)) as! CommonBottomLoader cell.startAnimating() return cell } @@ -149,8 +149,11 @@ extension NotificationSection { ) { // disable interaction cell.statusView.isUserInteractionEnabled = false - // remove actionToolBar + // remove item don't display cell.statusView.actionToolbarContainer.removeFromSuperview() + cell.statusView.avatarView.removeFromSuperview() + + // setup attribute statusItemAttribute.setupForStatus(status: status) diff --git a/Mastodon/Diffiable/Section/SearchResultSection.swift b/Mastodon/Diffiable/Section/SearchResultSection.swift index 50c561605..e01063c86 100644 --- a/Mastodon/Diffiable/Section/SearchResultSection.swift +++ b/Mastodon/Diffiable/Section/SearchResultSection.swift @@ -44,7 +44,7 @@ extension SearchResultSection { cell.config(with: user) return cell case .bottomLoader: - let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: SearchBottomLoader.self)) as! SearchBottomLoader + let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: CommonBottomLoader.self)) as! CommonBottomLoader cell.startAnimating() return cell } diff --git a/Mastodon/Generated/Assets.swift b/Mastodon/Generated/Assets.swift index a9963ce9c..40eda8019 100644 --- a/Mastodon/Generated/Assets.swift +++ b/Mastodon/Generated/Assets.swift @@ -44,7 +44,7 @@ internal enum Asset { internal static let mediaTypeIndicotor = ColorAsset(name: "Colors/Background/media.type.indicotor") internal static let navigationBar = ColorAsset(name: "Colors/Background/navigationBar") internal static let onboardingBackground = ColorAsset(name: "Colors/Background/onboarding.background") - internal static let searchResult = ColorAsset(name: "Colors/Background/searchResult") + internal static let pure = ColorAsset(name: "Colors/Background/pure") internal static let secondaryGroupedSystemBackground = ColorAsset(name: "Colors/Background/secondary.grouped.system.background") internal static let secondarySystemBackground = ColorAsset(name: "Colors/Background/secondary.system.background") internal static let systemBackground = ColorAsset(name: "Colors/Background/system.background") diff --git a/Mastodon/Resources/Assets.xcassets/Colors/Background/searchResult.colorset/Contents.json b/Mastodon/Resources/Assets.xcassets/Colors/Background/pure.colorset/Contents.json similarity index 100% rename from Mastodon/Resources/Assets.xcassets/Colors/Background/searchResult.colorset/Contents.json rename to Mastodon/Resources/Assets.xcassets/Colors/Background/pure.colorset/Contents.json diff --git a/Mastodon/Scene/Notification/NotificationViewController.swift b/Mastodon/Scene/Notification/NotificationViewController.swift index 86c21a2c5..8d04674f4 100644 --- a/Mastodon/Scene/Notification/NotificationViewController.swift +++ b/Mastodon/Scene/Notification/NotificationViewController.swift @@ -33,7 +33,7 @@ final class NotificationViewController: UIViewController, NeedsDependency { tableView.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) tableView.register(NotificationTableViewCell.self, forCellReuseIdentifier: String(describing: NotificationTableViewCell.self)) tableView.register(NotificationStatusTableViewCell.self, forCellReuseIdentifier: String(describing: NotificationStatusTableViewCell.self)) - tableView.register(SearchBottomLoader.self, forCellReuseIdentifier: String(describing: SearchBottomLoader.self)) + tableView.register(CommonBottomLoader.self, forCellReuseIdentifier: String(describing: CommonBottomLoader.self)) tableView.tableFooterView = UIView() tableView.rowHeight = UITableView.automaticDimension return tableView @@ -47,7 +47,7 @@ extension NotificationViewController { override func viewDidLoad() { super.viewDidLoad() - view.backgroundColor = Asset.Colors.Background.searchResult.color + view.backgroundColor = Asset.Colors.Background.pure.color navigationItem.titleView = segmentControl segmentControl.addTarget(self, action: #selector(NotificationViewController.segmentedControlValueChanged(_:)), for: .valueChanged) view.addSubview(tableView) diff --git a/Mastodon/Scene/Notification/TableViewCell/NotificationStatusTableViewCell.swift b/Mastodon/Scene/Notification/TableViewCell/NotificationStatusTableViewCell.swift index 4731b4e1b..37b745990 100644 --- a/Mastodon/Scene/Notification/TableViewCell/NotificationStatusTableViewCell.swift +++ b/Mastodon/Scene/Notification/TableViewCell/NotificationStatusTableViewCell.swift @@ -27,7 +27,7 @@ final class NotificationStatusTableViewCell: UITableViewCell { let actionImageView: UIImageView = { let imageView = UIImageView() - imageView.tintColor = Asset.Colors.Background.searchResult.color + imageView.tintColor = Asset.Colors.Background.pure.color return imageView }() @@ -37,8 +37,8 @@ final class NotificationStatusTableViewCell: UITableViewCell { view.layer.cornerCurve = .continuous view.clipsToBounds = true view.layer.borderWidth = NotificationStatusTableViewCell.actionImageBorderWidth - view.layer.borderColor = Asset.Colors.Background.searchResult.color.cgColor - view.tintColor = Asset.Colors.Background.searchResult.color + view.layer.borderColor = Asset.Colors.Background.pure.color.cgColor + view.tintColor = Asset.Colors.Background.pure.color return view }() @@ -143,6 +143,6 @@ extension NotificationStatusTableViewCell { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) statusContainer.layer.borderColor = Asset.Colors.Border.notification.color.cgColor - actionImageBackground.layer.borderColor = Asset.Colors.Background.searchResult.color.cgColor + actionImageBackground.layer.borderColor = Asset.Colors.Background.pure.color.cgColor } } diff --git a/Mastodon/Scene/Notification/TableViewCell/NotificationTableViewCell.swift b/Mastodon/Scene/Notification/TableViewCell/NotificationTableViewCell.swift index 1068e7732..a10ff01d6 100644 --- a/Mastodon/Scene/Notification/TableViewCell/NotificationTableViewCell.swift +++ b/Mastodon/Scene/Notification/TableViewCell/NotificationTableViewCell.swift @@ -35,7 +35,7 @@ final class NotificationTableViewCell: UITableViewCell { let actionImageView: UIImageView = { let imageView = UIImageView() - imageView.tintColor = Asset.Colors.Background.searchResult.color + imageView.tintColor = Asset.Colors.Background.pure.color return imageView }() @@ -45,8 +45,8 @@ final class NotificationTableViewCell: UITableViewCell { view.layer.cornerCurve = .continuous view.clipsToBounds = true view.layer.borderWidth = NotificationTableViewCell.actionImageBorderWidth - view.layer.borderColor = Asset.Colors.Background.searchResult.color.cgColor - view.tintColor = Asset.Colors.Background.searchResult.color + view.layer.borderColor = Asset.Colors.Background.pure.color.cgColor + view.tintColor = Asset.Colors.Background.pure.color return view }() @@ -116,6 +116,6 @@ extension NotificationTableViewCell { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - actionImageBackground.layer.borderColor = Asset.Colors.Background.searchResult.color.cgColor + actionImageBackground.layer.borderColor = Asset.Colors.Background.pure.color.cgColor } } diff --git a/Mastodon/Scene/Search/SearchViewController+Searching.swift b/Mastodon/Scene/Search/SearchViewController+Searching.swift index 3eb9793ad..43e5d397c 100644 --- a/Mastodon/Scene/Search/SearchViewController+Searching.swift +++ b/Mastodon/Scene/Search/SearchViewController+Searching.swift @@ -17,7 +17,7 @@ extension SearchViewController { func setupSearchingTableView() { searchingTableView.delegate = self searchingTableView.register(SearchingTableViewCell.self, forCellReuseIdentifier: String(describing: SearchingTableViewCell.self)) - searchingTableView.register(SearchBottomLoader.self, forCellReuseIdentifier: String(describing: SearchBottomLoader.self)) + searchingTableView.register(CommonBottomLoader.self, forCellReuseIdentifier: String(describing: CommonBottomLoader.self)) view.addSubview(searchingTableView) searchingTableView.constrain([ searchingTableView.frameLayoutGuide.topAnchor.constraint(equalTo: searchBar.bottomAnchor), diff --git a/Mastodon/Scene/Search/SearchViewController.swift b/Mastodon/Scene/Search/SearchViewController.swift index 5dcc47e02..dc9414585 100644 --- a/Mastodon/Scene/Search/SearchViewController.swift +++ b/Mastodon/Scene/Search/SearchViewController.swift @@ -82,7 +82,7 @@ final class SearchViewController: UIViewController, NeedsDependency { // searching let searchingTableView: UITableView = { let tableView = UITableView() - tableView.backgroundColor = Asset.Colors.Background.searchResult.color + tableView.backgroundColor = Asset.Colors.Background.pure.color tableView.rowHeight = UITableView.automaticDimension tableView.separatorStyle = .singleLine tableView.separatorInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) @@ -227,7 +227,7 @@ extension SearchViewController: UISearchBarDelegate { } extension SearchViewController: LoadMoreConfigurableTableViewContainer { - typealias BottomLoaderTableViewCell = SearchBottomLoader + typealias BottomLoaderTableViewCell = CommonBottomLoader typealias LoadingState = SearchViewModel.LoadOldestState.Loading var loadMoreConfigurableTableView: UITableView { searchingTableView } var loadMoreConfigurableStateMachine: GKStateMachine { viewModel.loadoldestStateMachine } diff --git a/Mastodon/Scene/Search/TableViewCell/SearchBottomLoader.swift b/Mastodon/Scene/Search/TableViewCell/CommonBottomLoader.swift similarity index 94% rename from Mastodon/Scene/Search/TableViewCell/SearchBottomLoader.swift rename to Mastodon/Scene/Search/TableViewCell/CommonBottomLoader.swift index 923a06301..bb2ae9ce0 100644 --- a/Mastodon/Scene/Search/TableViewCell/SearchBottomLoader.swift +++ b/Mastodon/Scene/Search/TableViewCell/CommonBottomLoader.swift @@ -1,5 +1,5 @@ // -// SearchBottomLoader.swift +// CommonBottomLoader.swift // Mastodon // // Created by sxiaojian on 2021/4/6. @@ -8,7 +8,7 @@ import Foundation import UIKit -final class SearchBottomLoader: UITableViewCell { +final class CommonBottomLoader: UITableViewCell { let activityIndicatorView: UIActivityIndicatorView = { let activityIndicatorView = UIActivityIndicatorView(style: .medium) activityIndicatorView.tintColor = Asset.Colors.Label.primary.color