11import * as app from "tns-core-modules/application" ;
22import { 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" ;
44import * as frame from "tns-core-modules/ui/frame" ;
55
66const display = screen . mainScreen ;
@@ -75,8 +75,8 @@ Theme.Dark = "ns-dark";
7575export 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 = [])
9696function 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