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

[SES-2441] Fix longpress message fails #1570

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

bemusementpark
Copy link

View#drawToBitmap fails if isLaidOut is false which happens often for some reason. This PR reinstates a previous fix by utilising our own definition of drawToBitmap without this isLaidOut check.

@bemusementpark bemusementpark changed the title Fix longpress message fails [SES-2441] Fix longpress message fails Jul 25, 2024
Copy link
Collaborator

@ThomasSession ThomasSession left a comment

Choose a reason for hiding this comment

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

I wonder what the implication of bypassing that flag is... Surely it's there for a reason but it works without it, soooooo........

@ThomasSession ThomasSession merged commit a495ec2 into oxen-io:dev Jul 25, 2024
1 check passed
@bemusementpark
Copy link
Author

I wonder what the implication of bypassing that flag is... Surely it's there for a reason but it works without it, soooooo........

    /**
     * Returns true if this view has been through at least one layout since it
     * was last attached to or detached from a window.
     */
    public boolean isLaidOut() {
        return (mPrivateFlags3 & PFLAG3_IS_LAID_OUT) == PFLAG3_IS_LAID_OUT;
    }

I think it's just problematic because items in a RecyclerView get added/removed and probably doesn't always need layouts when it's already measured and it's probably moved around by other means e.g. translation.

I guess I could've guarded height or width but if you can click this thing, then you kinda know it has positive size.

@bemusementpark bemusementpark deleted the longpress branch July 25, 2024 06:26
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