We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
Content DistributionDevelopment GuideDynamic EngineBasic FunctionsAdaptation<StepCount>

<StepCount>

Function

This component is implemented by using the global variable #steps_value. You can reference #steps_value through the <Text> tag to display the step count. This component is available only in EMUI 10.1.0.160 and later versions (supported versions may vary according to the device model). In other versions, the variable value is 0, and you are advised not to display step counts.

Scenarios

  • Display different medals for different values of #steps_value, for example, display the Health-Conscious Medal when the value reaches 10000.
  • Display images of landscape at different altitudes for different values of #steps_value.
  • Display images of food with different calories for different values of #steps_value, for example, display a bag of potato chips when the value reaches 5000.
  • Display different growth stages of a plant for different values of #steps_value.

Examples

Use format and paras to display the current step count.

Collapse
Word wrap
Dark theme
Copy code
  1. <Text x="100" y="1500" format="Current step count: %d" paras="#steps_value" size="50" color="#ff000000" visibility="ifelse(#steps_value,1,0)"/>
Search in Distribute Content
Enter a keyword.