MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / reloadPage

Method reloadPage

packages/core/ui/frame/index.android.ts:85–105  ·  view source on GitHub ↗
(context?: ModuleContext)

Source from the content-addressed store, hash-verified

83 }
84
85 public static reloadPage(context?: ModuleContext): void {
86 const activity = androidUtils.getCurrentActivity();
87 const callbacks: AndroidActivityCallbacks = activity[CALLBACKS];
88 if (callbacks) {
89 const rootView: View = callbacks.getRootView();
90 // Handle application root module
91 const isAppRootModuleChanged = context && context.path && context.path.includes(getAppMainEntry().moduleName) && context.type !== 'style';
92
93 // Reset activity content when:
94 // + Application root module is changed
95 // + View did not handle the change
96 // Note:
97 // The case when neither app root module is changed, neighter livesync is handled on View,
98 // then changes will not apply until navigate forward to the module.
99 if (isAppRootModuleChanged || !rootView || !rootView._onLivesync(context)) {
100 callbacks.resetActivityContent(activity);
101 }
102 } else {
103 Trace.error(`${activity}[CALLBACKS] is null or undefined`);
104 }
105 }
106
107 public static get defaultAnimatedNavigation(): boolean {
108 return FrameBase.defaultAnimatedNavigation;

Callers 1

reloadPageFunction · 0.45

Calls 6

getAppMainEntryFunction · 0.90
includesMethod · 0.80
errorMethod · 0.80
getRootViewMethod · 0.65
resetActivityContentMethod · 0.65
_onLivesyncMethod · 0.45

Tested by

no test coverage detected