Skip to content

Commit

Permalink
Rename deInit -> onHostDestroy
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Mar 24, 2024
1 parent ab8be3e commit b1c995a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,6 @@ public void run() {
});
}

protected static void deInit() {
mThemeResId = -1;
mStatus = Status.HIDDEN;
mInitialDialog = null;
mFadeOutDialog = null;
clearPromiseQueue();
}

private static void clearPromiseQueue() {
while (!mPromiseQueue.isEmpty()) {
Promise promise = mPromiseQueue.shift();
Expand Down Expand Up @@ -247,6 +239,21 @@ public static boolean isSamsungOneUI4() {
}
}

protected static void onHostDestroy() {
mStatus = Status.HIDDEN;
mThemeResId = -1;
clearPromiseQueue();

if (mInitialDialog != null) {
mInitialDialog.dismiss();
mInitialDialog = null;
}
if (mFadeOutDialog != null) {
mFadeOutDialog.dismiss();
mFadeOutDialog = null;
}
}

public static Map<String, Object> getConstants(final ReactApplicationContext reactContext) {
final Resources resources = reactContext.getResources();
HashMap<String, Object> constants = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,28 @@ public String getName() {
}

@Override
protected Map<String, Object> getTypedExportedConstants() {
return RNBootSplashModuleImpl.getConstants(getReactApplicationContext());
}
public void onHostResume() {}

@Override
public void hide(boolean fade, Promise promise) {
RNBootSplashModuleImpl.hide(getReactApplicationContext(), fade, promise);
}
public void onHostPause() {}

@Override
public void isVisible(Promise promise) {
RNBootSplashModuleImpl.isVisible(promise);
public void onHostDestroy() {
RNBootSplashModuleImpl.onHostDestroy();
}

@Override
public void onHostResume() {
protected Map<String, Object> getTypedExportedConstants() {
return RNBootSplashModuleImpl.getConstants(getReactApplicationContext());
}

@Override
public void onHostPause() {
public void hide(boolean fade, Promise promise) {
RNBootSplashModuleImpl.hide(getReactApplicationContext(), fade, promise);
}

@Override
public void onHostDestroy() {
RNBootSplashModuleImpl.deInit();
public void isVisible(Promise promise) {
RNBootSplashModuleImpl.isVisible(promise);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ public String getName() {
return RNBootSplashModuleImpl.NAME;
}

@Override
public void onHostResume() {}

@Override
public void onHostPause() {}

@Override
public void onHostDestroy() {
RNBootSplashModuleImpl.onHostDestroy();
}

@Nullable
@Override
public Map<String, Object> getConstants() {
Expand All @@ -41,17 +52,4 @@ public void hide(boolean fade, Promise promise) {
public void isVisible(Promise promise) {
RNBootSplashModuleImpl.isVisible(promise);
}

@Override
public void onHostResume() {
}

@Override
public void onHostPause() {
}

@Override
public void onHostDestroy() {
RNBootSplashModuleImpl.deInit();
}
}

0 comments on commit b1c995a

Please sign in to comment.