← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~ubuntu-weather-dev/ubuntu-weather-app/reboot-finish-listitem-migration into lp:ubuntu-weather-app

 

Victor Thompson has proposed merging lp:~ubuntu-weather-dev/ubuntu-weather-app/reboot-finish-listitem-migration into lp:ubuntu-weather-app with lp:~ahayzen/ubuntu-weather-app/reboot-uc1.3-bump as a prerequisite.

Commit message:
* Finish the migration to the new SDK list items
* Lock weather app in the Portrait orientation until we get some landscape designs
* Make the page with bottom edge animation less jarring when it reaches the top by adding a fake header (similar to what the clock app does)

Requested reviews:
  Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot): continuous-integration
  Andrew Hayzen (ahayzen)
  Jenkins Bot (ubuntu-core-apps-jenkins-bot): continuous-integration

For more details, see:
https://code.launchpad.net/~ubuntu-weather-dev/ubuntu-weather-app/reboot-finish-listitem-migration/+merge/278209

* Finished the migration to the new SDK list items
* Locked weather app in the Portrait orientation until we get some landscape designs
* Made the page with bottom edge animation less jarring when it reaches the top by adding a fake header (similar to what the clock app does)
* Buy nik90 a beer for starting this effort
-- 
Your team Ubuntu Weather Developers is subscribed to branch lp:~ubuntu-weather-dev/ubuntu-weather-app/reboot-finish-listitem-migration.
=== modified file 'app/components/CMakeLists.txt'
--- app/components/CMakeLists.txt	2015-03-03 18:37:59 +0000
+++ app/components/CMakeLists.txt	2015-11-20 19:48:21 +0000
@@ -1,5 +1,3 @@
-add_subdirectory(ListItemActions)
-
 file(GLOB COMPONENTS_QML_JS_FILES *.qml *.js)
 
 add_custom_target(ubuntu-weather-app_components_QMlFiles ALL SOURCES ${COMPONENTS_QML_JS_FILES})

=== removed directory 'app/components/ListItemActions'
=== removed file 'app/components/ListItemActions/CMakeLists.txt'
--- app/components/ListItemActions/CMakeLists.txt	2015-03-03 18:37:59 +0000
+++ app/components/ListItemActions/CMakeLists.txt	1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
-file(GLOB LISTITEMACTIONS_QML_JS_FILES *.qml *.js)
-
-add_custom_target(ubuntu-weather-app_listitemactions_QMlFiles ALL SOURCES ${LISTITEMACTIONS_QML_JS_FILES})
-
-install(FILES ${LISTITEMACTIONS_QML_JS_FILES} DESTINATION ${UBUNTU-WEATHER_APP_DIR}/components/ListItemActions)

=== removed file 'app/components/ListItemActions/CheckBox.qml'
--- app/components/ListItemActions/CheckBox.qml	2015-06-18 01:45:57 +0000
+++ app/components/ListItemActions/CheckBox.qml	1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2012-2014, 2015 Canonical, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.4
-import Ubuntu.Components 1.2
-
-CheckBox {
-    checked: root.selected
-    width: implicitWidth
-    // disable item mouse area to avoid conflicts with parent mouse area
-    __mouseArea.enabled: false
-}

=== removed file 'app/components/ListItemActions/Remove.qml'
--- app/components/ListItemActions/Remove.qml	2015-06-18 01:42:03 +0000
+++ app/components/ListItemActions/Remove.qml	1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2014, 2015 Andrew Hayzen <ahayzen@xxxxxxxxx>
- *                    Daniel Holm <d.holmen@xxxxxxxxx>
- *                    Victor Thompson <victor.thompson@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.4
-import Ubuntu.Components 1.2
-
-Action {
-    id: removeAction
-    iconName: "delete"
-    objectName: "swipeDeleteAction"
-    text: i18n.tr("Remove")
-}

