X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2Fmain.qml;h=a481320a50a41de2ad49bc7c104663122d350b51;hb=refs%2Fheads%2Fsandbox%2Ftiansen%2Fces2019_warehouse;hp=15369cf62f9ad7c1e83c0615991847170638813f;hpb=de4e4f75c59b1da4de91a75b3ab7b94d0ab8335f;p=apps%2Fonscreenapp.git diff --git a/app/main.qml b/app/main.qml index 15369cf..a481320 100644 --- a/app/main.qml +++ b/app/main.qml @@ -1,67 +1,92 @@ +/* + * Copyright (C) 2018 The Qt Company Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import QtQuick 2.6 import QtQuick.Controls 2.0 +import AGL.Demo.Controls 1.0 +import NativeAppModel 1.0 +import ServerAppModel 1.0 + +import 'pages' ApplicationWindow { id: root - color: "#00000000" - - Label { - id: message - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.margins: 20 - font.pixelSize: 75 - wrapMode: Text.WordWrap - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - color: "white" - text: "Only the video’s sound will be available while driving." - } + width: 1080 * screenInfo.scale_factor() + height: 1487 * screenInfo.scale_factor() - background : Image { - id: backgroundImg + SwipeView { + id: stackLayout anchors.fill: parent - anchors.topMargin: 0 - anchors.bottomMargin: 0 + currentIndex: tabBar.currentIndex - visible: true - fillMode: Image.Stretch - source: 'images/black_normal.png' + ListPage { + id: listPage - state: "begin" - states: [ - State { - name: "begin" - PropertyChanges { target: backgroundImg; opacity: 0.25 } - }, - State { - name: "end" - PropertyChanges { target: backgroundImg; opacity: 0.75 } + model: ServerAppModel { + id: listModel } - ] + } + + SearchPage { + id: searchPage - transitions: [ - Transition { - from: "begin"; to: "end" - PropertyAnimation {target: backgroundImg; properties: "opacity"; duration: 2000} + title: 'SearchPage' + } + + ManagementPage { + id: managementPage + + model: NativeAppModel { + id: managementModel } - ] - } + } + + Connections { + target: managementPage.model + onApplistChanged: { + listPage.model.setNativeApplist(applist) + } + } - function showImage(area) { - if (area === 'normal') { - backgroundImg.source = 'images/black_normal.png' - } else { - backgroundImg.source = 'images/black_split.png' + Component.onCompleted: { + listPage.model.getNextPage(0) + managementPage.model.refresh() } - backgroundImg.state = "end" } - - function hideImage() { - backgroundImg.state = "begin" + + footer: TabBar { + id: tabBar + height: 80 + currentIndex: stackLayout.currentIndex + + TabButton { + text: "List" + font.pixelSize: 20 + height: parent.height + } + TabButton { + text: "Search" + font.pixelSize: 20 + height: parent.height + } + TabButton { + text: "Management" + font.pixelSize: 20 + height: parent.height + } } }