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

Size not properly calculated in onMeasure #23

Open
javadude opened this issue Oct 25, 2019 · 0 comments
Open

Size not properly calculated in onMeasure #23

javadude opened this issue Oct 25, 2019 · 0 comments

Comments

@javadude
Copy link

TimeDurationPicker.onMeasure doesn't properly set the size of the numPad.

// measure the numPad
// if we have more space available, we can try to grow the num pad
final int numPadWidth = Math.max(minNumPadHeight, displayRowWidth);
final int numPadHeight = Math.max(minNumPadHeight, preferredHeight - displayRowHeight);
numPad.measure(MeasureSpec.makeMeasureSpec(numPadWidth, MeasureSpec.EXACTLY), 
MeasureSpec.makeMeasureSpec(numPadHeight, MeasureSpec.EXACTLY));

For the numPadWidth, I think you want minNumPadWidth instead of minNumPadHeight.

However, using Math.max doesn't work properly on smaller screens. If the available screen height is smaller than the minNumPadHeight, the height you set will be too large (similar for width), and the keyboard gets cut of. For example:

LandscapeNoZeros

killing the zeroes.

I'd put in a pull request, but I don't know if this would kill the expected behavior from other users...

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

No branches or pull requests

1 participant