googleads / googleads/googleads-mobile-android-examples
Bug: samples don't calculate dp values properly
Open
@malandr2 is already working on this.
Since Feb 4, 2025.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.9k
- Avg merge
- 15d 19h
- Merged PRs (30d)
- 1
Description
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)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.