Skip to content

Bug: samples don't calculate dp values properly #796

@AndroidDeveloperLB

Description

@AndroidDeveloperLB

When looking at the samples, I've noticed their calculation is losing the precision in a wrong way, so they can actually fail to get the ad that fits the size properly:

The conversion should be like this:

val displayMetrics = resources.displayMetrics
val adWidthInDp = TypedValueCompat.deriveDimension(TypedValue.COMPLEX_UNIT_DIP, adWidthPixels.toFloat(), displayMetrics)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions