From 5e73439e7bfa11f4c7a654a9e75ca201d7392787 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 16 Jan 2023 14:21:42 -0500 Subject: [PATCH] Fix statuses being inset too much on iPhones --- Tusker/Screens/Explore/TrendingStatusesViewController.swift | 4 +++- Tusker/Screens/Profile/ProfileStatusesViewController.swift | 4 +++- Tusker/Screens/Timeline/TimelineViewController.swift | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Tusker/Screens/Explore/TrendingStatusesViewController.swift b/Tusker/Screens/Explore/TrendingStatusesViewController.swift index 95b97fc9..3abb1ef9 100644 --- a/Tusker/Screens/Explore/TrendingStatusesViewController.swift +++ b/Tusker/Screens/Explore/TrendingStatusesViewController.swift @@ -62,7 +62,9 @@ class TrendingStatusesViewController: UIViewController { } let layout = UICollectionViewCompositionalLayout { sectionIndex, environment in let section = NSCollectionLayoutSection.list(using: config, layoutEnvironment: environment) - section.contentInsetsReference = .readableContent + if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac { + section.contentInsetsReference = .readableContent + } return section } view = UICollectionView(frame: .zero, collectionViewLayout: layout) diff --git a/Tusker/Screens/Profile/ProfileStatusesViewController.swift b/Tusker/Screens/Profile/ProfileStatusesViewController.swift index 506e5537..dfec9b66 100644 --- a/Tusker/Screens/Profile/ProfileStatusesViewController.swift +++ b/Tusker/Screens/Profile/ProfileStatusesViewController.swift @@ -85,7 +85,9 @@ class ProfileStatusesViewController: UIViewController, TimelineLikeCollectionVie return .list(using: .init(appearance: .plain), layoutEnvironment: environment) } else { let section = NSCollectionLayoutSection.list(using: config, layoutEnvironment: environment) - section.contentInsetsReference = .readableContent + if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac { + section.contentInsetsReference = .readableContent + } return section } } diff --git a/Tusker/Screens/Timeline/TimelineViewController.swift b/Tusker/Screens/Timeline/TimelineViewController.swift index b5737552..e85f83cb 100644 --- a/Tusker/Screens/Timeline/TimelineViewController.swift +++ b/Tusker/Screens/Timeline/TimelineViewController.swift @@ -90,7 +90,9 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro // just setting layout.configuration.contentInsetsReference doesn't work with UICollectionViewCompositionalLayout.list let layout = UICollectionViewCompositionalLayout { sectionIndex, environment in let section = NSCollectionLayoutSection.list(using: config, layoutEnvironment: environment) - section.contentInsetsReference = .readableContent + if UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac { + section.contentInsetsReference = .readableContent + } return section } collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)