mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: working android build
This commit is contained in:
@@ -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();
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user