=== removed file 'app/components/ListItemReorderComponent.qml'
--- app/components/ListItemReorderComponent.qml	2015-06-18 01:42:03 +0000
+++ app/components/ListItemReorderComponent.qml	1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (C) 2013, 2014, 2015
- *      Andrew Hayzen <ahayzen@xxxxxxxxx>
- *      Nekhelesh Ramananthan <krnekhelesh@xxxxxxxxx>
- *      Victor Thompson <victor.thompson@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.4
-import Ubuntu.Components 1.2
-
-
-Item {
-    id: actionReorder
-    width: units.gu(4)
-
-    Icon {
-        anchors {
-            horizontalCenter: parent.horizontalCenter
-            verticalCenter: parent.verticalCenter
-        }
-        name: "navigation-menu"  // TODO: use proper image
-        height: width
-        width: units.gu(3)
-    }
-
-    MouseArea {
-        id: actionReorderMouseArea
-        anchors {
-            fill: parent
-        }
-        property int startY: 0
-        property int startContentY: 0
-
-        onPressed: {
-            root.parent.parent.interactive = false;  // stop scrolling of listview
-            startY = root.y;
-            startContentY = root.parent.parent.contentY;
-            root.z += 10;  // force ontop of other elements
-
-            console.debug("Reorder listitem pressed", root.y)
-        }
-        onMouseYChanged: root.y += mouse.y - (root.height / 2);
-        onReleased: {
-            console.debug("Reorder diff by position", getDiff());
-
-            var diff = getDiff();
-
-            // Remove the height of the actual item if moved down
-            if (diff > 0) {
-                diff -= 1;
-            }
-
-            root.parent.parent.interactive = true;  // reenable scrolling
-
-            if (diff === 0) {
-                // Nothing has changed so reset the item
-                // z index is restored after animation
-                resetListItemYAnimation.start();
-            }
-            else {
-                var newIndex = index + diff;
-
-                if (newIndex < 0) {
-                    newIndex = 0;
-                }
-                else if (newIndex > root.parent.parent.count - 1) {
-                    newIndex = root.parent.parent.count - 1;
-                }
-
-                root.z -= 10;  // restore z index
-                reorder(index, newIndex)
-            }
-        }
-
-        function getDiff() {
-            // Get the amount of items that have been passed over (by centre)
-            return Math.round((((root.y - startY) + (root.parent.parent.contentY - startContentY)) / root.height) + 0.5);
-        }
-    }
-
-    SequentialAnimation {
-        id: resetListItemYAnimation
-        UbuntuNumberAnimation {
-            target: root;
-            property: "y";
-            to: actionReorderMouseArea.startY
-        }
-        ScriptAction {
-            script: {
-                root.z -= 10;  // restore z index
-            }
-        }
-    }
-}

