Pārlūkot izejas kodu

Allow rotaion in the attachment gallery

Closes #77
master
Shadowfacts 1 mēnesi atpakaļ
vecāks
revīzija
bb86e1aafd
Parakstījis: Shadowfacts <me@shadowfacts.net> GPG atslēgas ID: 94A5AB95422746E5

+ 2
- 0
Tusker/Info.plist Parādīt failu

@@ -69,6 +69,8 @@
69 69
 	<key>UISupportedInterfaceOrientations</key>
70 70
 	<array>
71 71
 		<string>UIInterfaceOrientationPortrait</string>
72
+		<string>UIInterfaceOrientationLandscapeRight</string>
73
+		<string>UIInterfaceOrientationLandscapeLeft</string>
72 74
 	</array>
73 75
 	<key>UISupportedInterfaceOrientations~ipad</key>
74 76
 	<array>

+ 8
- 0
Tusker/Screens/Gallery/GalleryViewController.swift Parādīt failu

@@ -35,6 +35,14 @@ class GalleryViewController: UIPageViewController, UIPageViewControllerDataSourc
35 35
         return viewControllers?.first
36 36
     }
37 37
     
38
+    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
39
+        if UIDevice.current.userInterfaceIdiom == .phone {
40
+            return .allButUpsideDown
41
+        } else {
42
+            return .all
43
+        }
44
+    }
45
+    
38 46
     init(attachments: [Attachment], sourcesInfo: [LargeImageViewController.SourceInfo?], startIndex: Int) {
39 47
         self.attachments = attachments
40 48
         self.sourcesInfo = sourcesInfo

+ 8
- 0
Tusker/Screens/Main/MainTabBarViewController.swift Parādīt failu

@@ -10,6 +10,14 @@ import UIKit
10 10
 
11 11
 class MainTabBarViewController: UITabBarController, UITabBarControllerDelegate {
12 12
 
13
+    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
14
+        if UIDevice.current.userInterfaceIdiom == .phone {
15
+            return .portrait
16
+        } else {
17
+            return .all
18
+        }
19
+    }
20
+    
13 21
     override func viewDidLoad() {
14 22
         super.viewDidLoad()
15 23
 

+ 8
- 0
Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift Parādīt failu

@@ -29,6 +29,14 @@ class InstanceSelectorTableViewController: UITableViewController {
29 29
     var urlHandler: AnyCancellable?
30 30
     var currentQuery: String?
31 31
     
32
+    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
33
+        if UIDevice.current.userInterfaceIdiom == .phone {
34
+            return .portrait
35
+        } else {
36
+            return .all
37
+        }
38
+    }
39
+    
32 40
     init() {
33 41
         super.init(style: .grouped)
34 42
         

Notiek ielāde…
Atcelt
Saglabāt