From 455b6399b3a807daf4aace28a70ecb455d74c855 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 13 Mar 2017 14:22:17 +0100 Subject: Wearable: cleanup NotificationsPage Change-Id: Idc8376405e113a9837fbe43fbf85681cf9ed8737 Reviewed-by: Mitch Curtis --- .../qml/Notifications/NotificationsPage.qml | 115 ++++++++------------- 1 file changed, 41 insertions(+), 74 deletions(-) (limited to 'examples') diff --git a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml index 24a93e48..d5bec2f8 100644 --- a/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml +++ b/examples/quickcontrols2/wearable/qml/Notifications/NotificationsPage.qml @@ -53,92 +53,59 @@ import QtQuick.Controls 2.0 as QQC2 import "../Style" import "notifications.js" as NotificationData -Item { - QQC2.SwipeView { - id: svNotificationsContainer +ListView { + id: missedCallsView - anchors.fill: parent + clip: true + focus: true + boundsBehavior: Flickable.StopAtBounds + snapMode: ListView.SnapToItem - Item { - id: notificationsPage1 - - ListModel { - id: missedCallsList - } - - Row { - anchors.fill: parent - leftPadding: 30 - spacing: 2 + model: ListModel { + id: missedCallsList + } - Image { - id: missedCallIcon - anchors.verticalCenter: parent.verticalCenter - height: 64 - width: 64 - source: "images/missedcall.png" - } + Image { + id: missedCallIcon + width: parent.width / 2 + anchors.right: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + source: "images/missedcall.png" + fillMode: Image.Pad + } - ListView { - id: missedCallsView - width: parent.width - missedCallIcon.width - height: parent.height + delegate: Item { + height: missedCallsView.height + width: missedCallsView.width / 2 + anchors.left: parent.horizontalCenter - clip: true - focus: true - boundsBehavior: Flickable.StopAtBounds - snapMode: ListView.SnapToItem + Column { + spacing: 15 + anchors.verticalCenter: parent.verticalCenter - model: missedCallsList + Image { + anchors.horizontalCenter: parent.horizontalCenter + source: qsTr("images/avatar%1.png").arg(model.gender) + } - delegate: Item { - height: missedCallsView.height - width: missedCallsView.width - Column { - anchors.fill: parent - spacing: 15 - topPadding: 35 - Image { - anchors.horizontalCenter: - parent.horizontalCenter - height: 64 - width: 64 - source: (gender == "m") ? - "images/avatarm.png" - :"images/avatarf.png" - } + Text { + text: model.name + anchors.horizontalCenter: parent.horizontalCenter + font.bold: true + font.pixelSize: UIStyle.fontSizeS + color: UIStyle.colorQtGray1 + } - Text { - anchors.horizontalCenter: - parent.horizontalCenter - text: name - 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 - } - } - } - } + Text { + anchors.horizontalCenter: parent.horizontalCenter + text: date + " " + time + font.pixelSize: UIStyle.fontSizeXS + font.italic: true + color: UIStyle.colorQtGray2 } } } - QQC2.PageIndicator { - count: svNotificationsContainer.count - currentIndex: svNotificationsContainer.currentIndex - - anchors.bottom: svNotificationsContainer.bottom - anchors.horizontalCenter: parent.horizontalCenter - } - Component.onCompleted: { NotificationData.populateData(missedCallsList) } -- cgit v1.2.3