=== removed file 'app/components/ListItemWithActions.qml'
--- app/components/ListItemWithActions.qml	2015-06-18 01:42:03 +0000
+++ app/components/ListItemWithActions.qml	1970-01-01 00:00:00 +0000
@@ -1,496 +0,0 @@
-/*
- * Copyright (C) 2012-2015 Canonical, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.4
-import Ubuntu.Components 1.2
-import Ubuntu.Components.ListItems 1.0 as ListItem
-
-
-Item {
-    id: root
-    width: parent.width
-
-    property Action leftSideAction: null
-    property list<Action> rightSideActions
-    property double defaultHeight: units.gu(8)
-    property bool locked: false
-    property Action activeAction: null
-    property var activeItem: null
-    property bool triggerActionOnMouseRelease: false
-    property color color: Theme.palette.normal.background
-    property color selectedColor: "#E6E6E6"
-    property bool selected: false
-    property bool selectionMode: false
-    property alias internalAnchors: mainContents.anchors
-    default property alias contents: mainContents.children
-
-    readonly property double actionWidth: units.gu(4)
-    readonly property double leftActionWidth: units.gu(10)
-    readonly property double actionThreshold: actionWidth * 0.4
-    readonly property double threshold: 0.4
-    readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
-    readonly property alias swipping: mainItemMoving.running
-    readonly property bool _showActions: mouseArea.pressed || swipeState != "Normal" || swipping
-
-    property alias _main: main  // CUSTOM
-    property alias pressed: mouseArea.pressed  // CUSTOM
-
-    /* internal */
-    property var _visibleRightSideActions: filterVisibleActions(rightSideActions)
-
-    signal itemClicked(var mouse)
-    signal itemPressAndHold(var mouse)
-
-    function returnToBoundsRTL(direction)
-    {
-        var actionFullWidth = actionWidth + units.gu(2)
-
-        // go back to normal state if swipping reverse
-        if (direction === "LTR") {
-            updatePosition(0)
-            return
-        } else if (!triggerActionOnMouseRelease) {
-            updatePosition(-rightActionsView.width + units.gu(2))
-            return
-        }
-
-        var xOffset = Math.abs(main.x)
-        var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
-        var newX = 0
-
-        if (index === _visibleRightSideActions.length) {
-            newX = -(rightActionsView.width - units.gu(2))
-        } else if (index >= 1) {
-            newX = -(actionFullWidth * index)
-        }
-
-        updatePosition(newX)
-    }
-
-    function returnToBoundsLTR(direction)
-    {
-        var finalX = leftActionWidth
-        if ((direction === "RTL") || (main.x <= (finalX * root.threshold)))
-            finalX = 0
-        updatePosition(finalX)
-    }
-
-    function returnToBounds(direction)
-    {
-        if (main.x < 0) {
-            returnToBoundsRTL(direction)
-        } else if (main.x > 0) {
-            returnToBoundsLTR(direction)
-        } else {
-            updatePosition(0)
-        }
-    }
-
-    function contains(item, point, marginX)
-    {
-        var itemStartX = item.x - marginX
-        var itemEndX = item.x + item.width + marginX
-        return (point.x >= itemStartX) && (point.x <= itemEndX) &&
-               (point.y >= item.y) && (point.y <= (item.y + item.height));
-    }
-
-    function getActionAt(point)
-    {
-        if (leftSideAction && contains(leftActionViewLoader.item, point, 0)) {
-            return leftSideAction
-        } else if (contains(rightActionsView, point, 0)) {
-            var newPoint = root.mapToItem(rightActionsView, point.x, point.y)
-            for (var i = 0; i < rightActionsRepeater.count; i++) {
-                var child = rightActionsRepeater.itemAt(i)
-                if (contains(child, newPoint, units.gu(1))) {
-                    return i
-                }
-            }
-        }
-        return -1
-    }
-
-    function updateActiveAction()
-    {
-        if (triggerActionOnMouseRelease &&
-            (main.x <= -(root.actionWidth + units.gu(2))) &&
-            (main.x > -(rightActionsView.width - units.gu(2)))) {
-            var actionFullWidth = actionWidth + units.gu(2)
-            var xOffset = Math.abs(main.x)
-            var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
-            index = index - 1
-            if (index > -1) {
-                root.activeItem = rightActionsRepeater.itemAt(index)
-                root.activeAction = root._visibleRightSideActions[index]
-            }
-        } else {
-            root.activeAction = null
-        }
-    }
-
-    function resetSwipe()
-    {
-        updatePosition(0)
-    }
-
-    function filterVisibleActions(actions)
-    {
-        var visibleActions = []
-        for(var i = 0; i < actions.length; i++) {
-            var action = actions[i]
-            if (action.visible) {
-                visibleActions.push(action)
-            }
-        }
-        return visibleActions
-    }
-
-    function updatePosition(pos)
-    {
-        if (!root.triggerActionOnMouseRelease && (pos !== 0)) {
-            mouseArea.state = pos > 0 ? "RightToLeft" : "LeftToRight"
-        } else {
-            mouseArea.state = ""
-        }
-        main.x = pos
-    }
-
-    // CUSTOM remove animation
-    SequentialAnimation {
-        id: removeAnimation
-
-        property var action
-
-        UbuntuNumberAnimation {
-            target: root
-            duration: UbuntuAnimation.BriskDuration
-            property: "height";
-            to: 0
-        }
-        ScriptAction {
-            script: removeAnimation.action.trigger()
-        }
-    }
-
-    states: [
-        State {
-            name: "select"
-            when: selectionMode || selected
-            PropertyChanges {
-                target: selectionIcon
-                source: Qt.resolvedUrl("ListItemActions/CheckBox.qml")
-                anchors.leftMargin: units.gu(2)
-            }
-            PropertyChanges {
-                target: root
-                locked: true
-            }
-            PropertyChanges {
-                target: main
-                x: 0
-            }
-        }
-    ]
-
-    height: defaultHeight
-    //clip: height !== defaultHeight  // CUSTOM
-
-    Loader {  // CUSTOM
-        id: leftActionViewLoader
-        anchors {
-            top: parent.top
-            bottom: parent.bottom
-            right: main.left
-        }
-        asynchronous: true
-        sourceComponent: leftSideAction ? leftActionViewComponent : undefined
-    }
-
-    Component {  // CUSTOM
-        id: leftActionViewComponent
-
-        Rectangle {
-            id: leftActionView
-            width: root.leftActionWidth + actionThreshold
-            color: UbuntuColors.red
-
-            Icon {
-                id: leftActionIcon
-                anchors {
-                    centerIn: parent
-                    horizontalCenterOffset: actionThreshold / 2
-                }
-                objectName: "swipeDeleteAction"  // CUSTOM
-                name: leftSideAction && _showActions ? leftSideAction.iconName : ""
-                color: Theme.palette.selected.field
-                height: units.gu(3)
-                width: units.gu(3)
-            }
-        }
-    }
-
-    //Rectangle {
-    Item {  // CUSTOM
-       id: rightActionsView
-
-       anchors {
-           top: main.top
-           left: main.right
-           bottom: main.bottom
-       }
-       visible: _visibleRightSideActions.length > 0
-       width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(2) : 0
-       // color: "white"  // CUSTOM
-
-       Row {
-           anchors{
-               top: parent.top
-               left: parent.left
-               leftMargin: units.gu(2)
-               right: parent.right
-               rightMargin: units.gu(2)
-               bottom: parent.bottom
-           }
-           spacing: units.gu(2)
-           Repeater {
-               id: rightActionsRepeater
-
-               model: _showActions ? _visibleRightSideActions : []
-               Item {
-                   property alias image: img
-
-                   height: rightActionsView.height
-                   width: root.actionWidth
-
-                   Icon {
-                       id: img
-
-                       anchors.centerIn: parent
-                       objectName: rightSideActions[index].objectName  // CUSTOM
-                       width: units.gu(3)
-                       height: units.gu(3)
-                       name: modelData.iconName
-                       color: root.activeAction === modelData ? UbuntuColors.orange : UbuntuColors.coolGrey  // CUSTOM
-                   }
-               }
-           }
-       }
-    }
-
-    Rectangle {
-        id: main
-        objectName: "mainItem"
-
-        anchors {
-            top: parent.top
-            bottom: parent.bottom
-        }
-
-        width: parent.width
-        color: root.selected ? root.selectedColor : root.color
-
-        Loader {
-            id: selectionIcon
-
-            anchors {
-                left: main.left
-                verticalCenter: main.verticalCenter
-            }
-            asynchronous: true  // CUSTOM
-            width: (status === Loader.Ready) ? item.implicitWidth : 0
-            visible: (status === Loader.Ready) && (item.width === item.implicitWidth)
-
-            Behavior on width {
-                NumberAnimation {
-                    duration: UbuntuAnimation.SnapDuration
-                }
-            }
-        }
-
-        Item {
-            id: mainContents
-
-            anchors {
-                left: selectionIcon.right
-                //leftMargin: units.gu(2)  // CUSTOM
-                top: parent.top
-                //topMargin: units.gu(1)  // CUSTOM
-                right: parent.right
-                //rightMargin: units.gu(2)  // CUSTOM
-                bottom: parent.bottom
-                //bottomMargin: units.gu(1)  // CUSTOM
-            }
-        }
-
-        Behavior on x {
-            UbuntuNumberAnimation {
-                id: mainItemMoving
-
-                easing.type: Easing.OutElastic
-                duration: UbuntuAnimation.SlowDuration
-            }
-        }
-    }
-
-    SequentialAnimation {
-        id: triggerAction
-
-        property var currentItem: root.activeItem ? root.activeItem.image : null
-
-        running: false
-        ParallelAnimation {
-            UbuntuNumberAnimation {
-                target: triggerAction.currentItem
-                property: "opacity"
-                from: 1.0
-                to: 0.0
-                duration: UbuntuAnimation.SlowDuration
-                easing {type: Easing.InOutBack; }
-            }
-            UbuntuNumberAnimation {
-                target: triggerAction.currentItem
-                properties: "width, height"
-                from: units.gu(3)
-                to: root.actionWidth
-                duration: UbuntuAnimation.SlowDuration
-                easing {type: Easing.InOutBack; }
-            }
-        }
-        PropertyAction {
-            target: triggerAction.currentItem
-            properties: "width, height"
-            value: units.gu(3)
-        }
-        PropertyAction {
-            target: triggerAction.currentItem
-            properties: "opacity"
-            value: 1.0
-        }
-        ScriptAction {
-            script: {
-                root.activeAction.triggered(root)
-                mouseArea.state = ""
-            }
-        }
-        PauseAnimation {
-            duration: 500
-        }
-        UbuntuNumberAnimation {
-            target: main
-            property: "x"
-            to: 0
-        }
-    }
-
-    MouseArea {
-        id: mouseArea
-
-        property bool locked: root.locked || ((root.leftSideAction === null) && (root._visibleRightSideActions.count === 0))  // CUSTOM
-        property bool manual: false
-        property string direction: "None"
-        property real lastX: -1
-
-        anchors.fill: parent
-        drag {
-            target: locked ? null : main
-            axis: Drag.XAxis
-            minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0
-            maximumX: leftSideAction ? leftActionViewLoader.item.width : 0
-            threshold: root.actionThreshold
-        }
-
-        states: [
-            State {
-                name: "LeftToRight"
-                PropertyChanges {
-                    target: mouseArea
-                    drag.maximumX: 0
-                }
-            },
-            State {
-                name: "RightToLeft"
-                PropertyChanges {
-                    target: mouseArea
-                    drag.minimumX: 0
-                }
-            }
-        ]
-
-        onMouseXChanged: {
-            var offset = (lastX - mouseX)
-            if (Math.abs(offset) <= root.actionThreshold) {
-                return
-            }
-            lastX = mouseX
-            direction = offset > 0 ? "RTL" : "LTR";
-        }
-
-        onPressed: {
-            lastX = mouse.x
-        }
-
-        onReleased: {
-            if (root.triggerActionOnMouseRelease && root.activeAction) {
-                triggerAction.start()
-            } else {
-                root.returnToBounds()
-                root.activeAction = null
-            }
-            lastX = -1
-            direction = "None"
-        }
-        onClicked: {
-            if (selectionMode) {  // CUSTOM - selecting a listitem should toggle selection if in selectionMode
-                selected = !selected
-                return
-            } else if (main.x === 0) {
-                root.itemClicked(mouse)
-            } else if (main.x > 0) {
-                var action = getActionAt(Qt.point(mouse.x, mouse.y))
-                if (action && action !== -1) {
-                    //action.triggered(root)
-                    removeAnimation.action = action  // CUSTOM - use our animation instead
-                    removeAnimation.start()  // CUSTOM
-                }
-            } else {
-                var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
-
-                if (actionIndex !== -1 && actionIndex !== leftSideAction) {  // CUSTOM - can be leftAction
-                    root.activeItem = rightActionsRepeater.itemAt(actionIndex)
-                    root.activeAction = root.rightSideActions[actionIndex]
-                    triggerAction.start()
-                    return
-                }
-            }
-            root.resetSwipe()
-        }
-
-        onPositionChanged: {
-            if (mouseArea.pressed) {
-                updateActiveAction()
-
-                listItemSwiping(index)  // CUSTOM - tells other listitems to dismiss any swipe
-            }
-        }
-        onPressAndHold: {
-            if (main.x === 0) {
-                root.itemPressAndHold(mouse)
-            }
-        }
-
-        z: -1
-    }
-}

