NotificationsPage.qml Example File
wearable/qml/Notifications/NotificationsPage.qml
import QtQuick 2.7
import QtQuick.Controls 2.0 as QQC2
import "../Style"
import "notifications.js" as NotificationData
ListView {
id: missedCallsView
clip: true
focus: true
boundsBehavior: Flickable.StopAtBounds
snapMode: ListView.SnapToItem
model: ListModel {
id: missedCallsList
}
Image {
id: missedCallIcon
width: parent.width / 2
anchors.right: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
source: "images/missedcall.png"
fillMode: Image.Pad
}
delegate: Item {
height: missedCallsView.height
width: missedCallsView.width / 2
anchors.left: parent.horizontalCenter
Column {
spacing: 15
anchors.verticalCenter: parent.verticalCenter
Image {
anchors.horizontalCenter: parent.horizontalCenter
source: qsTr("images/avatar%1.png").arg(model.gender)
}
Text {
text: model.name
anchors.horizontalCenter: parent.horizontalCenter
font.bold: true
font.pixelSize: UIStyle.fontSizeS
color: UIStyle.colorQtGray1
}
Text {
anchors.horizontalCenter: parent.horizontalCenter
text: date + " " + time
font.pixelSize: UIStyle.fontSizeXS
font.italic: true
color: UIStyle.colorQtGray2
}
}
}
Component.onCompleted: {
NotificationData.populateData(missedCallsList)
}
}