mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Change the signature of onDropViewInstance. issue #5053
Summary: https://github.com/facebook/react-native/issues/5053 Closes https://github.com/facebook/react-native/pull/5125 Reviewed By: svcscm Differential Revision: D2807202 Pulled By: foghina fb-gh-sync-id: 1e268c940a08aa7bf243971ba91d4595973f12af
This commit is contained in:
committed by
facebook-github-bot-9
parent
1bfd267acb
commit
daa93a6222
@@ -424,9 +424,7 @@ public class NativeViewHierarchyManager {
|
|||||||
UiThreadUtil.assertOnUiThread();
|
UiThreadUtil.assertOnUiThread();
|
||||||
if (!mRootTags.get(view.getId())) {
|
if (!mRootTags.get(view.getId())) {
|
||||||
// For non-root views we notify viewmanager with {@link ViewManager#onDropInstance}
|
// For non-root views we notify viewmanager with {@link ViewManager#onDropInstance}
|
||||||
resolveViewManager(view.getId()).onDropViewInstance(
|
resolveViewManager(view.getId()).onDropViewInstance(view);
|
||||||
(ThemedReactContext) view.getContext(),
|
|
||||||
view);
|
|
||||||
}
|
}
|
||||||
ViewManager viewManager = mTagsToViewManagers.get(view.getId());
|
ViewManager viewManager = mTagsToViewManagers.get(view.getId());
|
||||||
if (view instanceof ViewGroup && viewManager instanceof ViewGroupManager) {
|
if (view instanceof ViewGroup && viewManager instanceof ViewGroupManager) {
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public abstract class ViewManager<T extends View, C extends ReactShadowNode> {
|
|||||||
* Called when view is detached from view hierarchy and allows for some additional cleanup by
|
* Called when view is detached from view hierarchy and allows for some additional cleanup by
|
||||||
* the {@link ViewManager} subclass.
|
* the {@link ViewManager} subclass.
|
||||||
*/
|
*/
|
||||||
public void onDropViewInstance(ThemedReactContext reactContext, T view) {
|
public void onDropViewInstance(T view) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -323,9 +323,9 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDropViewInstance(ThemedReactContext reactContext, WebView webView) {
|
public void onDropViewInstance(WebView webView) {
|
||||||
super.onDropViewInstance(reactContext, webView);
|
super.onDropViewInstance(webView);
|
||||||
reactContext.removeLifecycleEventListener((ReactWebView) webView);
|
((ThemedReactContext) webView.getContext()).removeLifecycleEventListener((ReactWebView) webView);
|
||||||
((ReactWebView) webView).cleanupCallbacksAndDestroy();
|
((ReactWebView) webView).cleanupCallbacksAndDestroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user