=== removed file 'app/components/MultiSelectHeadState.qml'
--- app/components/MultiSelectHeadState.qml	2015-06-18 01:42:03 +0000
+++ app/components/MultiSelectHeadState.qml	1970-01-01 00:00:00 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2015
- *      Andrew Hayzen <ahayzen@xxxxxxxxx>
- *      Victor Thompson <victor.thompson@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.4
-import Ubuntu.Components 1.2
-
-PageHeadState {
-    id: selectionState
-    actions: [
-        Action {
-            iconName: "select"
-            text: i18n.tr("Select All")
-            onTriggered: {
-                if (listview.selectedItems.length === listview.model.count) {
-                    listview.clearSelection()
-                } else {
-                    listview.selectAll()
-                }
-            }
-        },
-        Action {
-            enabled: listview.selectedItems.length > 0
-            iconName: "delete"
-            text: i18n.tr("Delete")
-            visible: removable
-
-            onTriggered: {
-                removed(listview.selectedItems)
-
-                listview.closeSelection()
-            }
-        }
-
-    ]
-    backAction: Action {
-        text: i18n.tr("Cancel selection")
-        iconName: "back"
-        onTriggered: {
-            listview.clearSelection()
-            listview.state = "normal"
-        }
-    }
-    head: thisPage.head
-    name: "selection"
-
-    PropertyChanges {
-        target: thisPage.head
-        backAction: selectionState.backAction
-        actions: selectionState.actions
-    }
-
-    property ListView listview
-    property bool removable: false
-    property Page thisPage
-
-    signal removed(var selectedItems)
-}

