Compare commits
3 Commits
cced930549
...
afcec24f86
Author | SHA1 | Date |
---|---|---|
Shadowfacts | afcec24f86 | |
Shadowfacts | 3f90a0df04 | |
Shadowfacts | 395ce6523d |
|
@ -8,7 +8,7 @@
|
|||
import Foundation
|
||||
|
||||
@MainActor
|
||||
public protocol GalleryContentViewControllerContainer {
|
||||
public protocol GalleryContentViewControllerContainer: AnyObject {
|
||||
var galleryControlsVisible: Bool { get }
|
||||
|
||||
func setGalleryContentLoading(_ loading: Bool)
|
||||
|
|
|
@ -10,7 +10,7 @@ import UIKit
|
|||
@MainActor
|
||||
class GalleryDismissInteraction: NSObject {
|
||||
|
||||
private let viewController: GalleryViewController
|
||||
private unowned let viewController: GalleryViewController
|
||||
|
||||
private var content: GalleryContentViewController?
|
||||
private var origContentFrameInGallery: CGRect?
|
||||
|
|
|
@ -52,6 +52,12 @@ class AccountFollowsListViewController: UIViewController, CollectionViewControll
|
|||
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 { sectionIndex, environment in
|
||||
|
|
|
@ -33,6 +33,8 @@ class AccountListViewController: UIViewController, CollectionViewController {
|
|||
override func loadView() {
|
||||
var config = UICollectionLayoutListConfiguration(appearance: .grouped)
|
||||
config.backgroundColor = .appGroupedBackground
|
||||
config.separatorConfiguration.topSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
|
||||
config.separatorConfiguration.bottomSeparatorInsets = TimelineStatusCollectionViewCell.separatorInsets
|
||||
let layout = UICollectionViewCompositionalLayout { sectionIndex, environment in
|
||||
let section = NSCollectionLayoutSection.list(using: config, layoutEnvironment: environment)
|
||||
section.readableContentInset(in: environment)
|
||||
|
|
|
@ -70,7 +70,7 @@ class FallbackGalleryNavigationController: UINavigationController, GalleryConten
|
|||
|
||||
// MARK: GalleryContentViewController
|
||||
|
||||
var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||
weak var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||
|
||||
var contentSize: CGSize {
|
||||
.zero
|
||||
|
|
|
@ -59,7 +59,7 @@ class GifvGalleryContentViewController: UIViewController, GalleryContentViewCont
|
|||
|
||||
// MARK: GalleryContentViewController
|
||||
|
||||
var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||
weak var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||
|
||||
var contentSize: CGSize {
|
||||
controller.item.presentationSize
|
||||
|
|
|
@ -114,7 +114,7 @@ class ImageGalleryContentViewController: UIViewController, GalleryContentViewCon
|
|||
|
||||
// MARK: GalleryContentViewController
|
||||
|
||||
var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||
weak var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||
|
||||
var contentSize: CGSize {
|
||||
image.size
|
||||
|
|
|
@ -13,7 +13,7 @@ class LoadingGalleryContentViewController: UIViewController, GalleryContentViewC
|
|||
private let provider: () async -> (any GalleryContentViewController)?
|
||||
private var wrapped: (any GalleryContentViewController)!
|
||||
|
||||
var container: GalleryContentViewControllerContainer?
|
||||
weak var container: GalleryContentViewControllerContainer?
|
||||
|
||||
var contentSize: CGSize {
|
||||
wrapped?.contentSize ?? .zero
|
||||
|
|
|
@ -132,7 +132,7 @@ class VideoGalleryContentViewController: UIViewController, GalleryContentViewCon
|
|||
|
||||
// MARK: GalleryContentViewController
|
||||
|
||||
var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||
weak var container: (any GalleryVC.GalleryContentViewControllerContainer)?
|
||||
|
||||
var contentSize: CGSize {
|
||||
item.presentationSize
|
||||
|
|
|
@ -29,6 +29,7 @@ class GifvController {
|
|||
self.isGrayscale = Preferences.shared.grayscaleImages
|
||||
|
||||
player.isMuted = true
|
||||
player.preventsDisplaySleepDuringVideoPlayback = false
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(restartItem), name: .AVPlayerItemDidPlayToEndTime, object: item)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(preferencesChanged), name: .preferencesChanged, object: nil)
|
||||
|
|
Loading…
Reference in New Issue