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

Fixes #19 by continuing to listen for layout/pre-draw events until a valid size is discovered, or the drawer is destroyed #74

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

mattsilber
Copy link
Collaborator

Fixes #19 by continuing to listen for ViewTreeObserver.OnGlobalLayoutListener/ViewTreeObserver.OnPreDrawListener events until a valid size (width and height both greater than 0) is discovered, or the drawer is destroyed (via ScratchoffController#onDestroy -> ScratchaboutLayoutDrawer#destroy).

To enable this new behavior, call setKeepListeningForDrawUntilValidSizeDiscovered with a value of true. Note that this will override the configuration of setAttemptLastDitchPostForLayoutResolutionFailure introduced with 3.0.0.

Assuming this solves #19 at scale, and doesn't introduce any new issues, it will become part of the default behavior in 4.x.

…ize is discovered, or the drawer is destroyed
@mattsilber mattsilber added the bug label Mar 25, 2024
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 90.19608% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 83.76%. Comparing base (45fa3b0) to head (ac93aed).

Files Patch % Lines
...jackpocket/scratchoff/ScratchableLayoutDrawer.java 93.47% 0 Missing and 3 partials ⚠️
...om/jackpocket/scratchoff/ScratchoffController.java 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
+ Coverage   80.80%   83.76%   +2.96%     
==========================================
  Files          10       10              
  Lines         625      659      +34     
  Branches       75       81       +6     
==========================================
+ Hits          505      552      +47     
+ Misses         87       73      -14     
- Partials       33       34       +1     
Flag Coverage Δ
unit 83.76% <90.19%> (+2.96%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mattsilber mattsilber merged commit 9009b6b into main Apr 2, 2024
6 checks passed
@github-actions github-actions bot mentioned this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting crash not everytime but some users ScratchableLayoutDrawer.createBitmapFromScratchableView
1 participant