···11+diff --git a/node_modules/expo-image-picker/android/src/main/java/expo/modules/imagepicker/contracts/ImageLibraryContract.kt b/node_modules/expo-image-picker/android/src/main/java/expo/modules/imagepicker/contracts/ImageLibraryContract.kt
22+index ff15c91..41aaf12 100644
33+--- a/node_modules/expo-image-picker/android/src/main/java/expo/modules/imagepicker/contracts/ImageLibraryContract.kt
44++++ b/node_modules/expo-image-picker/android/src/main/java/expo/modules/imagepicker/contracts/ImageLibraryContract.kt
55+@@ -26,51 +26,26 @@ import java.io.Serializable
66+ * @see [androidx.activity.result.contract.ActivityResultContracts.GetMultipleContents]
77+ */
88+ internal class ImageLibraryContract(
99+- private val appContextProvider: AppContextProvider
1010++ private val appContextProvider: AppContextProvider,
1111+ ) : AppContextActivityResultContract<ImageLibraryContractOptions, ImagePickerContractResult> {
1212+ private val contentResolver: ContentResolver
1313+ get() = appContextProvider.appContext.reactContext?.contentResolver
1414+ ?: throw Exceptions.ReactContextLost()
1515+1616+ override fun createIntent(context: Context, input: ImageLibraryContractOptions): Intent {
1717+- val request = PickVisualMediaRequest.Builder()
1818+- .setMediaType(
1919+- when (input.options.mediaTypes) {
2020+- MediaTypes.VIDEOS -> {
2121+- PickVisualMedia.VideoOnly
2222+- }
2323+-
2424+- MediaTypes.IMAGES -> {
2525+- PickVisualMedia.ImageOnly
2626+- }
2727+-
2828+- else -> {
2929+- PickVisualMedia.ImageAndVideo
3030+- }
3131+- }
3232+- )
3333+- .build()
3434++ val intent = Intent(Intent.ACTION_GET_CONTENT)
3535++ .addCategory(Intent.CATEGORY_OPENABLE)
3636++ .setType("image/*")
3737+3838+ if (input.options.allowsMultipleSelection) {
3939+- val selectionLimit = input.options.selectionLimit
4040+-
4141+- if (selectionLimit == 1) {
4242+- // If multiple selection is allowed but the limit is 1, we should ignore
4343+- // the multiple selection flag and just treat it as a single selection.
4444+- return PickVisualMedia().createIntent(context, request)
4545++ if(input.options.selectionLimit == 1) {
4646++ return intent
4747+ }
4848+4949+- if (selectionLimit > 1) {
5050+- return PickMultipleVisualMedia(selectionLimit).createIntent(context, request)
5151+- }
5252+-
5353+- // If the selection limit is 0, it is the same as unlimited selection.
5454+- if (selectionLimit == UNLIMITED_SELECTION) {
5555+- return PickMultipleVisualMedia().createIntent(context, request)
5656+- }
5757++ intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
5858+ }
5959+6060+- return PickVisualMedia().createIntent(context, request)
6161++ return intent
6262+ }
6363+6464+ override fun parseResult(input: ImageLibraryContractOptions, resultCode: Int, intent: Intent?) =
+3
patches/expo-image-picker+14.7.1.patch.md
···11+added by https://github.com/bluesky-social/social-app/pull/2384#pullrequestreview-1800985521
22+33+hackfixes the image picker on android so that the user can select from their typical image sources
+6-1
src/lib/media/picker.shared.ts
···44 MediaTypeOptions,
55} from 'expo-image-picker'
66import {getDataUriSize} from './util'
77+import * as Toast from 'view/com/util/Toast'
7889export async function openPicker(opts?: ImagePickerOptions) {
910 const response = await launchImageLibraryAsync({
···1314 ...opts,
1415 })
15161616- return (response.assets ?? []).map(image => ({
1717+ if (response.assets && response.assets.length > 4) {
1818+ Toast.show('You may only select up to 4 images')
1919+ }
2020+2121+ return (response.assets ?? []).slice(0, 4).map(image => ({
1722 mime: 'image/jpeg',
1823 height: image.height,
1924 width: image.width,