Sp
data class Sp
kotlin.Any  
↳  androidx.ui.core.Sp 
Dimension value representing scaled pixels (sp). Font related APIs specify their dimensions such as font size in SP with Sp objects. Sp are normally defined using sp, which can be applied to Int, Double, and Float. val leftMargin = 10.sp val rightMargin = 10f.sp val topMargin = 20.0.sp val bottomMargin = 10.sp Drawing is done in pixels. To retrieve the pixel size of a Dp, use toPx: val lineThicknessPx = lineThickness.toPx(context) toPx is normally needed only for painting operations.
Summary
Public constructors 


Dimension value representing scaled pixels (sp). 
Public methods 


operator Int 
Support comparing Dimensions with comparison operators. 
operator Sp 
Divide a Sp by a scalar. 
operator Sp  
operator Float 
Divide by another Sp to get a scalar. 
operator Sp 
Subtract a Sp from another one. 
operator Sp 
Add two Sps together. 
operator Sp 
Multiply a Sp by a scalar. 
operator Sp  
operator Sp 
This is the same as multiplying the Sp by 1. 
Extension functions 


From androidx.ui.core

Properties 


Float 
Companion properties 


Sp 
Infinite Sp dimension. 
Public constructors
<init>
Sp(value: Float)
Dimension value representing scaled pixels (sp). Font related APIs specify their dimensions such as font size in SP with Sp objects. Sp are normally defined using sp, which can be applied to Int, Double, and Float. val leftMargin = 10.sp val rightMargin = 10f.sp val topMargin = 20.0.sp val bottomMargin = 10.sp Drawing is done in pixels. To retrieve the pixel size of a Dp, use toPx: val lineThicknessPx = lineThickness.toPx(context) toPx is normally needed only for painting operations.
Public methods
compareTo
inline operator fun compareTo(other: Sp
): Int
Support comparing Dimensions with comparison operators.
Properties
value
val value: Float