Compare commits

...

2 Commits

8 changed files with 18 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import Pachyderm
class AccountFollowsListViewController: UIViewController, CollectionViewController {
private static let pageSize = 40
private static nonisolated let pageSize = 40
let accountID: String
let mastodonController: MastodonController

View File

@ -102,6 +102,12 @@ class TrendsViewController: UIViewController, CollectionViewController {
config.topSeparatorVisibility = .hidden
config.bottomSeparatorVisibility = .hidden
}
if config.topSeparatorInsets != .zero {
config.topSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
}
if config.bottomSeparatorInsets != .zero {
config.bottomSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
}
return config
}
return .list(using: listConfig, layoutEnvironment: environment)

View File

@ -78,6 +78,7 @@ class ProfileStatusesViewController: UIViewController, TimelineLikeCollectionVie
} else if indexPath.row == 0 && (section == .pinned || section == .entries) {
// TODO: row == 0 isn't technically right, the top post could be filtered out
config.topSeparatorInsets = .zero
config.bottomSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
} else if case .status(id: _, collapseState: _, filterState: let filterState, pinned: _) = item,
filterer.isKnownHide(state: filterState) {
config.topSeparatorVisibility = .hidden

View File

@ -93,7 +93,7 @@ class SearchResultsViewController: UIViewController, CollectionViewController {
config.trailingSwipeActionsConfigurationProvider = { [unowned self] in
(self.collectionView.cellForItem(at: $0) as? TimelineStatusCollectionViewCell)?.trailingSwipeActions()
}
if sectionIdentifier == .statuses {
if sectionIdentifier == .statuses || sectionIdentifier == .accounts {
config.separatorConfiguration.topSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
config.separatorConfiguration.bottomSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
}

View File

@ -57,6 +57,12 @@ class StatusActionAccountListCollectionViewController: UIViewController, Collect
config.topSeparatorVisibility = .hidden
config.bottomSeparatorVisibility = .hidden
}
if config.topSeparatorInsets != .zero {
config.topSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
}
if config.bottomSeparatorInsets != .zero {
config.bottomSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
}
return config
}
let layout = UICollectionViewCompositionalLayout { [unowned self] sectionIndex, environment in

View File

@ -33,6 +33,7 @@ struct AccountDisplayNameView: View {
.onAppear(perform: self.loadEmojis)
}
@MainActor
private func loadEmojis() {
let fullRange = NSRange(account.displayName.startIndex..., in: account.displayName)
let matches = emojiRegex.matches(in: account.displayName, options: [], range: fullRange)

View File

@ -33,6 +33,7 @@ struct CustomEmojiImageView: View {
}
}
@MainActor
private func loadImage() {
request = ImageCache.emojis.get(URL(emoji.url)!) { (_, image) in
DispatchQueue.main.async {

View File

@ -15,7 +15,7 @@ private let hashtagIcon = UIImage(systemName: "number")
class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollectionViewCell {
static let separatorInsets = NSDirectionalEdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 0)
static let separatorInsets = NSDirectionalEdgeInsets(top: 0, leading: 16 + 50 + 8, bottom: 0, trailing: 0)
static let contentFont = UIFontMetrics.default.scaledFont(for: .systemFont(ofSize: 16))
static let monospaceFont = UIFontMetrics.default.scaledFont(for: .monospacedSystemFont(ofSize: 16, weight: .regular))
static let contentParagraphStyle = HTMLConverter.defaultParagraphStyle