Skip to content

Commit 4326744

Browse files
authored
Merge pull request #2254 from DimensionDev/feature/disable-grid-in-iphone
disable grid in iphone
2 parents 01301cb + e01d848 commit 4326744

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

appleApp/ios/UI/Component/TimelinePagingView.swift

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import SwiftUI
2+
import UIKit
23
import KotlinSharedUI
34
import FlareAppleUI
45

@@ -37,19 +38,26 @@ struct UITimelinePagingView: View {
3738
singleListView
3839
} else {
3940
GeometryReader { proxy in
40-
let columnCount = max(Int((proxy.size.width / 320).rounded(.down)), 1)
41-
UITimelineCollectionView(
42-
data: data,
43-
detailStatusKey: detailStatusKey,
44-
topContentInset: topContentInset,
45-
columnCount: columnCount,
46-
suppressInitialRefreshIndicator: suppressInitialRefreshIndicator
47-
)
48-
.ignoresSafeArea(edges: .vertical)
41+
if isIPhoneLandscape(size: proxy.size) {
42+
singleListView
43+
} else {
44+
UITimelineCollectionView(
45+
data: data,
46+
detailStatusKey: detailStatusKey,
47+
topContentInset: topContentInset,
48+
columnCount: max(Int((proxy.size.width / 320).rounded(.down)), 1),
49+
suppressInitialRefreshIndicator: suppressInitialRefreshIndicator
50+
)
51+
.ignoresSafeArea(edges: .vertical)
52+
}
4953
}
5054
}
5155
}
5256

57+
private func isIPhoneLandscape(size: CGSize) -> Bool {
58+
UIDevice.current.userInterfaceIdiom == .phone && size.width > size.height
59+
}
60+
5361
var singleListView: some View {
5462
UITimelineCollectionView(
5563
data: data,

0 commit comments

Comments
 (0)