In Android wear TileService we have to use LayoutElementBuilders.Text
for displaying Text. In xml we can use autoSizeTextType
for TextView.
How can i apply this property in LayoutElementBuilders.Text
for wear TileService
?
I didn't find any method in the Builder.
Here i am sharing my solution to solve my problem.
Requirement was not to change font size when user change display font size from setting.
For fixed size i have to use font size in
dp
indimen
file like20dp
.In
DimensionBuilders.SpProp.Builder
class methodsetValue
expect value insp
.In
LayoutElementBuilders.FontStyle.Builder
class methodsetSize
expectSpProp
.So i have to calculate a scale factor and multiply with dp value.