@applicaster/quick-brick-native-apple 5.20.8 → 5.20.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "QuickBrickApple",
|
|
3
|
-
"version": "5.20.
|
|
3
|
+
"version": "5.20.10",
|
|
4
4
|
"platforms": {
|
|
5
5
|
"ios": "14.0",
|
|
6
6
|
"tvos": "14.0"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"authors": "Applicaster LTD.",
|
|
17
17
|
"source": {
|
|
18
18
|
"git": "https://github.com/applicaster/Zapp-Frameworks.git",
|
|
19
|
-
"tag": "@@applicaster/quick-brick-native-apple/5.20.
|
|
19
|
+
"tag": "@@applicaster/quick-brick-native-apple/5.20.10"
|
|
20
20
|
},
|
|
21
21
|
"requires_arc": true,
|
|
22
22
|
"source_files": "universal/**/*.{m,swift}",
|
|
@@ -18,7 +18,6 @@ class QuickBrickViewController: UIViewController, UILayerViewControllerProtocol
|
|
|
18
18
|
|
|
19
19
|
lazy var logger = Logger.getLogger(for: QuickBrickViewControllerLogs.subsystem)
|
|
20
20
|
|
|
21
|
-
var orientationStack = [UIInterfaceOrientationMask.all]
|
|
22
21
|
var orientationMask: UIInterfaceOrientationMask = QuickBrickViewController.initialOrientationMask
|
|
23
22
|
|
|
24
23
|
override public var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
|
@@ -69,19 +68,9 @@ class QuickBrickViewController: UIViewController, UILayerViewControllerProtocol
|
|
|
69
68
|
|
|
70
69
|
public func allowOrientationForScreen(_ orientation: ReactNativeOrientation) {
|
|
71
70
|
orientationMask = orientation.toInterfaceOrientationMask()
|
|
72
|
-
// TODO: Remove orientation stack
|
|
73
|
-
orientationStack.append(orientationMask)
|
|
74
71
|
forceOrientationWithMaskIfNeeded(orientationMask)
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
/// Release Orientation for specific screen to previous state
|
|
78
|
-
public func releaseOrientationForScreen() {
|
|
79
|
-
if orientationStack.count > 1 {
|
|
80
|
-
_ = orientationStack.dropLast()
|
|
81
|
-
forceOrientationWithMaskIfNeeded(orientationStack.last ?? UIInterfaceOrientationMask.all)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
74
|
override func viewWillTransition(to size: CGSize,
|
|
86
75
|
with coordinator: UIViewControllerTransitionCoordinator) {
|
|
87
76
|
super.viewWillTransition(to: size, with: coordinator)
|
|
@@ -176,14 +165,14 @@ class QuickBrickViewController: UIViewController, UILayerViewControllerProtocol
|
|
|
176
165
|
}
|
|
177
166
|
|
|
178
167
|
if orientationMask == .landscapeRight {
|
|
179
|
-
setDeviceOrientation(
|
|
168
|
+
setDeviceOrientation(.landscapeLeft)
|
|
180
169
|
} else if orientationMask == .landscapeLeft {
|
|
181
|
-
setDeviceOrientation(
|
|
170
|
+
setDeviceOrientation(.landscapeRight)
|
|
182
171
|
} else if orientationMask == .landscape {
|
|
183
172
|
if currentDeviceOrientation == .landscapeLeft || currentDeviceOrientation == .landscapeRight {
|
|
184
173
|
setDeviceOrientation(currentDeviceOrientation)
|
|
185
174
|
} else {
|
|
186
|
-
setDeviceOrientation(
|
|
175
|
+
setDeviceOrientation(.landscapeLeft)
|
|
187
176
|
}
|
|
188
177
|
|
|
189
178
|
} else if orientationMask == .portrait {
|
|
@@ -31,7 +31,6 @@ enum Events: String {
|
|
|
31
31
|
case quickBrickReady
|
|
32
32
|
case moveAppToBackground
|
|
33
33
|
case allowedOrientationsForScreen
|
|
34
|
-
case releaseOrientationsForScreen
|
|
35
34
|
case idleTimerDisabled
|
|
36
35
|
case forceAppReload
|
|
37
36
|
case setPrefersHomeIndicatorAutoHidden
|
|
@@ -49,8 +48,6 @@ enum Events: String {
|
|
|
49
48
|
manager.moveAppToBackground()
|
|
50
49
|
case .allowedOrientationsForScreen:
|
|
51
50
|
manager.allowOrientationForScreen(payload)
|
|
52
|
-
case .releaseOrientationsForScreen:
|
|
53
|
-
manager.releaseOrientationForScreen()
|
|
54
51
|
case .idleTimerDisabled:
|
|
55
52
|
manager.idleTimerDisabled(payload)
|
|
56
53
|
case .forceAppReload:
|
|
@@ -83,9 +80,6 @@ enum Events: String {
|
|
|
83
80
|
/// JS_SENSOR = JS_LANDSCAPE_SENSOR | JS_PORTAIT
|
|
84
81
|
func allowOrientationForScreen(_ payload: [String: Any])
|
|
85
82
|
|
|
86
|
-
/// Release Orientation for specific screen to previous state
|
|
87
|
-
func releaseOrientationForScreen()
|
|
88
|
-
|
|
89
83
|
func idleTimerDisabled(_ payload: [String: Any])
|
|
90
84
|
|
|
91
85
|
func setPrefersHomeIndicatorAutoHidden(_ payload: [String: Any])
|
|
@@ -125,14 +119,13 @@ class ReactNativeCommunicationModule: NSObject, RCTBridgeModule {
|
|
|
125
119
|
- parameter payload: optional dictionary of properties to pass to the event handler
|
|
126
120
|
*/
|
|
127
121
|
@objc func quickBrickEvent(_ eventName: String, payload: [String: Any]?) {
|
|
128
|
-
let event = Events(rawValue: eventName)
|
|
129
|
-
|
|
130
|
-
guard event != nil, let delegateManager = delegateManager else {
|
|
122
|
+
guard let event = Events(rawValue: eventName),
|
|
123
|
+
let delegateManager = delegateManager else {
|
|
131
124
|
_ = OSLog(subsystem: "QUICK_BRICK:: unknown manager event called: " + eventName, category: kQuickBrickCommunicationModule)
|
|
132
125
|
return
|
|
133
126
|
}
|
|
134
127
|
|
|
135
|
-
event
|
|
128
|
+
event.invokeHandler(manager: delegateManager, payload: payload ?? [:])
|
|
136
129
|
}
|
|
137
130
|
|
|
138
131
|
@objc func setAppLanguage(_ language: String?,
|
|
@@ -95,7 +95,7 @@ open class ReactNativeManager: NSObject, UserInterfaceLayerProtocol, UserInterfa
|
|
|
95
95
|
|
|
96
96
|
#if os(iOS)
|
|
97
97
|
public func currentOrientationMask() -> UIInterfaceOrientationMask? {
|
|
98
|
-
rootViewController?.
|
|
98
|
+
rootViewController?.orientationMask
|
|
99
99
|
}
|
|
100
100
|
#endif
|
|
101
101
|
|
|
@@ -220,12 +220,6 @@ extension ReactNativeManager: QuickBrickManagerDelegate {
|
|
|
220
220
|
UIApplication.shared.isIdleTimerDisabled = disabled
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
public func releaseOrientationForScreen() {
|
|
224
|
-
if let qbViewController = reactNativeViewController() as? QuickBrickViewController {
|
|
225
|
-
qbViewController.releaseOrientationForScreen()
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
223
|
public func forceAppReload() {
|
|
230
224
|
EventsBus.post(EventsBus.Event(type: EventsBusType(.forceAppReload)))
|
|
231
225
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-native-apple",
|
|
3
|
-
"version": "5.20.
|
|
3
|
+
"version": "5.20.10",
|
|
4
4
|
"description": "iOS and tvOS native code for QuickBrick applications. This package is used to provide native logic for QuickBrick",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|