This site requires javascript.
Android Code Search
file:androidx/compose/ui/unit/Density.kt function:toDp
search
close
info_outline
more_vert
Result 1 of 1
content_copy
Search Result Root
androidx/platform/frameworks/support
keyboard_arrow_right
Branch
Branch
androidx-main
keyboard_arrow_right
Search Result Path
compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/
Density.kt
content_copy
Preview
75:
76:
77:
/** Convert an [Int] pixel value to [Dp]. */
@Stable
fun
Int.
toDp
(): Dp = (this / density).dp
81:
82:
83:
/** Convert a [Float] pixel value to a Dp */
@Stable
fun
Float.
toDp
(): Dp = (this / density).dp
103:
104:
105:
@Stable
fun
Size.
toDp
Size(): DpSize =
if
(isSpecified) {
chevron_left
1
chevron_right
Results per page
10
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Got it
Help
Open branch androidx-main