=== modified file 'app/components/MultiSelectListView.qml'
--- app/components/MultiSelectListView.qml	2015-06-18 01:42:03 +0000
+++ app/components/MultiSelectListView.qml	2015-11-20 19:48:21 +0000
@@ -20,21 +20,24 @@
 import QtQuick 2.4
 import Ubuntu.Components 1.2
 
-
 WeatherListView {
-    property var selectedItems: []
-
     signal clearSelection()
     signal closeSelection()
     signal selectAll()
-
-    onClearSelection: selectedItems = []
+    signal reorder(int from, int to)
+
+    onClearSelection: {
+        ViewItems.selectedIndices = []
+    }
+
     onCloseSelection: {
         clearSelection()
-        state = "normal"
+        ViewItems.selectMode = false
+        ViewItems.dragMode = false
     }
+
     onSelectAll: {
-        var tmp = selectedItems
+        var tmp = []
 
         for (var i=0; i < model.count; i++) {
             if (tmp.indexOf(i) === -1) {
@@ -42,11 +45,27 @@
             }
         }
 
-        selectedItems = tmp
+        ViewItems.selectedIndices = tmp
     }
+
     onVisibleChanged: {
         if (!visible) {
             closeSelection()
         }
     }
+
+    moveDisplaced: Transition {
+        UbuntuNumberAnimation {
+            property: "y"
+        }
+    }
+
+    ViewItems.onDragUpdated: {
+        if (event.status === ListItemDrag.Moving) {
+            event.accept = false
+        } else if (event.status === ListItemDrag.Dropped) {
+            model.move(event.from, event.to, 1)
+            reorder(event.from, event.to)
+        }
+    }
 }

