Skip to content

Commit 7428c4b

Browse files
author
vakrilov
committed
fix: stop importing view-common, use view instead
1 parent 5034498 commit 7428c4b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as app from "tns-core-modules/application";
22
import { device, isAndroid, screen } from "tns-core-modules/platform";
3-
import * as viewCommon from "tns-core-modules/ui/core/view/view-common";
3+
import * as view from "tns-core-modules/ui/core/view";
44
import * as frame from "tns-core-modules/ui/frame";
55

66
const display = screen.mainScreen;
@@ -75,8 +75,8 @@ Theme.Dark = "ns-dark";
7575
export default Theme;
7676

7777
// Where the magic happens
78-
const oldSetupAsRootView = viewCommon.ViewCommon.prototype._setupAsRootView;
79-
viewCommon.ViewCommon.prototype._setupAsRootView = function() {
78+
const oldSetupAsRootView = view.ViewCommon.prototype._setupAsRootView;
79+
view.ViewCommon.prototype._setupAsRootView = function() {
8080
oldSetupAsRootView.call(this, ...arguments);
8181
Theme.setMode(Theme.currentMode, this);
8282
};
@@ -96,10 +96,10 @@ function updateRootClasses(orientation, root = app.getRootView(), classes = [])
9696
function handleOrientation({ newValue: orientation }) {
9797
updateRootClasses(orientation);
9898

99-
if (viewCommon._rootModalViews.length) {
99+
if (view._rootModalViews.length) {
100100
const classList = new ClassList(app.getRootView().className);
101101

102-
viewCommon._rootModalViews.forEach((view) => updateRootClasses(orientation, view, classList.add("ns-modal").list));
102+
view._rootModalViews.forEach((view) => updateRootClasses(orientation, view, classList.add("ns-modal").list));
103103
}
104104
}
105105

@@ -139,7 +139,7 @@ app.on(app.displayedEvent, () => {
139139
}
140140

141141
// Get notified when a modal is created.
142-
viewCommon._rootModalViews = new Proxy(viewCommon._rootModalViews, rootModalTrap);
142+
view._rootModalViews = new Proxy(view._rootModalViews, rootModalTrap);
143143

144144
root.className = new ClassList(root.className)
145145
.add("ns-root", platformClass, `ns-${device.deviceType.toLowerCase()}`)

0 commit comments

Comments
 (0)