Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MOO-1126]: TakePicture function in NativeMobileResources presentationStyle changed #69

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/jsActions/mobile-resources-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

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

- We updated the default presentation mode for both "Take Picture" and "Take Picture Advanced" to full screen.

## [5.0.1] Native Mobile Resources - 2023-7-31

## [3.0.2] BarChart

### Fixed

- We fixed an issue when running with Mx10 crashes the app.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

function takePicture(): Promise<string | undefined> {
return new Promise((resolve, reject) => {
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptionsV4();
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptions();
getPictureMethod()
.then(method =>
method(options, (response: ImagePickerV2Response | ImagePickerResponse) => {
Expand Down Expand Up @@ -241,9 +241,10 @@
};
}

function getOptionsV4(): CameraOptions | ImageLibraryOptions {
function getOptions(): CameraOptions | ImageLibraryOptions {
const { maxWidth, maxHeight } = getPictureQuality();
return {
presentationStyle: "fullScreen",
mediaType: "photo" as const,
maxWidth,
maxHeight
Expand Down Expand Up @@ -321,7 +322,7 @@
);
}

function handleImagePickerV4Error(errorCode: ErrorCode, errorMessage?: string) {

Check warning on line 325 in packages/jsActions/mobile-resources-native/src/camera/TakePicture.ts

View workflow job for this annotation

GitHub Actions / Unit tests

Missing return type on function
switch (errorCode) {
case "camera_unavailable":
showAlert("The camera is unavailable", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@

function takePicture(): Promise<ImagePickerV2Response | ImagePickerResponse | undefined> {
return new Promise((resolve, reject) => {
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptionsV4();
const options = nativeVersionMajor === 2 ? getOptionsV2() : getOptions();
getPictureMethod()
.then(method =>
method(options, (response: ImagePickerV2Response | ImagePickerResponse) => {
Expand Down Expand Up @@ -294,9 +294,10 @@
};
}

function getOptionsV4(): CameraOptions | ImageLibraryOptions {
function getOptions(): CameraOptions | ImageLibraryOptions {
const { maxWidth, maxHeight } = getPictureQuality();
return {
presentationStyle: "fullScreen",
mediaType: "photo" as const,
maxWidth,
maxHeight
Expand Down Expand Up @@ -384,7 +385,7 @@
});
}

function handleImagePickerV4Error(errorCode: ErrorCode, errorMessage?: string) {

Check warning on line 388 in packages/jsActions/mobile-resources-native/src/camera/TakePictureAdvanced.ts

View workflow job for this annotation

GitHub Actions / Unit tests

Missing return type on function
switch (errorCode) {
case "camera_unavailable":
showAlert("The camera is unavailable.", "");
Expand Down
Loading