Skip to content

Commit 2c417a3

Browse files
authored
[MOO-1126]: TakePicture function in NativeMobileResources presentationStyle changed for mx 9.24 (#68)
2 parents 19fcfc3 + f30839d commit 2c417a3

File tree

8 files changed

+54
-14
lines changed

8 files changed

+54
-14
lines changed

packages/jsActions/mobile-resources-native/CHANGELOG.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,113 +6,139 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- Minimum mx version set to 9.24.1
12+
- We updated the default presentation mode for both "Take Picture" and "Take Picture Advanced" to full screen.
13+
914
## [4.0.3] Native Mobile Resources - 2023-5-24
15+
1016
### Fixed
1117

1218
- We've updated react-native-device-info library.
1319

1420
## [3.2.2] BottomSheet
21+
1522
### Fixed
1623

1724
- We've updated react-native-device-info library.
1825

1926
## [1.0.2] Gallery
27+
2028
### Fixed
2129

2230
- We've updated react-native-device-info library.
2331

2432
## [3.2.3] IntroScreen
33+
2534
### Fixed
2635

2736
- We've updated react-native-device-info library.
2837

2938
## [4.0.2] Native Mobile Resources - 2023-5-17
3039

31-
3240
## [3.0.1] BarChart
41+
3342
### Fixed
3443

3544
- We fixed an issue where height or width with a value of 0 crash the app.
3645

3746
## [2.0.1] ColumnChart
47+
3848
### Fixed
3949

4050
- We fixed an issue where height or width with a value of 0 crash the app.
4151

4252
## [3.0.1] LineChart
53+
4354
### Fixed
4455

4556
- We fixed an issue where height or width with a value of 0 crash the app.
4657

4758
## [2.0.1] PieDoughnutChart
59+
4860
### Fixed
4961

5062
- We fixed an issue where height or width with a value of 0 crash the app.
5163

5264
## [4.0.0] Native Mobile Resources - 2023-3-28
65+
5366
undefined
5467

5568
## [4.0.0] AppEvents
69+
5670
## BREAKING
5771

5872
- We made the widget compatible with React Native 0.70.7
5973

6074
## [3.0.0] BarChart
75+
6176
## BREAKING
6277

6378
- We made the widget compatible with React Native 0.70.7
6479

6580
## [4.0.0] BarcodeScanner
81+
6682
## BREAKING
6783

6884
- We made the widget compatible with React Native 0.70.7
6985

7086
## [3.0.0] Carousel
87+
7188
## BREAKING
7289

7390
- We made the widget compatible with React Native 0.70.7
7491

7592
## [2.0.0] ColorPicker
93+
7694
## BREAKING
7795

7896
- We made the widget compatible with React Native 0.70.7
7997

8098
## [2.0.0] ColumnChart
99+
81100
## BREAKING
82101

83102
- We made the widget compatible with React Native 0.70.7
84103

85104
## [4.0.0] FloatingActionButton
105+
86106
## BREAKING
87107

88108
- We made the widget compatible with React Native 0.70.7
89109

90110
## [3.0.0] LineChart
111+
91112
## BREAKING
92113

93114
- We made the widget compatible with React Native 0.70.7
94115

95116
## [3.0.0] ListViewSwipe
117+
96118
## BREAKING
97119

98120
- We made the widget compatible with React Native 0.70.7
99121

100122
## [4.0.0] Maps
123+
101124
## BREAKING
102125

103126
- We made the widget compatible with React Native 0.70.7
104127

105128
## [4.0.0] Notifications
129+
106130
## BREAKING
107131

108132
- We made the widget compatible with React Native 0.70.7
109133

110134
## [2.0.0] PieDoughnutChart
135+
111136
## BREAKING
112137

113138
- We made the widget compatible with React Native 0.70.7
114139

115140
## [3.0.0] PopupMenu
141+
116142
### Added
117143

118144
- Added id for testing
@@ -122,41 +148,49 @@ undefined
122148
- We made the widget compatible with React Native 0.70.7
123149

124150
## [4.2.1] ProgressBar
151+
125152
### Changed
126153

127154
- Bumped react-native-progress dependency
128155

129156
## [3.1.1] ProgressCircle
157+
130158
### Changed
131159

132160
- Bumped react-native-progress dependency
133161

134162
## [3.0.0] Rating
163+
135164
## BREAKING
136165

137166
- We made the widget compatible with React Native 0.70.7
138167

139168
## [2.0.0] Signature
169+
140170
## BREAKING
141171

142172
- We made the widget compatible with React Native 0.70.7
143173

144174
## [3.0.0] Slider
175+
145176
## BREAKING
146177

147178
- We made the widget compatible with React Native 0.70.7
148179

149180
## [4.0.0] VideoPlayer
181+
150182
## BREAKING
151183

152184
- We made the widget compatible with React Native 0.70.7
153185

154186
## [4.0.0] WebView
187+
155188
## BREAKING
156189

157190
- We made the widget compatible with React Native 0.70.7
158191

159192
## [3.13.1] Native Mobile Resources - 2022-12-28
193+
160194
### Changed
161195

162196
- We reduced the widget file size by reducing the dependencies list file size.

packages/jsActions/mobile-resources-native/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"url": "https://github.com/mendix/native-widgets.git"
1010
},
1111
"marketplace": {
12-
"minimumMXVersion": "9.24.0.2965",
12+
"minimumMXVersion": "9.24.1.4658",
1313
"marketplaceId": 109513
1414
},
1515
"testProject": {
1616
"githubUrl": "https://github.com/mendix/native-mobile-resources",
17-
"branchName": "main"
17+
"branchName": "lts/mx/9.24"
1818
},
1919
"scripts": {
2020
"prestart": "rimraf ./dist/tsc",
@@ -52,4 +52,4 @@
5252
"rimraf": "^2.7.1",
5353
"rollup": "^2.68.0"
5454
}
55-
}
55+
}

