Skip to content

Commit

Permalink
chore: update react-native to 0.72.1 (expo#23262)
Browse files Browse the repository at this point in the history
# Why

update react-native 0.72.1 for sdk 49

# How

- bump react-native to 0.72.1
- re-version android/ios sdk 49 code
- [react-native-lab] cherry-pick necessary commits between 0.72.0..0.72.1

# Test Plan

- ci passed
- bare-expo
- versioned expo go
  • Loading branch information
Kudo authored Jul 3, 2023
1 parent 0467f0a commit 895fafd
Show file tree
Hide file tree
Showing 110 changed files with 3,501 additions and 5,586 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Mon Jun 26 23:41:01 CST 2023
#Mon Jul 03 10:58:12 CST 2023
reactandroid-abi49_0_0-1.0.0.aar>=
reactandroid-abi49_0_0-1.0.0.pom>=
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<versions>
<version>1.0.0</version>
</versions>
<lastUpdated>20230626154101</lastUpdated>
<lastUpdated>20230703025812</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
Expand Up @@ -240,20 +240,6 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_system_provider_paths" />
</provider>
<!-- Trigger Google Play services to install the backported photo picker module. -->
<service
android:name="com.google.android.gms.metadata.ModuleDependencies"
android:enabled="false"
android:exported="false"
tools:ignore="MissingClass" >
<intent-filter>
<action android:name="com.google.android.gms.metadata.MODULE_DEPENDENCIES" />
</intent-filter>

<meta-data
android:name="photopicker_activity:0:required"
android:value="" />
</service>

<activity
android:name="com.canhub.cropper.CropImageActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ class CameraViewModule : Module() {
view.cameraView.setUsingCamera2Api(useCamera2Api)
}

