chore: working android build

This commit is contained in:
Nathan Walker
2020-07-26 22:27:39 -07:00
parent b00013f35e
commit 39bcc8a4ca
27 changed files with 427 additions and 421 deletions

View File

@@ -247,24 +247,23 @@ function onLivesync(args): void {
imageFetcher.clearCache();
}
}
application.on('livesync', onLivesync);
application.android.on(
'activityStarted',
<any>profile('initImageCache', (args) => {
(<any>global).NativeScriptGlobals.events.on('livesync', onLivesync);
(<any>global).NativeScriptGlobals.addEventWiring(() => {
application.android.on('activityStarted', (args) => {
if (!imageFetcher) {
initImageCache(args.activity);
} else {
imageFetcher.initCache();
}
})
);
});
});
application.android.on(
'activityStopped',
<any>profile('closeImageCache', (args) => {
(<any>global).NativeScriptGlobals.addEventWiring(() => {
application.android.on('activityStopped', (args) => {
if (imageFetcher) {
imageFetcher.closeCache();
}
})
);
});
});

View File

@@ -355,8 +355,8 @@ const loadCss = profile(`"style-scope".loadCss`, (cssModule: string) => {
}
});
application.on('cssChanged', <any>onCssChanged);
application.on('livesync', onLiveSync);
(<any>global).NativeScriptGlobals.events.on('cssChanged', <any>onCssChanged);
(<any>global).NativeScriptGlobals.events.on('livesync', onLiveSync);
// Call to this method is injected in the application in:
// - no-snapshot - code injected in app.ts by [bundle-config-loader](https://github.com/NativeScript/nativescript-dev-webpack/blob/9b1e34d8ef838006c9b575285c42d2304f5f02b5/bundle-config-loader.ts#L85-L92)
@@ -365,7 +365,7 @@ application.on('livesync', onLiveSync);
// when the snapshot is created - there is no way to use file qualifiers or change the name of on app.css
export const loadAppCSS = profile('"style-scope".loadAppCSS', (args: application.LoadAppCSSEventData) => {
loadCss(args.cssFile, null, null);
application.off('loadAppCss', loadAppCSS);
(<any>global).NativeScriptGlobals.events.off('loadAppCss', loadAppCSS);
});
if (application.hasLaunched()) {
@@ -379,7 +379,7 @@ if (application.hasLaunched()) {
null
);
} else {
application.on('loadAppCss', <any>loadAppCSS);
(<any>global).NativeScriptGlobals.events.on('loadAppCss', <any>loadAppCSS);
}
export class CssState {