mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Format Java code in xplat/js/react-native-github
Summary: This diff formats the Java class files inside xplat/js/react-native-github. Since google-java-format was enabled in D16071401 we want to codemode the existing code so that users don't have to deal with formatter lint noise at diff-time. ```arc f --paths-cmd 'hg files -I "**/*.java"'``` drop-conflicts Reviewed By: cpojer Differential Revision: D16071725 fbshipit-source-id: fc6e3852e45742c109f0c5ac4065d64201c74204
This commit is contained in:
committed by
Facebook Github Bot
parent
61e95e5cbf
commit
6c0f73b322
@@ -12,12 +12,9 @@ import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.bridge.Callback;
|
||||
import com.facebook.react.uimanager.RootView;
|
||||
import com.facebook.react.modules.core.PermissionListener;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
@@ -54,11 +51,11 @@ public class ReactActivityDelegate {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the {@link ReactNativeHost} used by this app. By default, assumes
|
||||
* {@link Activity#getApplication()} is an instance of {@link ReactApplication} and calls
|
||||
* {@link ReactApplication#getReactNativeHost()}. Override this method if your application class
|
||||
* does not implement {@code ReactApplication} or you simply have a different mechanism for
|
||||
* storing a {@code ReactNativeHost}, e.g. as a static field somewhere.
|
||||
* Get the {@link ReactNativeHost} used by this app. By default, assumes {@link
|
||||
* Activity#getApplication()} is an instance of {@link ReactApplication} and calls {@link
|
||||
* ReactApplication#getReactNativeHost()}. Override this method if your application class does not
|
||||
* implement {@code ReactApplication} or you simply have a different mechanism for storing a
|
||||
* {@code ReactNativeHost}, e.g. as a static field somewhere.
|
||||
*/
|
||||
protected ReactNativeHost getReactNativeHost() {
|
||||
return ((ReactApplication) getPlainActivity().getApplication()).getReactNativeHost();
|
||||
@@ -74,7 +71,9 @@ public class ReactActivityDelegate {
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
String mainComponentName = getMainComponentName();
|
||||
mReactDelegate = new ReactDelegate(getPlainActivity(), getReactNativeHost(), mainComponentName, getLaunchOptions());
|
||||
mReactDelegate =
|
||||
new ReactDelegate(
|
||||
getPlainActivity(), getReactNativeHost(), mainComponentName, getLaunchOptions());
|
||||
if (mMainComponentName != null) {
|
||||
loadApp(mainComponentName);
|
||||
}
|
||||
@@ -108,8 +107,8 @@ public class ReactActivityDelegate {
|
||||
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (getReactNativeHost().hasInstance()
|
||||
&& getReactNativeHost().getUseDeveloperSupport()
|
||||
&& keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) {
|
||||
&& getReactNativeHost().getUseDeveloperSupport()
|
||||
&& keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD) {
|
||||
event.startTracking();
|
||||
return true;
|
||||
}
|
||||
@@ -150,25 +149,24 @@ public class ReactActivityDelegate {
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.M)
|
||||
public void requestPermissions(
|
||||
String[] permissions,
|
||||
int requestCode,
|
||||
PermissionListener listener) {
|
||||
String[] permissions, int requestCode, PermissionListener listener) {
|
||||
mPermissionListener = listener;
|
||||
getPlainActivity().requestPermissions(permissions, requestCode);
|
||||
}
|
||||
|
||||
public void onRequestPermissionsResult(
|
||||
final int requestCode,
|
||||
final String[] permissions,
|
||||
final int[] grantResults) {
|
||||
mPermissionsCallback = new Callback() {
|
||||
@Override
|
||||
public void invoke(Object... args) {
|
||||
if (mPermissionListener != null && mPermissionListener.onRequestPermissionsResult(requestCode, permissions, grantResults)) {
|
||||
mPermissionListener = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
final int requestCode, final String[] permissions, final int[] grantResults) {
|
||||
mPermissionsCallback =
|
||||
new Callback() {
|
||||
@Override
|
||||
public void invoke(Object... args) {
|
||||
if (mPermissionListener != null
|
||||
&& mPermissionListener.onRequestPermissionsResult(
|
||||
requestCode, permissions, grantResults)) {
|
||||
mPermissionListener = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected Context getContext() {
|
||||
|
||||
Reference in New Issue
Block a user