Prop("barCodeScannerEnabled") { view: ExpoCameraView, barCodeScannerEnabled: Boolean ->
view.setShouldScanBarCodes(barCodeScannerEnabled)
Prop("barCodeScannerEnabled") { view: ExpoCameraView, barCodeScannerEnabled: Boolean? ->
view.setShouldScanBarCodes(barCodeScannerEnabled ?: false)
}

Prop("faceDetectorEnabled") { view: ExpoCameraView, faceDetectorEnabled: Boolean ->
view.setShouldDetectFaces(faceDetectorEnabled)
Prop("faceDetectorEnabled") { view: ExpoCameraView, faceDetectorEnabled: Boolean? ->
view.setShouldDetectFaces(faceDetectorEnabled ?: false)
}

Prop("faceDetectorSettings") { view: ExpoCameraView, settings: Map<String, Any>? ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class ExpoImageViewWrapper(context: Context, appContext: AppContext) : ExpoView(

var recyclingKey: String? = null
set(value) {
clearViewBeforeChangingSource = value != null && value != field
clearViewBeforeChangingSource = field != null && value != null && value != field
field = value
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,41 +33,57 @@ internal class ImageLibraryContract(
}.contentResolver

override fun createIntent(context: Context, input: ImageLibraryContractOptions): Intent {
val request = PickVisualMediaRequest.Builder()
.setMediaType(
when (input.options.mediaTypes) {
MediaTypes.VIDEOS -> {
PickVisualMedia.VideoOnly
}
MediaTypes.IMAGES -> {
PickVisualMedia.ImageOnly
}
else -> {
PickVisualMedia.ImageAndVideo
if (PickVisualMedia.isPhotoPickerAvailable(context)) {
val request = PickVisualMediaRequest.Builder()
.setMediaType(
when (input.options.mediaTypes) {
MediaTypes.VIDEOS -> {
PickVisualMedia.VideoOnly
}

MediaTypes.IMAGES -> {
PickVisualMedia.ImageOnly
}

else -> {
PickVisualMedia.ImageAndVideo
}
}
}
).build()
).build()

if (input.options.allowsMultipleSelection) {
val selectionLimit = input.options.selectionLimit
if (input.options.allowsMultipleSelection) {
val selectionLimit = input.options.selectionLimit

if (selectionLimit == 1) {
// If multiple selection is allowed but the limit is 1, we should ignore
// the multiple selection flag and just treat it as a single selection.
return PickVisualMedia().createIntent(context, request)
}
if (selectionLimit == 1) {
// If multiple selection is allowed but the limit is 1, we should ignore
// the multiple selection flag and just treat it as a single selection.
return PickVisualMedia().createIntent(context, request)
}

if (selectionLimit > 1) {
return PickMultipleVisualMedia(selectionLimit).createIntent(context, request)
}
if (selectionLimit > 1) {
return PickMultipleVisualMedia(selectionLimit).createIntent(context, request)
}

// If the selection limit is 0, it is the same as unlimited selection.
if (selectionLimit == UNLIMITED_SELECTION) {
return PickMultipleVisualMedia().createIntent(context, request)
// If the selection limit is 0, it is the same as unlimited selection.
if (selectionLimit == UNLIMITED_SELECTION) {
return PickMultipleVisualMedia().createIntent(context, request)
}
}

return PickVisualMedia().createIntent(context, request)
}

return PickVisualMedia().createIntent(context, request)
return Intent(Intent.ACTION_GET_CONTENT)
.addCategory(Intent.CATEGORY_OPENABLE)
.setType(input.options.mediaTypes.toMimeType())
.apply {
if (input.options.allowsMultipleSelection) {
putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
}
if (input.options.mediaTypes == MediaTypes.ALL) {
putExtra(Intent.EXTRA_MIME_TYPES, arrayOf(MediaTypes.IMAGES.toMimeType(), MediaTypes.VIDEOS.toMimeType()))
}
}
}

override fun parseResult(input: ImageLibraryContractOptions, resultCode: Int, intent: Intent?) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ import abi49_0_0.host.exp.exponent.modules.api.components.maps.MapsPackage
import abi49_0_0.host.exp.exponent.modules.api.components.maskedview.RNCMaskedViewPackage
import abi49_0_0.host.exp.exponent.modules.api.components.picker.RNCPickerPackage
import abi49_0_0.host.exp.exponent.modules.api.components.reactnativestripesdk.StripeSdkPackage
import abi49_0_0.host.exp.exponent.modules.api.components.sharedelement.RNSharedElementModule
import abi49_0_0.host.exp.exponent.modules.api.components.sharedelement.RNSharedElementPackage
import abi49_0_0.host.exp.exponent.modules.api.components.webview.RNCWebViewModule
import abi49_0_0.host.exp.exponent.modules.api.components.webview.RNCWebViewPackage
import abi49_0_0.host.exp.exponent.modules.api.netinfo.NetInfoModule
Expand Down Expand Up @@ -135,7 +133,6 @@ class ExponentPackage : ReactPackage {
nativeModules.add(RNAWSCognitoModule(reactContext))
nativeModules.add(RNCWebViewModule(reactContext))
nativeModules.add(NetInfoModule(reactContext))
nativeModules.add(RNSharedElementModule(reactContext))
nativeModules.addAll(SvgPackage().getNativeModuleIterator(reactContext).map { it.module })
nativeModules.addAll(MapsPackage().createNativeModules(reactContext))
nativeModules.addAll(RNDateTimePickerPackage().getNativeModuleIterator(reactContext).map { it.module })
Expand Down Expand Up @@ -178,7 +175,6 @@ class ExponentPackage : ReactPackage {
RNScreensPackage(),
RNCWebViewPackage(),
SafeAreaContextPackage(),
RNSharedElementPackage(),
RNDateTimePickerPackage(),
RNCMaskedViewPackage(),
RNCPickerPackage(),
Expand Down

This file was deleted.

Loading

0 comments on commit 895fafd

Please sign in to comment.