packages/jsActions/mobile-resources-native/src/camera/TakePicture.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function TakePicture(
7777

7878
function takePicture(): Promise<string | undefined> {
7979
return new Promise((resolve, reject) => {
80-
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptionsV4();
80+
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptions();
8181
getPictureMethod()
8282
.then(method =>
8383
method(options, (response: ImagePickerV2Response | ImagePickerResponse) => {
@@ -241,9 +241,10 @@ export async function TakePicture(
241241
};
242242
}
243243

244-
function getOptionsV4(): CameraOptions | ImageLibraryOptions {
244+
function getOptions(): CameraOptions | ImageLibraryOptions {
245245
const { maxWidth, maxHeight } = getPictureQuality();
246246
return {
247+
presentationStyle: "fullScreen",
247248
mediaType: "photo" as const,
248249
maxWidth,
249250
maxHeight

packages/jsActions/mobile-resources-native/src/camera/TakePictureAdvanced.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export async function TakePictureAdvanced(
130130

131131
function takePicture(): Promise<ImagePickerV2Response | ImagePickerResponse | undefined> {
132132
return new Promise((resolve, reject) => {
133-
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptionsV4();
133+
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptions();
134134
getPictureMethod()
135135
.then(method =>
136136
method(options, (response: ImagePickerV2Response | ImagePickerResponse) => {
@@ -294,9 +294,10 @@ export async function TakePictureAdvanced(
294294
};
295295
}
296296

297-
function getOptionsV4(): CameraOptions | ImageLibraryOptions {
297+
function getOptions(): CameraOptions | ImageLibraryOptions {
298298
const { maxWidth, maxHeight } = getPictureQuality();
299299
return {
300+
presentationStyle: "fullScreen",
300301
mediaType: "photo" as const,
301302
maxWidth,
302303
maxHeight

packages/jsActions/nanoflow-actions-native/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- Minimum mx version set to 9.24.1
12+
913
## [2.6.1] Nanoflow Commons - 2022-9-23
1014

1115
### Fixed

packages/jsActions/nanoflow-actions-native/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"url": "https://github.com/mendix/native-widgets.git"
1010
},
1111
"marketplace": {
12-
"minimumMXVersion": "9.24.0.2965",
12+
"minimumMXVersion": "9.24.1.4658",
1313
"marketplaceId": 109515
1414
},
1515
"testProject": {
1616
"githubUrl": "https://github.com/mendix/native-mobile-resources",
17-
"branchName": "main"
17+
"branchName": "lts/mx/9.24"
1818
},
1919
"scripts": {
2020
"start": "rollup --config ../../../configs/jsactions/rollup.config.js --watch --configProject nanoflowcommons",

scripts/release/createNativeModules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async function updateNativeComponentsTestProject(moduleInfo, tmpFolder, nativeWi
129129
const tmpFolderActions = join(tmpFolder, `javascriptsource/${moduleInfo.moduleFolderNameInModeler}/actions`);
130130

131131
console.log("Updating NativeComponentsTestProject...");
132-
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder);
132+
await cloneRepo(moduleInfo.testProjectUrl, moduleInfo.testProjectBranchName, tmpFolder);
133133

134134
console.log("Deleting existing JS Actions from test project...");
135135
await rm(tmpFolderActions, { force: true, recursive: true }); // this is useful to avoid retaining stale dependencies in the test project.
@@ -199,7 +199,7 @@ async function updateNativeComponentsTestProjectWithAtlas(moduleInfo, tmpFolder)
199199
const tmpFolderNativeStyles = join(tmpFolder, `themesource/${moduleInfo.moduleFolderNameInModeler}`);
200200

201201
console.log("Updating NativeComponentsTestProject..");
202-
await cloneRepo(moduleInfo.testProjectUrl, tmpFolder);
202+
await cloneRepo(moduleInfo.testProjectUrl, moduleInfo.testProjectBranchName, tmpFolder);
203203

204204
console.log("Copying Native styling files..");
205205
await Promise.all([

scripts/release/module-automation/commons.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ async function githubAuthentication(moduleInfo) {
207207
await execShellCommand(`echo "${process.env.GH_PAT}" | gh auth login --with-token`);
208208
}
209209

210-
async function cloneRepo(githubUrl, localFolder) {
210+
async function cloneRepo(githubUrl, githubBranchName, localFolder) {
211211
const githubUrlDomain = githubUrl.replace("https://", "");
212212
const githubUrlAuthenticated = `https://${process.env.GH_USERNAME}:${process.env.GH_PAT}@${githubUrlDomain}`;
213213
await rm(localFolder, { recursive: true, force: true });
214214
await mkdir(localFolder, { recursive: true });
215-
await execShellCommand(`git clone ${githubUrlAuthenticated} ${localFolder}`);
215+
await execShellCommand(`git clone --branch ${githubBranchName} ${githubUrlAuthenticated} ${localFolder}`);
216216
await setLocalGitCredentials(localFolder);
217217
}
218218

0 commit comments

Comments
 (0)