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

hide margins if no overlay text #1951

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benomaire
Copy link
Contributor

No description provided.

Comment on lines +525 to +532
if(!didDraw){
setPadding(horizontalSafeOffset, topSafeOffset, horizontalSafeOffset, bottomSafeOffset);
} else {
setPadding(horizontalSafeOffset,
topBottom + topSafeOffset,
horizontalSafeOffset,
topBottom + bottomSafeOffset);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

jazakumAllah khairan - may we move this back into setIsScrollable with a check? this onDraw method gets called every frame, so we want to keep it as light as possible - whereas setIsScrollable just happens once

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure, but I don't see an easy way to move this block back to setIsScrollable, because setIsScrollable is not aware of what happens in onDraw

Some observations:

  • show pages 1 and 2 (landscape, dual page) for the first time, then setIsScrollable is executed 8 times and onDraw is executed 6 times.
  • swipe to pages 3 and 4, then setIsScrollable is executed 2 times and onDraw is executed 4 times (reduces to 2 times when this if block is removed).
  • swipe back to pages 1 and 2, then only setIsScrollable is executed twice.

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.

2 participants