[Android] Allow accessing react-native's in-app developer menu (in the emulator)
This commit is contained in:
parent
7f78050513
commit
94473e5660
|
@ -23,11 +23,13 @@ import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
|
import com.facebook.react.ReactInstanceManager;
|
||||||
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base Activity for applications integrating Jitsi Meet at a higher level. It
|
* Base Activity for applications integrating Jitsi Meet at a higher level. It
|
||||||
* contains all the required wiring between the {@code JKConferenceView} and
|
* contains all the required wiring between the {@code JKConferenceView} and
|
||||||
|
@ -199,6 +201,23 @@ public class JitsiMeetActivity
|
||||||
JitsiMeetView.onHostDestroy(this);
|
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
|
@Override
|
||||||
public void onNewIntent(Intent intent) {
|
public void onNewIntent(Intent intent) {
|
||||||
JitsiMeetView.onNewIntent(intent);
|
JitsiMeetView.onNewIntent(intent);
|
||||||
|
|
|
@ -83,6 +83,11 @@ public class JitsiMeetView extends FrameLayout {
|
||||||
return null;
|
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
|
* Internal method to initialize the React Native instance manager. We
|
||||||
* create a single instance in order to load the JavaScript bundle a single
|
* create a single instance in order to load the JavaScript bundle a single
|
||||||
|
|
Loading…
Reference in New Issue