This site requires javascript.
Android Code Search
file:androidx/health/connect/client/units/Energy.kt symbol:calories
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
health/connect/connect-client/src/main/java/androidx/health/connect/client/units/
Energy.kt
content_copy
Preview
33:
34:
35:
@
get
:JvmName(
"getCalories"
)
val
in
Calories
: Double
get
() = value * type.caloriesPerUnit
83:
84:
85:
86:
87:
88:
/** Creates [Energy] with the specified value in calories. */
@JvmStatic
fun
calories
(value: Double): Energy = Energy(value, Type.CALORIES)
/** Creates [Energy] with the specified value in kilocalories. */
@JvmStatic
fun
kilo
calories
(value: Double): Energy = Energy(value, Type.KILOCALORIES)
96:
97:
98:
private
enum
class
Type {
CALORIES
{
override
val
calories
PerUnit: Double =
1.0
100:
101:
102:
},
KILO
CALORIES
{
override
val
calories
PerUnit: Double =
1000.0
120:
121:
122:
@
get
:JvmSynthetic
val
Double.
calories
: Energy
get
() = Energy.calories(value = this)
125:
126:
127:
@
get
:JvmSynthetic
val
Long.
calories
: Energy
get
() = toDouble().calories
130:
131:
132:
@
get
:JvmSynthetic
val
Float.
calories
: Energy
get
() = toDouble().calories
135:
136:
137:
@
get
:JvmSynthetic
val
Int.
calories
: Energy
get
() = toDouble().calories
140:
141:
142:
@
get
:JvmSynthetic
val
Double.kilo
calories
: Energy
get
() = Energy.kilocalories(value = this)
unfold_more
Show 7 more matching lines
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