=== removed file 'app/components/WeatherListItem.qml'
--- app/components/WeatherListItem.qml	2015-09-29 16:09:21 +0000
+++ app/components/WeatherListItem.qml	1970-01-01 00:00:00 +0000
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2013, 2014, 2015
- *      Andrew Hayzen <ahayzen@xxxxxxxxx>
- *      Nekhelesh Ramananthan <krnekhelesh@xxxxxxxxx>
- *      Victor Thompson <victor.thompson@xxxxxxxxx>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.4
-import Ubuntu.Components 1.2
-
-ListItemWithActions {
-    id: root
-    color: "transparent"
-
-    property int listItemIndex: index
-    property bool multiselectable: false
-    property int previousListItemIndex: -1
-    property bool reorderable: false
-
-    signal reorder(int from, int to)
-
-    onItemPressAndHold: {
-        if (multiselectable) {
-            selectionMode = true
-        }
-    }
-
-    onListItemIndexChanged: {
-        var i = parent.parent.selectedItems.lastIndexOf(previousListItemIndex)
-
-        if (i !== -1) {
-            parent.parent.selectedItems[i] = listItemIndex
-        }
-
-        previousListItemIndex = listItemIndex
-    }
-
-    onSelectedChanged: {
-        if (selectionMode) {
-            var tmp = parent.parent.selectedItems
-
-            if (selected) {
-                if (parent.parent.selectedItems.indexOf(listItemIndex) === -1) {
-                    tmp.push(listItemIndex)
-                    parent.parent.selectedItems = tmp
-                }
-            } else {
-                tmp.splice(parent.parent.selectedItems.indexOf(listItemIndex), 1)
-                parent.parent.selectedItems = tmp
-            }
-        }
-    }
-
-    onSelectionModeChanged: {
-        if (reorderable && selectionMode) {
-            resetSwipe()
-        }
-
-        for (var j=0; j < _main.children.length; j++) {
-            if (_main.children[j] !== actionReorderLoader) {
-                _main.children[j].anchors.rightMargin = reorderable && selectionMode ? actionReorderLoader.width + units.gu(2) : 0
-            }
-        }
-
-        parent.parent.state = selectionMode ? "multiselectable" : "normal"
-
-        if (!selectionMode) {
-            selected = false
-        }
-    }
-
-    /* Highlight the listitem on press */
-    Rectangle {
-        id: listItemBrighten
-        color: root.pressed ? UbuntuColors.coolGrey : "transparent"
-        opacity: 0.1
-        height: root.height
-        x: root.x - parent.x  // -parent.x due to selectionIcon in ListItemWithActions
-        width: root.width
-    }
-
-    /* Reorder Component */
-    Loader {
-        id: actionReorderLoader
-        active: reorderable && selectionMode && root.parent.parent.selectedItems.length === 0
-        anchors {
-            bottom: parent.bottom
-            right: parent.right
-            rightMargin: units.gu(1)
-            top: parent.top
-        }
-        asynchronous: true
-        source: "ListItemReorderComponent.qml"
-    }
-
-    Item {
-        Connections {  // Only allow one ListItem to be swiping at any time
-            target: weatherApp
-            onListItemSwiping: {
-                if (i !== index) {
-                    root.resetSwipe();
-                }
-            }
-        }
-
-        Connections {  // Connections from signals in the ListView
-            target: root.parent.parent
-            onClearSelection: selected = false
-            onFlickingChanged: {
-                if (root.parent.parent.flicking) {
-                    root.resetSwipe()
-                }
-            }
-            onSelectAll: selected = true
-            onStateChanged: selectionMode = root.parent.parent.state === "multiselectable"
-        }
-    }
-
-    Component.onCompleted: {  // reload settings as delegates are destroyed
-        if (parent.parent.selectedItems.indexOf(index) !== -1) {
-            selected = true
-        }
-
-        selectionMode = root.parent.parent.state === "multiselectable"
-    }
-}

