Olivier Patry
03/22/2021, 5:10 PMView.onSizeChanged()
), what is the DPI of the screen where my "view" is (≃`Context.resources.displayMetrics`)
→ I'm aware there is no such "view" in the 100% Compose world, what I'd like is the have such thing within the layout for the result of a given composableHalil Ozercan
03/22/2021, 5:57 PMonGloballyPositioned
would help you with "position in window". To get the size, there are BoxConstraints
and onSizeChanged
Olivier Patry
03/22/2021, 6:26 PMAdam Powell
03/22/2021, 8:17 PMPopup
which already can anchor to a specific location in a parent layoutOlivier Patry
03/22/2021, 9:50 PMDropdownMenu
(which I needed to something else, but also requiring to be anchored to a toolbar button).
I now better understand such concepts and I'll be able to go further 👍Olivier Patry
03/22/2021, 10:01 PMLocalDensity
for font scale and density but nothing for DPIAdam Powell
03/23/2021, 12:11 AMdensity = screenDpi / 160.0
Olivier Patry
03/23/2021, 7:37 AMLocalDensity.current.density == 1
So, the DPI is 160 with your suggestion.
My computation based on my screen returns 102f and
AwtToolkit.getDefaultToolkit().screenResolution == 102
So, I'm confused 🤔Adam Powell
03/23/2021, 2:07 PMAdam Powell
03/23/2021, 2:09 PMOlivier Patry
03/23/2021, 2:21 PMAdam Powell
03/23/2021, 2:24 PMAdam Powell
03/23/2021, 2:26 PMOlivier Patry
03/23/2021, 2:39 PMOlivier Patry
03/23/2021, 2:40 PMAdam Powell
03/23/2021, 2:44 PMOlivier Patry
03/23/2021, 2:59 PM