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

Add methods to fix/unfix the view's dimens for use in dialogs #93

Merged
merged 1 commit into from
Jan 8, 2014

Conversation

edenman
Copy link
Collaborator

@edenman edenman commented Jan 6, 2014

@JakeWharton this is pretty ugly but I couldn't figure out any other way to keep the dialog from resizing (#65). I suspect this may also address dialog perf issues (#26) but haven't confirmed that yet.

// Fix the layout height/width after the dialog has been shown.
getLayoutParams().height = getMeasuredHeight();
getLayoutParams().width = getMeasuredWidth();
// Post this runnable so it runs _after_ the dimen changes have been applied/re-measured.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is re-measuring guaranteed here? You aren't doing anything to trigger a layout. Or are you assuming the initial layout pass hasn't happened yet?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, nevermind. I get it. You're changing the params to be fixed at the measured size.

@JakeWharton
Copy link
Collaborator

I feel dirty just reading this PR.

JakeWharton added a commit that referenced this pull request Jan 8, 2014
Add methods to fix/unfix the view's dimens for use in dialogs
@JakeWharton JakeWharton merged commit 2de8914 into master Jan 8, 2014
@JakeWharton JakeWharton deleted the edenman/dialog-fix branch January 8, 2014 06:19
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.

3 participants