Skip to content

Commit

Permalink
Change the signature of onDropViewInstance. issue facebook#5053
Browse files Browse the repository at this point in the history
  • Loading branch information
deminoth committed Jan 5, 2016
1 parent 27ac047 commit b824e08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ protected final void dropView(View view) {
if (!mRootTags.get(view.getId())) {
// For non-root views we notify viewmanager with {@link ViewManager#onDropInstance}
resolveViewManager(view.getId()).onDropViewInstance(
(ThemedReactContext) view.getContext(),
view.getContext(),
view);
}
ViewManager viewManager = mTagsToViewManagers.get(view.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Map;

import android.content.Context;
import android.view.View;

import com.facebook.react.bridge.ReadableArray;
Expand Down Expand Up @@ -92,7 +93,7 @@ public final T createView(
* Called when view is detached from view hierarchy and allows for some additional cleanup by
* the {@link ViewManager} subclass.
*/
public void onDropViewInstance(ThemedReactContext reactContext, T view) {
public void onDropViewInstance(Context reactContext, T view) {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.util.Map;

import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.SystemClock;
Expand Down Expand Up @@ -325,9 +326,9 @@ public void receiveCommand(WebView root, int commandId, @Nullable ReadableArray
}

@Override
public void onDropViewInstance(ThemedReactContext reactContext, WebView webView) {
public void onDropViewInstance(Context reactContext, WebView webView) {
super.onDropViewInstance(reactContext, webView);
reactContext.removeLifecycleEventListener((ReactWebView) webView);
((ThemedReactContext) reactContext).removeLifecycleEventListener((ReactWebView) webView);
((ReactWebView) webView).cleanupCallbacksAndDestroy();
}
}

0 comments on commit b824e08

Please sign in to comment.