Skip to content

Commit

Permalink
iPad
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
  • Loading branch information
marinofaggiana committed Sep 24, 2024
1 parent 396dc76 commit b9866d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS

var lastScale: CGFloat = 1.0
var currentScale: CGFloat = 1.0
let maxColumns: Int = 10
var maxColumns: Int {
let screenWidth = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
let column = Int(screenWidth / 44)

return column
}
var transitionColumns = false
var numberOfColumns: Int = 0
var lastNumberOfColumns: Int = 0
Expand Down
7 changes: 6 additions & 1 deletion iOSClient/Media/NCMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ class NCMedia: UIViewController {

var lastScale: CGFloat = 1.0
var currentScale: CGFloat = 1.0
let maxColumns: Int = 10
var maxColumns: Int {
let screenWidth = min(UIScreen.main.bounds.width, UIScreen.main.bounds.height)
let column = Int(screenWidth / 44)

return column
}
var transitionColumns = false
var numberOfColumns: Int = 0
var lastNumberOfColumns: Int = 0
Expand Down
4 changes: 0 additions & 4 deletions iOSClient/Media/NCMediaLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ public class NCMediaLayout: UICollectionViewLayout {

columnCount = delegate.getColumnCount()
(delegate as? NCMedia)?.buildMediaPhotoVideo(columnCount: columnCount)
if UIDevice.current.userInterfaceIdiom == .phone,
(UIDevice.current.orientation == .landscapeLeft || UIDevice.current.orientation == .landscapeRight) {
columnCount += 2
}

// Initialize variables
headersAttribute.removeAll(keepingCapacity: false)
Expand Down

0 comments on commit b9866d1

Please sign in to comment.