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

Reset zoom on card flip in ReviewerFragment #17723

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

gayatriii0803
Copy link
Contributor

Purpose / Description

In new reviewer, zoom should reset on card flip

Fixes

Approach

The solution is to toggle the loadWithOverviewMode setting off and then back on. This forces the WebView to loads its content and apply the correct scaling.

How Has This Been Tested?

Physical device (OPPO F21 Pro 5G).

WhatsApp.Video.2025-01-05.at.11.04.19.PM.mp4

Learning (optional, can help others)

https://stackoverflow.com/a/61627280/22445612

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

mikehardy

This comment was marked as outdated.

@mikehardy mikehardy added the Needs Author Reply Waiting for a reply from the original author label Jan 6, 2025
Copy link
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

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

Call it inside showingAnswer's collector

That will reset the zoom every time a card is flipped. No need to call it in every button listener like the suggestion above.

Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

@BrayanDSO to the rescue from my overly-complicated suggestion vs this clean patch, thanks

@mikehardy mikehardy removed the Needs Author Reply Waiting for a reply from the original author label Jan 6, 2025
@mikehardy mikehardy dismissed BrayanDSO’s stale review January 6, 2025 13:02

great suggestion, implemented and working locally in testing

@mikehardy mikehardy added this pull request to the merge queue Jan 6, 2025
@mikehardy
Copy link
Member

just merging this one, it's now a simple named function called in one spot for an effective 3 lines of code, working locally

Merged via the queue into ankidroid:main with commit 166c880 Jan 6, 2025
9 checks passed
@github-actions github-actions bot added this to the 2.21 release milestone Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In new reviewer, zoom should reset on card flip
3 participants