expo-image-picker 17.1.0-canary-20251031-b135dff → 17.1.0-canary-20251118-4ca99d5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/res/values/colors.xml +3 -3
  4. package/expo-module.config.json +1 -1
  5. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar → 17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar} +0 -0
  6. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar.md5 +1 -0
  7. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar.sha1 +1 -0
  8. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar.sha256 +1 -0
  9. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar.sha512 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.module → 17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.module} +17 -17
  11. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.module.md5 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.module.sha1 +1 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.module.sha256 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.module.sha512 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.pom → 17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.pom} +1 -1
  16. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.pom.md5 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.pom.sha1 +1 -0
  18. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.pom.sha256 +1 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.pom.sha512 +1 -0
  20. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml +4 -4
  21. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml.md5 +1 -1
  22. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml.sha1 +1 -1
  23. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml.sha256 +1 -1
  24. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/maven-metadata.xml.sha512 +1 -1
  25. package/package.json +4 -4
  26. package/plugin/build/withImagePicker.d.ts +11 -0
  27. package/plugin/build/withImagePicker.js +35 -1
  28. package/plugin/src/withImagePicker.ts +59 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar.md5 +0 -1
  30. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar.sha1 +0 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar.sha256 +0 -1
  32. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar.sha512 +0 -1
  33. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.module.md5 +0 -1
  34. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.module.sha1 +0 -1
  35. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.module.sha256 +0 -1
  36. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.module.sha512 +0 -1
  37. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.pom.md5 +0 -1
  38. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.pom.sha1 +0 -1
  39. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.pom.sha256 +0 -1
  40. package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.pom.sha512 +0 -1
  41. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff-sources.jar → 17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5-sources.jar} +0 -0
  42. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff-sources.jar.md5 → 17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5-sources.jar.md5} +0 -0
  43. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff-sources.jar.sha1 → 17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5-sources.jar.sha1} +0 -0
  44. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff-sources.jar.sha256 → 17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5-sources.jar.sha256} +0 -0
  45. /package/local-maven-repo/host/exp/exponent/expo.modules.imagepicker/{17.1.0-canary-20251031-b135dff/expo.modules.imagepicker-17.1.0-canary-20251031-b135dff-sources.jar.sha512 → 17.1.0-canary-20251118-4ca99d5/expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5-sources.jar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,9 +7,12 @@
7
7
  ### 🎉 New features
8
8
 
9
9
  - [iOS] Add `shouldDownloadFromNetwork` option to fix iCloud video download ([#40697](https://github.com/expo/expo/pull/40697) by [@kosmydel](https://github.com/kosmydel))
10
+ - [android] support colors configuration ([#40834](https://github.com/expo/expo/pull/40834) by [@kosmydel](https://github.com/kosmydel))
10
11
 
11
12
  ### 🐛 Bug fixes
12
13
 
14
+ - [android] fix `cropToolbarColor` default value ([#40834](https://github.com/expo/expo/pull/40834) by [@kosmydel](https://github.com/kosmydel))
15
+
13
16
  ### 💡 Others
14
17
 
15
18
  ## 17.0.8 — 2025-09-11
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '17.1.0-canary-20251031-b135dff'
7
+ version = '17.1.0-canary-20251118-4ca99d5'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.imagepicker"
11
11
  defaultConfig {
12
12
  versionCode 22
13
- versionName "17.1.0-canary-20251031-b135dff"
13
+ versionName "17.1.0-canary-20251118-4ca99d5"
14
14
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15
15
  }
16
16
  testOptions {
@@ -3,8 +3,8 @@
3
3
  <!-- Custom colors for image picker cropping interface -->
4
4
  <!-- Light mode defaults -->
5
5
  <color name="expoCropToolbarColor">#00000000</color> <!-- Transparent -->
6
- <color name="expoCropToolbarIconColor">#000000</color> <!-- Black icons -->
7
- <color name="expoCropToolbarActionTextColor">#000000</color> <!-- Black text -->
8
- <color name="expoCropBackButtonIconColor">#000000</color> <!-- Black back button -->
6
+ <color name="expoCropToolbarIconColor">#ffffff</color> <!-- White icons -->
7
+ <color name="expoCropToolbarActionTextColor">#ffffff</color> <!-- White text -->
8
+ <color name="expoCropBackButtonIconColor">#ffffff</color> <!-- White back button -->
9
9
  <color name="expoCropBackgroundColor">#ffffff</color> <!-- White background -->
10
10
  </resources>
@@ -8,7 +8,7 @@
8
8
  "publication": {
9
9
  "groupId": "host.exp.exponent",
10
10
  "artifactId": "expo.modules.imagepicker",
11
- "version": "17.1.0-canary-20251031-b135dff",
11
+ "version": "17.1.0-canary-20251118-4ca99d5",
12
12
  "repository": "local-maven-repo"
13
13
  }
14
14
  }
@@ -0,0 +1 @@
1
+ 13fab957eaa4a73d5089aa0fae00aa7aeeaca61dbcc0f329198f9795dc3a05a1b19f2f0ed903e412115d1f9d0fd4c7abc43cfef99ab2f412d099f0cecde0c988
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.imagepicker",
6
- "version": "17.1.0-canary-20251031-b135dff",
6
+ "version": "17.1.0-canary-20251118-4ca99d5",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar",
28
- "url": "expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar",
29
- "size": 149688,
30
- "sha512": "d36ee656e5c8a3798c0465da56f3dcaf502f2d6cdcf5a7b12306de5a087aade2b69f252db410405b6b28c4fca1132c1352d0fe6c2d08592b2181e6e55d074316",
31
- "sha256": "005154f114b5d794cdde9fa35332d25468b5b37e3bfafdd3e94b30dfa76e4601",
32
- "sha1": "cb6e1386222ee8647b7121fe25746ff57b150a71",
33
- "md5": "2c1b846e9b1ffdd60a7508009759a70e"
27
+ "name": "expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar",
28
+ "url": "expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar",
29
+ "size": 149684,
30
+ "sha512": "13fab957eaa4a73d5089aa0fae00aa7aeeaca61dbcc0f329198f9795dc3a05a1b19f2f0ed903e412115d1f9d0fd4c7abc43cfef99ab2f412d099f0cecde0c988",
31
+ "sha256": "1b907683d3f93f6cc0999c1111303cbca41aa18781b49b0e8541f80b46485d31",
32
+ "sha1": "fca7a509ac4af94f54ef1de57758b99d6672549e",
33
+ "md5": "63562c74116eeebd01a60e2aabb5eae6"
34
34
  }
35
35
  ]
36
36
  },
@@ -95,13 +95,13 @@
95
95
  ],
96
96
  "files": [
97
97
  {
98
- "name": "expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar",
99
- "url": "expo.modules.imagepicker-17.1.0-canary-20251031-b135dff.aar",
100
- "size": 149688,
101
- "sha512": "d36ee656e5c8a3798c0465da56f3dcaf502f2d6cdcf5a7b12306de5a087aade2b69f252db410405b6b28c4fca1132c1352d0fe6c2d08592b2181e6e55d074316",
102
- "sha256": "005154f114b5d794cdde9fa35332d25468b5b37e3bfafdd3e94b30dfa76e4601",
103
- "sha1": "cb6e1386222ee8647b7121fe25746ff57b150a71",
104
- "md5": "2c1b846e9b1ffdd60a7508009759a70e"
98
+ "name": "expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar",
99
+ "url": "expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5.aar",
100
+ "size": 149684,
101
+ "sha512": "13fab957eaa4a73d5089aa0fae00aa7aeeaca61dbcc0f329198f9795dc3a05a1b19f2f0ed903e412115d1f9d0fd4c7abc43cfef99ab2f412d099f0cecde0c988",
102
+ "sha256": "1b907683d3f93f6cc0999c1111303cbca41aa18781b49b0e8541f80b46485d31",
103
+ "sha1": "fca7a509ac4af94f54ef1de57758b99d6672549e",
104
+ "md5": "63562c74116eeebd01a60e2aabb5eae6"
105
105
  }
106
106
  ]
107
107
  },
@@ -115,8 +115,8 @@
115
115
  },
116
116
  "files": [
117
117
  {
118
- "name": "expo.modules.imagepicker-17.1.0-canary-20251031-b135dff-sources.jar",
119
- "url": "expo.modules.imagepicker-17.1.0-canary-20251031-b135dff-sources.jar",
118
+ "name": "expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5-sources.jar",
119
+ "url": "expo.modules.imagepicker-17.1.0-canary-20251118-4ca99d5-sources.jar",
120
120
  "size": 24487,
121
121
  "sha512": "baee9c33a5d10479e76876096bd9774b2dc7a6b8f73c2527400ff62989933b147a3bb003ef99883b39cb6a47fac491409f2872f08ed23dc194f712e4c0a48e32",
122
122
  "sha256": "650f592065589e4007e6c179729c59e138577cebee67e633fb14aeb42817f0aa",
@@ -0,0 +1 @@
1
+ 3e1fba9b8c20f1038a1afd5d3365974d462a915f8fdffc77eede48cbcef5bfb80ca6cdfa774bc19f46bcd706027aa15b079f046215a3167213af9a1b7c63c27b
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.imagepicker</artifactId>
12
- <version>17.1.0-canary-20251031-b135dff</version>
12
+ <version>17.1.0-canary-20251118-4ca99d5</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.imagepicker</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ a6b46fcf92ecfcfc02720a6aaae2b6a3dc2ae3a077afcb374854e3eedf949b29779e7cbb9d187548d7b726da3f845be2ddccaefac6eb77e8ec484de3826f1055
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.imagepicker</artifactId>
5
5
  <versioning>
6
- <latest>17.1.0-canary-20251031-b135dff</latest>
7
- <release>17.1.0-canary-20251031-b135dff</release>
6
+ <latest>17.1.0-canary-20251118-4ca99d5</latest>
7
+ <release>17.1.0-canary-20251118-4ca99d5</release>
8
8
  <versions>
9
- <version>17.1.0-canary-20251031-b135dff</version>
9
+ <version>17.1.0-canary-20251118-4ca99d5</version>
10
10
  </versions>
11
- <lastUpdated>20251031073934</lastUpdated>
11
+ <lastUpdated>20251118174611</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- f926c81126164893fafbb89701d53b86
1
+ 792252db2f8ffa7605164439cc721997
@@ -1 +1 @@
1
- 1c5b3a59bbcda3b228ab516fad4085b4b7290798
1
+ e8579c750f4afa22834f8bdc874262cb9523741d
@@ -1 +1 @@
1
- 61a3b9f9735b93a8e40777915210ea49b1732a93892590d8ea66e52a9dfa7da0
1
+ 235e71bfe757e47fb79ee5edc897630c2a230946b9cdff57d6a22a4db704ef5f
@@ -1 +1 @@
1
- ca6a6c906e406f4fb4377d218615703c8d06e5ef950537663119fbcba1c8050a617034a3fd68b2b842c30516e5b5ed4b89d9fb9f06194aea7c787412ac9425ff
1
+ 73604265d130c3150da4e792d6e1ffd9010f3a6acfdc52d0bf62bfacd1874e7d62ff6eee6ea9bc3f53abcc3a2dd0804fae28044815ceebd19cb51f6068227aeb
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-image-picker",
3
- "version": "17.1.0-canary-20251031-b135dff",
3
+ "version": "17.1.0-canary-20251118-4ca99d5",
4
4
  "description": "Provides access to the system's UI for selecting images and videos from the phone's library or taking a photo with the camera.",
5
5
  "main": "build/ImagePicker.js",
6
6
  "types": "build/ImagePicker.d.ts",
@@ -36,13 +36,13 @@
36
36
  "preset": "expo-module-scripts"
37
37
  },
38
38
  "dependencies": {
39
- "expo-image-loader": "6.0.1-canary-20251031-b135dff"
39
+ "expo-image-loader": "6.0.1-canary-20251118-4ca99d5"
40
40
  },
41
41
  "devDependencies": {
42
- "expo-module-scripts": "5.0.8-canary-20251031-b135dff",
42
+ "expo-module-scripts": "5.1.0-canary-20251118-4ca99d5",
43
43
  "@testing-library/user-event": "^14.6.1"
44
44
  },
45
45
  "peerDependencies": {
46
- "expo": "55.0.0-canary-20251031-b135dff"
46
+ "expo": "55.0.0-canary-20251118-4ca99d5"
47
47
  }
48
48
  }
@@ -1,8 +1,19 @@
1
1
  import { type ConfigPlugin } from 'expo/config-plugins';
2
+ type ImagePickerColors = {
3
+ cropToolbarColor?: string;
4
+ cropToolbarIconColor?: string;
5
+ cropToolbarActionTextColor?: string;
6
+ cropBackButtonIconColor?: string;
7
+ cropBackgroundColor?: string;
8
+ };
2
9
  type Props = {
3
10
  photosPermission?: string | false;
4
11
  cameraPermission?: string | false;
5
12
  microphonePermission?: string | false;
13
+ colors?: ImagePickerColors;
14
+ dark?: {
15
+ colors?: ImagePickerColors;
16
+ };
6
17
  };
7
18
  export declare const withAndroidImagePickerPermissions: ConfigPlugin<Props | void>;
8
19
  declare const _default: ConfigPlugin<void | Props>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withAndroidImagePickerPermissions = void 0;
4
4
  const config_plugins_1 = require("expo/config-plugins");
5
+ const { Colors } = config_plugins_1.AndroidConfig;
5
6
  const pkg = require('expo-image-picker/package.json');
6
7
  const CAMERA_USAGE = 'Allow $(PRODUCT_NAME) to access your camera';
7
8
  const MICROPHONE_USAGE = 'Allow $(PRODUCT_NAME) to access your microphone';
@@ -21,7 +22,30 @@ const withAndroidImagePickerPermissions = (config, { cameraPermission, microphon
21
22
  return config;
22
23
  };
23
24
  exports.withAndroidImagePickerPermissions = withAndroidImagePickerPermissions;
24
- const withImagePicker = (config, { photosPermission, cameraPermission, microphonePermission } = {}) => {
25
+ /**
26
+ * Sets image picker colors in the Android colors.xml resource file
27
+ */
28
+ function setImagePickerColors(colors, pickerColors) {
29
+ if (!pickerColors) {
30
+ return colors;
31
+ }
32
+ const colorMapping = {
33
+ cropToolbarColor: 'expoCropToolbarColor',
34
+ cropToolbarIconColor: 'expoCropToolbarIconColor',
35
+ cropToolbarActionTextColor: 'expoCropToolbarActionTextColor',
36
+ cropBackButtonIconColor: 'expoCropBackButtonIconColor',
37
+ cropBackgroundColor: 'expoCropBackgroundColor',
38
+ };
39
+ let result = colors;
40
+ for (const [key, colorName] of Object.entries(colorMapping)) {
41
+ const colorValue = pickerColors[key];
42
+ if (colorValue) {
43
+ result = Colors.assignColorValue(result, { value: colorValue, name: colorName });
44
+ }
45
+ }
46
+ return result;
47
+ }
48
+ const withImagePicker = (config, { photosPermission, cameraPermission, microphonePermission, colors, dark } = {}) => {
25
49
  config_plugins_1.IOSConfig.Permissions.createPermissionsPlugin({
26
50
  NSPhotoLibraryUsageDescription: READ_PHOTOS_USAGE,
27
51
  NSCameraUsageDescription: CAMERA_USAGE,
@@ -42,6 +66,16 @@ const withImagePicker = (config, { photosPermission, cameraPermission, microphon
42
66
  ].filter(Boolean));
43
67
  // NOTE(EvanBacon): It's unclear if we should block the WRITE_EXTERNAL_STORAGE/READ_EXTERNAL_STORAGE permissions since
44
68
  // they're used for many other things besides image picker.
69
+ // Apply color configurations for light theme
70
+ config = (0, config_plugins_1.withAndroidColors)(config, (config) => {
71
+ config.modResults = setImagePickerColors(config.modResults, colors);
72
+ return config;
73
+ });
74
+ // Apply color configurations for dark theme
75
+ config = (0, config_plugins_1.withAndroidColorsNight)(config, (config) => {
76
+ config.modResults = setImagePickerColors(config.modResults, dark?.colors);
77
+ return config;
78
+ });
45
79
  return config;
46
80
  };
47
81
  exports.default = (0, config_plugins_1.createRunOncePlugin)(withImagePicker, pkg.name, pkg.version);
@@ -3,18 +3,34 @@ import {
3
3
  type ConfigPlugin,
4
4
  createRunOncePlugin,
5
5
  IOSConfig,
6
+ withAndroidColors,
7
+ withAndroidColorsNight,
6
8
  } from 'expo/config-plugins';
7
9
 
10
+ const { Colors } = AndroidConfig;
11
+
8
12
  const pkg = require('expo-image-picker/package.json');
9
13
 
10
14
  const CAMERA_USAGE = 'Allow $(PRODUCT_NAME) to access your camera';
11
15
  const MICROPHONE_USAGE = 'Allow $(PRODUCT_NAME) to access your microphone';
12
16
  const READ_PHOTOS_USAGE = 'Allow $(PRODUCT_NAME) to access your photos';
13
17
 
18
+ type ImagePickerColors = {
19
+ cropToolbarColor?: string;
20
+ cropToolbarIconColor?: string;
21
+ cropToolbarActionTextColor?: string;
22
+ cropBackButtonIconColor?: string;
23
+ cropBackgroundColor?: string;
24
+ };
25
+
14
26
  type Props = {
15
27
  photosPermission?: string | false;
16
28
  cameraPermission?: string | false;
17
29
  microphonePermission?: string | false;
30
+ colors?: ImagePickerColors;
31
+ dark?: {
32
+ colors?: ImagePickerColors;
33
+ };
18
34
  };
19
35
 
20
36
  export const withAndroidImagePickerPermissions: ConfigPlugin<Props | void> = (
@@ -41,9 +57,39 @@ export const withAndroidImagePickerPermissions: ConfigPlugin<Props | void> = (
41
57
  return config;
42
58
  };
43
59
 
60
+ /**
61
+ * Sets image picker colors in the Android colors.xml resource file
62
+ */
63
+ function setImagePickerColors(
64
+ colors: AndroidConfig.Resources.ResourceXML,
65
+ pickerColors?: ImagePickerColors
66
+ ): AndroidConfig.Resources.ResourceXML {
67
+ if (!pickerColors) {
68
+ return colors;
69
+ }
70
+
71
+ const colorMapping: Record<keyof ImagePickerColors, string> = {
72
+ cropToolbarColor: 'expoCropToolbarColor',
73
+ cropToolbarIconColor: 'expoCropToolbarIconColor',
74
+ cropToolbarActionTextColor: 'expoCropToolbarActionTextColor',
75
+ cropBackButtonIconColor: 'expoCropBackButtonIconColor',
76
+ cropBackgroundColor: 'expoCropBackgroundColor',
77
+ };
78
+
79
+ let result = colors;
80
+ for (const [key, colorName] of Object.entries(colorMapping)) {
81
+ const colorValue = pickerColors[key as keyof ImagePickerColors];
82
+ if (colorValue) {
83
+ result = Colors.assignColorValue(result, { value: colorValue, name: colorName });
84
+ }
85
+ }
86
+
87
+ return result;
88
+ }
89
+
44
90
  const withImagePicker: ConfigPlugin<Props | void> = (
45
91
  config,
46
- { photosPermission, cameraPermission, microphonePermission } = {}
92
+ { photosPermission, cameraPermission, microphonePermission, colors, dark } = {}
47
93
  ) => {
48
94
  IOSConfig.Permissions.createPermissionsPlugin({
49
95
  NSPhotoLibraryUsageDescription: READ_PHOTOS_USAGE,
@@ -72,6 +118,18 @@ const withImagePicker: ConfigPlugin<Props | void> = (
72
118
  // NOTE(EvanBacon): It's unclear if we should block the WRITE_EXTERNAL_STORAGE/READ_EXTERNAL_STORAGE permissions since
73
119
  // they're used for many other things besides image picker.
74
120
 
121
+ // Apply color configurations for light theme
122
+ config = withAndroidColors(config, (config) => {
123
+ config.modResults = setImagePickerColors(config.modResults, colors);
124
+ return config;
125
+ });
126
+
127
+ // Apply color configurations for dark theme
128
+ config = withAndroidColorsNight(config, (config) => {
129
+ config.modResults = setImagePickerColors(config.modResults, dark?.colors);
130
+ return config;
131
+ });
132
+
75
133
  return config;
76
134
  };
77
135
 
@@ -1 +0,0 @@
1
- d36ee656e5c8a3798c0465da56f3dcaf502f2d6cdcf5a7b12306de5a087aade2b69f252db410405b6b28c4fca1132c1352d0fe6c2d08592b2181e6e55d074316
@@ -1 +0,0 @@
1
- 4d0cfcc1bf88aa54510e40e931bbd329a5a5120b0ec0b44373101d69c677326d57f7b0ae664a3bffd2dbaf877e01fb349823d4c299dd7b0075fb83fd07ba5cf9
@@ -1 +0,0 @@
1
- fb1d3c1b0fba5299c67dc9dcb0a8daaac0e5589dd6c3835e66ac37eea20cd6457d765c3513cade7de789de9185f2aec2cdbe486f0c9d91f9e8dd342873745a25