FitnessPage.qml Example File
wearable/qml/Fitness/FitnessPage.qml
import QtQuick 2.7
import QtQuick.Controls 2.0 as QQ2
import "../Style"
import "fitness.js" as FitnessData
Item {
QQ2.SwipeView {
id: svFitnessContainer
anchors.fill: parent
Item {
id: fitnessPage1
Column {
anchors.centerIn: parent
spacing: 15
Text {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Steps: ") + FitnessData.getSteps()
font.italic: true
font.pixelSize: UIStyle.fontSizeM
color: UIStyle.colorQtGray1
}
Image {
anchors.horizontalCenter: parent.horizontalCenter
source: "images/man-walking.png"
}
Text {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Calories: ") + FitnessData.getCalories()
font.pixelSize: UIStyle.fontSizeS
font.italic: true
color: UIStyle.colorQtGray3
}
}
}
Item {
id: fitnessPage2
Column {
anchors.centerIn: parent
spacing: 15
Text {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Distance: ")
+ FitnessData.getDistance()
+ qsTr(" miles")
font.italic: true
font.pixelSize: UIStyle.fontSizeM
color: UIStyle.colorQtGray1
}
Image {
anchors.horizontalCenter: parent.horizontalCenter
source: "images/man-running.png"
}
Text {
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Time: ")
+ FitnessData.getTime()
+ qsTr(" mins")
font.pixelSize: UIStyle.fontSizeS
font.italic: true
color: UIStyle.colorQtGray3
}
}
}
}
QQ2.PageIndicator {
count: svFitnessContainer.count
currentIndex: svFitnessContainer.currentIndex
anchors.bottom: svFitnessContainer.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
}