=== modified file 'app/components/WeatherListView.qml'
--- app/components/WeatherListView.qml	2015-06-18 01:42:03 +0000
+++ app/components/WeatherListView.qml	2015-11-20 19:48:21 +0000
@@ -20,8 +20,7 @@
 import QtQuick 2.4
 import Ubuntu.Components 1.2
 
-
-ListView {
+UbuntuListView {
     Component.onCompleted: {
         // FIXME: workaround for qtubuntu not returning values depending on the grid unit definition
         // for Flickable.maximumFlickVelocity and Flickable.flickDeceleration

=== modified file 'app/ui/LocationsPage.qml'
--- app/ui/LocationsPage.qml	2015-10-22 12:49:35 +0000
+++ app/ui/LocationsPage.qml	2015-11-20 19:48:21 +0000
@@ -18,22 +18,19 @@
 
 import QtQuick 2.4
 import Ubuntu.Components 1.2
-import Ubuntu.Components.ListItems 0.1 as ListItem
+import Ubuntu.Components.ListItems 1.0 as ListItems
 import "../components"
-import "../components/ListItemActions"
-
 
 Page {
     id: locationsPage
     objectName: "locationsPage"
     title: i18n.tr("Locations")
 
-    state: locationsListView.state === "multiselectable" ? "selection" : "default"
+    state: "default"
     states: [
         PageHeadState {
-            id: defaultState
-            head: locationsPage.head
             name: "default"
+            head: locationsPage.head
             actions: [
                 Action {
                     iconName: "add"
@@ -48,12 +45,28 @@
                 }
             }
         },
-        MultiSelectHeadState {
-            listview: locationsListView
-            removable: true
-            thisPage: locationsPage
-
-            onRemoved: storage.removeMultiLocations(selectedItems.slice());
+        PageHeadState {
+            name: "selection"
+            head: locationsPage.head
+            when: locationsListView.ViewItems.selectMode
+            backAction: Action {
+                iconName: "back"
+                onTriggered: {
+                    locationsListView.closeSelection()
+                    locationsPage.state = "default"
+                }
+            }
+            actions: [
+                Action {
+                    iconName: "delete"
+                    enabled: locationsListView.ViewItems.selectedIndices.length !== 0
+                    onTriggered: {
+                        storage.removeMultiLocations(locationsListView.ViewItems.selectedIndices)
+                        locationsListView.closeSelection()
+                        locationsPage.state = "default"
+                    }
+                }
+            ]
         }
     ]
 
@@ -73,17 +86,16 @@
         }
         header: MultiSelectListView {
             id: currentLocationListView
-            anchors {
-                left: parent.left
-                right: parent.right
-            }
-            height: settings.addedCurrentLocation && settings.detectCurrentLocation ? units.gu(8) : units.gu(0)
+
+            height: settings.addedCurrentLocation && settings.detectCurrentLocation ? units.gu(7) : units.gu(0)
             interactive: false
             model: currentLocationModel
-            delegate: WeatherListItem {
+            width: parent.width
+
+            delegate: ListItem {
                 id: currentLocationListItem
 
-                onItemClicked: {
+                onClicked: {
                     settings.current = index;
                     pageStack.pop()
                 }
@@ -154,39 +166,48 @@
                     horizontalAlignment: Text.AlignRight
                     text: temp + settings.tempScale
                 }
+
+                ListItems.ThinDivider { anchors.bottom: parent.bottom }
             }
         }
 
-        delegate: WeatherListItem {
+        // Added a thindivider to the listview since by default the last listitem does not show
+        // a thindivider which does not follow design specs.
+        footer: ListItems.ThinDivider {
+            visible: locationsModel.count !== 0
+        }
+
+        onReorder: {
+            console.debug("Move: ", from, to);
+            storage.moveLocation(from, to);
+        }
+
+        delegate: ListItem {
             id: locationsListItem
             objectName: "location" + index
-            leftSideAction: Remove {
-                onTriggered: storage.removeLocation(index)
-            }
-            multiselectable: true
-            reorderable: true
-
-            onItemClicked: {
-                if (settings.addedCurrentLocation && settings.detectCurrentLocation) {
+
+            leadingActions: ListItemActions {
+                actions: [
+                    Action {
+                        iconName: 'delete'
+                        onTriggered: storage.removeLocation(index)
+                    }
+                ]
+            }
+
+            onPressAndHold: {
+                ListView.view.ViewItems.selectMode = !ListView.view.ViewItems.selectMode
+                ListView.view.ViewItems.dragMode = !ListView.view.ViewItems.dragMode
+            }
+
+            onClicked: {
+                if (!selectMode) {
                     settings.current = index + 1;
-                } else {
-                    settings.current = index;
+                    pageStack.pop()
                 }
 
                 pageStack.pop()
             }
-            onReorder: {
-                console.debug("Move: ", from, to);
-
-                storage.moveLocation(from, to);
-            }
-
-            ListItem.ThinDivider {
-                anchors {
-                    top: parent.top
-                }
-                visible: index == 0
-            }
 
             Item {
                 anchors {
@@ -252,12 +273,6 @@
                     visible: locationsPage.state === "default"
                 }
             }
-
-            ListItem.ThinDivider {
-                anchors {
-                    bottom: parent.bottom
-                }
-            }
         }
     }
 

=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot	2015-11-10 02:02:19 +0000
+++ po/com.ubuntu.weather.pot	2015-11-20 19:48:21 +0000
@@ -62,26 +62,10 @@
 msgid "Today"
 msgstr ""
 
-#: ../app/components/ListItemActions/Remove.qml:26
-msgid "Remove"
-msgstr ""
-
 #: ../app/components/LocationsPageEmptyStateComponent.qml:36
 msgid "No locations found. Tap the plus icon to search for one."
 msgstr ""
 
-#: ../app/components/MultiSelectHeadState.qml:27
-msgid "Select All"
-msgstr ""
-
-#: ../app/components/MultiSelectHeadState.qml:39
-msgid "Delete"
-msgstr ""
-
-#: ../app/components/MultiSelectHeadState.qml:51
-msgid "Cancel selection"
-msgstr ""
-
 #: ../app/components/NetworkErrorStateComponent.qml:48
 msgid "Network Error"
 msgstr ""
@@ -136,11 +120,15 @@
 msgid "OK"
 msgstr ""
 
-#: ../app/ui/HomePage.qml:31 ../app/ui/LocationsPage.qml:29
+#: ../app/ui/HomePage.qml:31 ../app/ui/LocationsPage.qml:27
 msgid "Locations"
 msgstr ""
 
+<<<<<<< TREE
+#: ../app/ui/LocationsPage.qml:121
+=======
 #: ../app/ui/LocationsPage.qml:109
+>>>>>>> MERGE-SOURCE
 msgid "Current Location"
 msgstr ""
 


Follow ups