-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix frame positions for speedlimit/ align for AA #21365
Conversation
android:orientation="vertical" | ||
android:paddingHorizontal="9dp" | ||
android:paddingVertical="9dp" | ||
android:translationX="-6dp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok in UI?
return new Rect((int) (speedlimitRect.left + padding * density), | ||
(int) (speedlimitRect.top + padding * density), | ||
(int) (speedlimitRect.right - padding * density), | ||
(int) (speedlimitRect.bottom - padding * density)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
padding * density can be stored in local variable
float frameCenterPosition = (calculatedFrameTextHeight / 2) + halfTextHeight; | ||
float yDescr = frameCenterPosition + contentRect.top; | ||
|
||
canvas.drawText(textLimitDescription, xDescr, yDescr, textPaint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like some calculations in drawSpeedLimit & drawSpeedLimitDescription are similar, can we try to simplify it?
No description provided.