Render ACS pages at their native viewport instead of auto zooming in#46
Open
jim-daf wants to merge 1 commit into
Open
Render ACS pages at their native viewport instead of auto zooming in#46jim-daf wants to merge 1 commit into
jim-daf wants to merge 1 commit into
Conversation
Enable wide viewport plus overview mode so the ACS page is shown at the scale its own viewport meta tag asks for. This stops the WebView from forcing an enlarged view of the form. Fixes LivotovLabs#19
There was a problem hiding this comment.
Pull request overview
This PR adjusts the D3SView WebView configuration so ACS/bank challenge pages respect their declared viewport and don’t initially render “zoomed in,” addressing Issue #19.
Changes:
- Enable
useWideViewPortto make the WebView honor the page’s viewport width. - Enable
loadWithOverviewModeso the content is initially scaled to fit the WebView while still allowing pinch-to-zoom.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private void initUI() { | ||
| getSettings().setJavaScriptEnabled(true); | ||
| getSettings().setBuiltInZoomControls(true); | ||
| // Render bank pages at their native scale so they are not auto zoomed in. |
There was a problem hiding this comment.
The comment says “native scale”, but setLoadWithOverviewMode(true) typically scales the page to fit the WebView (after honoring the page viewport) rather than preserving a true 1:1 “native” scale. Consider rewording to something like “Respect the page viewport and fit the content to the WebView to avoid starting zoomed in” to avoid misleading future readers.
Suggested change
| // Render bank pages at their native scale so they are not auto zoomed in. | |
| // Respect the page viewport and fit the content to the WebView to avoid starting zoomed in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Render bank pages at native scale
Resolves #19
When the ACS page opens, the WebView ignores the page viewport and renders
the body at the default WebView scale, which makes the form appear zoomed
in. The fix is to enable wide viewport plus overview mode so the page is
first laid out at its declared width and then scaled to fit the WebView.
Pinch to zoom still works because
setBuiltInZoomControls(true)is kept.Users who actually want to zoom in can still do so manually, the page just
no longer starts off zoomed in.
Testing
Verified against a Visa sandbox ACS page on a Pixel 6 emulator. Before the
change the form opened roughly 2x. After the change it opens at the same
scale a desktop browser would render it.