From 2b9880b91f18d6bd13face803051808838ff7584 Mon Sep 17 00:00:00 2001 From: Bramastyo Harimukti Date: Tue, 26 Feb 2019 07:59:19 +0100 Subject: Add parking app for Neptune 3 UI Change-Id: Ia6d8af02cd9b029003732c8d188748a9cb3b99a7 Reviewed-by: Vladimir Minenko --- com.pelagicore.parking/Main.qml | 297 ++++++++++++++++++++++ com.pelagicore.parking/assets/ticket_bg.png | Bin 0 -> 16005 bytes com.pelagicore.parking/com.pelagicore.parking.pro | 14 + com.pelagicore.parking/icon.png | Bin 0 -> 2190 bytes com.pelagicore.parking/info.yaml | 13 + 5 files changed, 324 insertions(+) create mode 100644 com.pelagicore.parking/Main.qml create mode 100644 com.pelagicore.parking/assets/ticket_bg.png create mode 100644 com.pelagicore.parking/com.pelagicore.parking.pro create mode 100644 com.pelagicore.parking/icon.png create mode 100644 com.pelagicore.parking/info.yaml diff --git a/com.pelagicore.parking/Main.qml b/com.pelagicore.parking/Main.qml new file mode 100644 index 0000000..4ecef3c --- /dev/null +++ b/com.pelagicore.parking/Main.qml @@ -0,0 +1,297 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtAuto Extra Apps. +** +** $QT_BEGIN_LICENSE:BSD-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: BSD-3-Clause +** +****************************************************************************/ + +import QtQuick 2.8 +import shared.utils 1.0 +import shared.animations 1.0 +import QtQuick.Controls 2.2 +import application.windows 1.0 +import shared.Sizes 1.0 +import shared.Style 1.0 +import shared.controls 1.0 + +ApplicationCCWindow { + id: root + + property bool parkingStarted: false + + Item { + x: root.exposedRect.x + y: root.exposedRect.y + width: root.exposedRect.width + height: root.exposedRect.height + + Image { + id: topContent + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + width: parent.width + height: Sizes.dp(500) + source: Style.image("app-fullscreen-top-bg", Style.theme) + + + Label { + text: "No active parking tickets" + anchors.centerIn: parent + font.weight: Font.Light + opacity: !root.parkingStarted ? 1.0 : 0.0 + Behavior on opacity { DefaultNumberAnimation {} } + } + + Image { + width: root.width * 0.8 + height: topContent.height + source: "assets/ticket_bg.png" + anchors.top: parent.top + anchors.right: parent.right + anchors.rightMargin: root.parkingStarted ? 0 : - width * 0.85 + Behavior on anchors.rightMargin { DefaultNumberAnimation {} } + + Column { + anchors.left: parent.left + anchors.leftMargin: Sizes.dp(130) + anchors.verticalCenter: parent.verticalCenter + spacing: Sizes.dp(80) + opacity: root.parkingStarted ? 1.0 : 0.0 + Behavior on opacity { DefaultNumberAnimation {} } + + Label { + text: "Zone \nParking Olympia" + font.weight: Font.Light + color: "black" + } + + Label { + text: "1275" + opacity: Style.opacityLow + font.weight: Font.Bold + font.pixelSize: Sizes.fontSizeXXL + color: "black" + } + } + + Rectangle { + id: ticketContent + property date currentTime: new Date() + + width: parent.width / 2 + height: Sizes.dp(425) + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenterOffset: Sizes.dp(-12) + color: Style.accentColor + opacity: root.parkingStarted ? 1.0 : 0.0 + Behavior on opacity { DefaultNumberAnimation {} } + + onOpacityChanged: { + if (opacity === 1.0) { + ticketContent.currentTime = new Date() + } + } + + Column { + anchors.left: parent.left + anchors.leftMargin: Sizes.dp(60) + anchors.top: parent.top + anchors.topMargin: Sizes.dp(80) + spacing: Sizes.dp(45) + + Label { + + text: "Started: \ntoday " + Qt.formatDateTime(ticketContent.currentTime, "hh:mm") + font.weight: Font.Light + opacity: Style.opacityHigh + color: "black" + } + + Label { + text: "2h, 14 minutes" + font.weight: Font.Light + opacity: Style.opacityHigh + color: "black" + } + + Label { + text: "2.29 $" + font.weight: Font.Light + opacity: Style.opacityHigh + color: "black" + } + } + } + } + } + + + Item { + width: parent.width + height: parent.height - topContent.height + anchors.top: topContent.bottom + + Row { + anchors.top: parent.top + anchors.topMargin: Sizes.dp(60) + anchors.left: parent.left + anchors.leftMargin: Sizes.dp(50) + spacing: Sizes.dp(200) + + Column { + spacing: Sizes.dp(50) + + Label { + text: "Zone" + font.weight: Font.Light + opacity: Style.opacityMedium + font.pixelSize: Sizes.fontSizeL + } + + Row { + spacing: Sizes.dp(60) + + Column { + Label { + text: "Every day 12 - 22" + font.weight: Font.Light + font.pixelSize: Sizes.fontSizeS + opacity: Style.opacityMedium + } + + Label { + text: "Other times" + font.weight: Font.Light + font.pixelSize: Sizes.fontSizeS + opacity: Style.opacityMedium + } + + Label { + text: "Service fee" + font.weight: Font.Light + font.pixelSize: Sizes.fontSizeS + opacity: Style.opacityMedium + } + } + + Column { + Label { + text: "1.5 $ / started hour" + font.weight: Font.Light + font.pixelSize: Sizes.fontSizeS + opacity: Style.opacityMedium + } + + Label { + text: "1 $ / started hour" + font.weight: Font.Light + font.pixelSize: Sizes.fontSizeS + opacity: Style.opacityMedium + } + + Label { + text: "0.29 $" + font.weight: Font.Light + font.pixelSize: Sizes.fontSizeS + opacity: Style.opacityMedium + } + } + } + } + + Column { + spacing: Sizes.dp(250) + + Label { + anchors.right: parent.right + text: "1275, Parking Olympia" + font.weight: Font.Light + opacity: Style.opacityMedium + } + + Button { + id: startButton + implicitWidth: Sizes.dp(250) + implicitHeight: Sizes.dp(70) + font.pixelSize: Sizes.fontSizeM + checkable: true + checked: root.parkingStarted + text: !root.parkingStarted ? "Start" : "End (2.29 $)" + + background: Rectangle { + color: { + if (startButton.checked) { + return "red"; + } else { + return "green"; + } + } + opacity: { + if (startButton.pressed) { + return 0.1; + } else if (startButton.checked) { + return 0.3; + } else { + return 0.3; + } + } + Behavior on opacity { DefaultNumberAnimation {} } + Behavior on color { ColorAnimation { duration: 200 } } + + radius: width / 2 + } + + onClicked: root.parkingStarted = !root.parkingStarted + } + } + } + } + } +} diff --git a/com.pelagicore.parking/assets/ticket_bg.png b/com.pelagicore.parking/assets/ticket_bg.png new file mode 100644 index 0000000..62c2c89 Binary files /dev/null and b/com.pelagicore.parking/assets/ticket_bg.png differ diff --git a/com.pelagicore.parking/com.pelagicore.parking.pro b/com.pelagicore.parking/com.pelagicore.parking.pro new file mode 100644 index 0000000..82bd0f0 --- /dev/null +++ b/com.pelagicore.parking/com.pelagicore.parking.pro @@ -0,0 +1,14 @@ +TEMPLATE = aux + +FILES += info.yaml \ + icon.png \ + Main.qml + +app.files = $$FILES +app.path = /apps/com.pelagicore.parking +INSTALLS += app + +AM_MANIFEST = info.yaml +AM_PACKAGE_DIR = $$app.path + +load(am-app) diff --git a/com.pelagicore.parking/icon.png b/com.pelagicore.parking/icon.png new file mode 100644 index 0000000..8056112 Binary files /dev/null and b/com.pelagicore.parking/icon.png differ diff --git a/com.pelagicore.parking/info.yaml b/com.pelagicore.parking/info.yaml new file mode 100644 index 0000000..6f83d05 --- /dev/null +++ b/com.pelagicore.parking/info.yaml @@ -0,0 +1,13 @@ +formatVersion: 1 +formatType: am-application +--- +id: 'com.pelagicore.parking' +icon: 'icon.png' +code: 'Main.qml' +runtime: 'qml' +name: + en: 'Parking' + de: 'Parking' + cs: 'Parking' + +categories: [ 'other' ] -- cgit v1.2.3