Skip to content

Conversation

@toupper
Copy link
Contributor

@toupper toupper commented May 24, 2023

Closes: #9806

Description

With this PR we increase the screen brightness when the Scan to Pay screen is shown, so the QR code can be scanned in an easier way. Once that screen disappears, we reset the value to the previous one, which was captured when the view is created.

Testing instructions

Set your device brightness to a medium value, so the brightness increase is more easily noticeable

  1. Run the app
  2. Go to menu
  3. Go to Payments
  4. Tap on Collect Payment and follow the flow
  5. On the Payment Methods screen tap on Scan to Pay
  6. Notice that the screen brightness is increased
  7. Tap on done
  8. Notice that the screen brightness goes back to the previous value

Screenshots


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@toupper toupper added type: task An internally driven task. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. labels May 24, 2023
@toupper toupper added this to the 13.8 milestone May 24, 2023
@toupper toupper requested a review from iamgabrielma May 24, 2023 09:52
@peril-woocommerce
Copy link

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 2 days Please, make sure to get it merged by then or assign it to a later expiring milestone

Generated by 🚫 dangerJS

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 24, 2023

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr9807-8cfa1c3 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@iamgabrielma iamgabrielma self-assigned this May 25, 2023
Copy link
Contributor

@iamgabrielma iamgabrielma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests well!

Physical device:

Before onAppear 0.25
After setting brightness 1.0
Before onDisappear 1.0
After restoring original brightness 0.25

Simulator:

Before onAppear 0.5
After setting brightness 0.5
Before onDisappear 0.5
After restoring original brightness 0.5

Non-blocking side-notes:

  • Should we add a note that this will work on physical device only?
  • I see the notice that UIScreen.main will be deprecated, and that we should start to use UIScreen instances through context instead.

@toupper
Copy link
Contributor Author

toupper commented May 25, 2023

Thanks for the review @iamgabrielma ! To answer your questions:

Should we add a note that this will work on physical device only?

Great point, I added a comment in 8cfa1c3

I see the notice that UIScreen.main will be deprecated, and that we should start to use UIScreen instances through context instead.

That is also a good question. As there is no easy way to find the UIScreen through context in SwiftUI, and we have other references through the app, I think it's easier to leave it here and address it when we tackle the warning for all cases.

@toupper toupper enabled auto-merge May 25, 2023 08:47
@toupper toupper merged commit 0bd238a into trunk May 25, 2023
@toupper toupper deleted the issue/9806-scan-to-pay-screen-brightness branch May 25, 2023 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: mobile payments Related to mobile payments / card present payments / Woo Payments. type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Scan to Pay] Increase screen brightness when the QR code screen is shown

4 participants