diff --git a/nymea-app/nymea-app.pro b/nymea-app/nymea-app.pro index 39f5b870..3f368f1d 100644 --- a/nymea-app/nymea-app.pro +++ b/nymea-app/nymea-app.pro @@ -161,7 +161,3 @@ BR=$$BRANDING target.path = /usr/bin INSTALLS += target -contains(ANDROID_TARGET_ARCH,) { - ANDROID_ABIS = \ - armeabi-v7a -} diff --git a/nymea-app/ui/delegates/InterfaceTile.qml b/nymea-app/ui/delegates/InterfaceTile.qml index f1ed5c0f..7f83d8b2 100644 --- a/nymea-app/ui/delegates/InterfaceTile.qml +++ b/nymea-app/ui/delegates/InterfaceTile.qml @@ -52,12 +52,21 @@ MainPageTile { onClicked: { var page; + // Only one item? Go streight to the thing page + if (devicesProxy.count === 1) { + page = app.interfaceListToDevicePage([iface.name]); + pageStack.push(Qt.resolvedUrl("../devicepages/" + page), {thing: devicesProxy.get(0)}) + return; + } + + // No (supported by app) interfaces at all? Open generic list if (!iface) { page = "GenericDeviceListPage.qml" pageStack.push(Qt.resolvedUrl("../devicelistpages/" + page), {hiddenInterfaces: app.supportedInterfaces, filterTagId: root.filterTagId}) return; } + // Open interface specific things list switch (iface.name) { case "heating": case "sensor": diff --git a/nymea-app/ui/devicelistpages/ClosablesDeviceListPage.qml b/nymea-app/ui/devicelistpages/ClosablesDeviceListPage.qml index 2abd3a61..bb442646 100644 --- a/nymea-app/ui/devicelistpages/ClosablesDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/ClosablesDeviceListPage.qml @@ -163,7 +163,7 @@ DeviceListPageBase { } } onClicked: { - enterPage(index, false) + enterPage(index) } } } diff --git a/nymea-app/ui/devicelistpages/DeviceListPageBase.qml b/nymea-app/ui/devicelistpages/DeviceListPageBase.qml index 0cd7853a..cc1b43f3 100644 --- a/nymea-app/ui/devicelistpages/DeviceListPageBase.qml +++ b/nymea-app/ui/devicelistpages/DeviceListPageBase.qml @@ -42,24 +42,13 @@ Page { property alias hiddenInterfaces: thingsProxyInternal.hiddenInterfaces property alias filterTagId: thingsProxyInternal.filterTagId - Component.onCompleted: { - if (thingsProxyInternal.count === 1) { - enterPage(0, true) - } - } - property var devicesProxy: thingsProxyInternal property var thingsProxy: thingsProxyInternal - function enterPage(index, replace) { + function enterPage(index) { var thing = thingsProxy.get(index); var page = app.interfaceListToDevicePage(root.shownInterfaces); -// var page = "GenericDevicePage.qml"; - if (replace) { - pageStack.replace(Qt.resolvedUrl("../devicepages/" + page), {thing: thingsProxy.get(index)}) - } else { - pageStack.push(Qt.resolvedUrl("../devicepages/" + page), {thing: thingsProxy.get(index)}) - } + pageStack.push(Qt.resolvedUrl("../devicepages/" + page), {thing: thingsProxy.get(index)}) } DevicesProxy { diff --git a/nymea-app/ui/devicelistpages/GarageThingListPage.qml b/nymea-app/ui/devicelistpages/GarageThingListPage.qml index 694f5946..c6eaa856 100644 --- a/nymea-app/ui/devicelistpages/GarageThingListPage.qml +++ b/nymea-app/ui/devicelistpages/GarageThingListPage.qml @@ -97,7 +97,7 @@ DeviceListPageBase { Binding { target: contentLoader.item; property: "device"; value: itemDelegate.device } } onClicked: { - enterPage(index, false) + enterPage(index) } } } diff --git a/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml b/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml index 2014d5ae..0efbf889 100644 --- a/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/GenericDeviceListPage.qml @@ -61,7 +61,7 @@ DeviceListPageBase { width: parent.width device: engine.deviceManager.devices.getDevice(model.id); onClicked: { - enterPage(index, false) + enterPage(index) } } } diff --git a/nymea-app/ui/devicelistpages/LightsDeviceListPage.qml b/nymea-app/ui/devicelistpages/LightsDeviceListPage.qml index c68cbf78..20cf2b8f 100644 --- a/nymea-app/ui/devicelistpages/LightsDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/LightsDeviceListPage.qml @@ -188,7 +188,7 @@ DeviceListPageBase { } } onClicked: { - enterPage(index, false) + enterPage(index) } } } diff --git a/nymea-app/ui/devicelistpages/MediaDeviceListPage.qml b/nymea-app/ui/devicelistpages/MediaDeviceListPage.qml index 987e2735..47b0d159 100644 --- a/nymea-app/ui/devicelistpages/MediaDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/MediaDeviceListPage.qml @@ -222,7 +222,7 @@ DeviceListPageBase { } } onClicked: { - enterPage(index, false) + enterPage(index) } } } diff --git a/nymea-app/ui/devicelistpages/PowerSocketsDeviceListPage.qml b/nymea-app/ui/devicelistpages/PowerSocketsDeviceListPage.qml index f71595ec..5503f786 100644 --- a/nymea-app/ui/devicelistpages/PowerSocketsDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/PowerSocketsDeviceListPage.qml @@ -120,7 +120,7 @@ DeviceListPageBase { } } onClicked: { - enterPage(index, false) + enterPage(index) } } } diff --git a/nymea-app/ui/devicelistpages/SensorsDeviceListPage.qml b/nymea-app/ui/devicelistpages/SensorsDeviceListPage.qml index e87b31ab..a9fd6e2c 100644 --- a/nymea-app/ui/devicelistpages/SensorsDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/SensorsDeviceListPage.qml @@ -185,7 +185,7 @@ DeviceListPageBase { } } onClicked: { - enterPage(index, false) + enterPage(index) } } } diff --git a/nymea-app/ui/devicelistpages/SmartMeterDeviceListPage.qml b/nymea-app/ui/devicelistpages/SmartMeterDeviceListPage.qml index 8cba58c8..9cd3be70 100644 --- a/nymea-app/ui/devicelistpages/SmartMeterDeviceListPage.qml +++ b/nymea-app/ui/devicelistpages/SmartMeterDeviceListPage.qml @@ -155,7 +155,7 @@ DeviceListPageBase { } } onClicked: { - enterPage(index, false) + enterPage(index) } } }