This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from peterp/pp-update-example
Update to latest version of React Native.
- Loading branch information
Showing
69 changed files
with
8,235 additions
and
15,944 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
72 changes: 72 additions & 0 deletions
72
examples/Demo_RN_v63_2/android/app/src/debug/java/com/demo_rn_v63_2/ReactNativeFlipper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root | ||
* directory of this source tree. | ||
*/ | ||
package com.demo_rn_v63_2; | ||
|
||
import android.content.Context; | ||
import com.facebook.flipper.android.AndroidFlipperClient; | ||
import com.facebook.flipper.android.utils.FlipperUtils; | ||
import com.facebook.flipper.core.FlipperClient; | ||
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; | ||
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; | ||
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; | ||
import com.facebook.flipper.plugins.inspector.DescriptorMapping; | ||
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; | ||
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; | ||
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; | ||
import com.facebook.flipper.plugins.react.ReactFlipperPlugin; | ||
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; | ||
import com.facebook.react.ReactInstanceManager; | ||
import com.facebook.react.bridge.ReactContext; | ||
import com.facebook.react.modules.network.NetworkingModule; | ||
import okhttp3.OkHttpClient; | ||
|
||
public class ReactNativeFlipper { | ||
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { | ||
if (FlipperUtils.shouldEnableFlipper(context)) { | ||
final FlipperClient client = AndroidFlipperClient.getInstance(context); | ||
|
||
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); | ||
client.addPlugin(new ReactFlipperPlugin()); | ||
client.addPlugin(new DatabasesFlipperPlugin(context)); | ||
client.addPlugin(new SharedPreferencesFlipperPlugin(context)); | ||
client.addPlugin(CrashReporterPlugin.getInstance()); | ||
|
||
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); | ||
NetworkingModule.setCustomClientBuilder( | ||
new NetworkingModule.CustomClientBuilder() { | ||
@Override | ||
public void apply(OkHttpClient.Builder builder) { | ||
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); | ||
} | ||
}); | ||
client.addPlugin(networkFlipperPlugin); | ||
client.start(); | ||
|
||
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized | ||
// Hence we run if after all native modules have been initialized | ||
ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); | ||
if (reactContext == null) { | ||
reactInstanceManager.addReactInstanceEventListener( | ||
new ReactInstanceManager.ReactInstanceEventListener() { | ||
@Override | ||
public void onReactContextInitialized(ReactContext reactContext) { | ||
reactInstanceManager.removeReactInstanceEventListener(this); | ||
reactContext.runOnNativeModulesQueueThread( | ||
new Runnable() { | ||
@Override | ||
public void run() { | ||
client.addPlugin(new FrescoFlipperPlugin()); | ||
} | ||
}); | ||
} | ||
}); | ||
} else { | ||
client.addPlugin(new FrescoFlipperPlugin()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
3 changes: 3 additions & 0 deletions
3
examples/Demo_RN_v63_2/android/app/src/main/res/values/strings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">Demo_RN_v63_2</string> | ||
</resources> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+54.3 KB
...android/gradle/wrapper/gradle-wrapper.jar → ...android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
.../gradle/wrapper/gradle-wrapper.properties → .../gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.