Skip to content

Commit

Permalink
Don't override LightBox ReactRootView id
Browse files Browse the repository at this point in the history
fixes wix#1502
  • Loading branch information
guyca authored and krystofcelba committed Jan 4, 2018
1 parent f23df34 commit 41e51a1
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import android.view.Window;
import android.view.WindowManager;
import android.widget.RelativeLayout;

import com.reactnativenavigation.R;
import com.reactnativenavigation.params.LightBoxParams;
import com.reactnativenavigation.screens.Screen;
Expand All @@ -34,7 +35,7 @@ public class LightBox extends Dialog implements DialogInterface.OnDismissListene
public LightBox(AppCompatActivity activity, Runnable onDismissListener, LightBoxParams params) {
super(activity, R.style.LightBox);
this.onDismissListener = onDismissListener;
this.cancelable =!params.overrideBackPress;
this.cancelable = !params.overrideBackPress;
setOnDismissListener(this);
requestWindowFeature(Window.FEATURE_NO_TITLE);
createContent(activity, params);
Expand All @@ -52,7 +53,6 @@ private void createContent(final Context context, LightBoxParams params) {
lightBox.setAlpha(0);
content = new ContentView(context, params.screenId, params.navigationParams);
content.setAlpha(0);
content.setId(ViewUtils.generateViewId());
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
lp.addRule(RelativeLayout.CENTER_IN_PARENT, content.getId());
lightBox.setBackgroundColor(params.backgroundColor.getColor());
Expand Down Expand Up @@ -107,7 +107,11 @@ public void onDismiss(DialogInterface dialogInterface) {
}

public void destroy() {
content.unmountReactView();
if (content != null) {
content.unmountReactView();
lightBox.removeAllViews();
content = null;
}
dismiss();
}

Expand Down

0 comments on commit 41e51a1

Please sign in to comment.