[Android] Allow accessing react-native's in-app developer menu (in the emulator)

pull/2523/head
Lyubo Marinov 7 years ago
parent 7f78050513
commit 94473e5660
  1. 23
      android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetActivity.java
  2. 5
      android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java

@ -23,11 +23,13 @@ import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import java.net.URL;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import java.net.URL;
/**
* Base Activity for applications integrating Jitsi Meet at a higher level. It
* contains all the required wiring between the {@code JKConferenceView} and
@ -199,6 +201,23 @@ public class JitsiMeetActivity
JitsiMeetView.onHostDestroy(this);
}
// ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
ReactInstanceManager reactInstanceManager;
if (!super.onKeyUp(keyCode, event)
&& BuildConfig.DEBUG
&& (reactInstanceManager
= JitsiMeetView.getReactInstanceManager())
!= null
&& keyCode == KeyEvent.KEYCODE_MENU) {
reactInstanceManager.showDevOptionsDialog();
return true;
}
return false;
}
@Override
public void onNewIntent(Intent intent) {
JitsiMeetView.onNewIntent(intent);

@ -83,6 +83,11 @@ public class JitsiMeetView extends FrameLayout {
return null;
}
// XXX Strictly internal use only (at the time of this writing)!
static ReactInstanceManager getReactInstanceManager() {
return reactInstanceManager;
}
/**
* Internal method to initialize the React Native instance manager. We
* create a single instance in order to load the JavaScript bundle a single

Loading…
Cancel
Save