summaryrefslogtreecommitdiffstats
path: root/app/main.qml
diff options
context:
space:
mode:
authortiansen <tian_sen@dl.cn.nexty-ele.com>2018-11-02 20:17:48 +0800
committertiansen <tian_sen@dl.cn.nexty-ele.com>2018-11-02 20:17:48 +0800
commit5a9d121e37b110a8dce34d2a2d506412cac6b2d7 (patch)
tree0249088d27e7f879eff70484c5daae931e2c07c5 /app/main.qml
parentde4e4f75c59b1da4de91a75b3ab7b94d0ab8335f (diff)
Diffstat (limited to 'app/main.qml')
-rw-r--r--app/main.qml121
1 files changed, 73 insertions, 48 deletions
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
+ }
}
}