import QtQuick 2.0 import Ubuntu.Components 0.1 import Ubuntu.Components.ListItems 0.1 as ListItem import "components" /*! \brief MainView with a Label and Button elements. */ MainView { // objectName for functional testing purposes (autopilot-qt5) objectName: "mainView" // Note! applicationName needs to match the "name" field of the click manifest applicationName: "com.ubuntu.developer.andrew-hayzen.swipeDeleteNoAnimate" /* This property enables the application to change orientation when the device is rotated. The default is false. */ //automaticOrientation: true width: units.gu(100) height: units.gu(75) ListModel { id: testModel ListElement { text: "TestA" } ListElement { text: "TestB" } ListElement { text: "TestC" } } Page { title: i18n.tr("Simple") ListView { id: testListView anchors.fill: parent model: testModel delegate: testDelegate spacing: units.gu(1) } Component { id: testDelegate ListItem.Standard { id: testListItem height: units.gu(10) removable: true confirmRemoval: true state: index === testListView.currentIndex ? "current" : "" Label { anchors.fill: parent text: model.text } onItemRemoved: { testModel.remove(index); } states: State { name: "current" PropertyChanges { target: testListItem height: units.gu(30) } } transitions: Transition { from: ",current" to: "current," NumberAnimation { duration: 250 properties: "height" } } } } Component.onCompleted: { testListView.currentIndex = 1; } } }