Skip to content

Commit fce59a1

Browse files
authored
[MOO-1126]: TakePicture function in NativeMobileResources presentationStyle changed (#69)
2 parents e65fd32 + 1c08b66 commit fce59a1

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

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

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

77
## [Unreleased]
88

9-
## [5.0.1] Native Mobile Resources - 2023-7-31
9+
### Fixed
1010

11+
- We updated the default presentation mode for both "Take Picture" and "Take Picture Advanced" to full screen.
12+
13+
## [5.0.1] Native Mobile Resources - 2023-7-31
1114

1215
## [3.0.2] BarChart
16+
1317
### Fixed
1418

1519
- We fixed an issue when running with Mx10 crashes the app.

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

0 commit comments

Comments
 (0)