← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~nik90/ubuntu-clock-app/dynamic-load-listview into lp:ubuntu-clock-app

 

Nekhelesh Ramananthan has proposed merging lp:~nik90/ubuntu-clock-app/dynamic-load-listview into lp:ubuntu-clock-app.

Commit message:
Improved ExpandableListItem by dynamically loading/unloading its ListView. Also removed Column from ExpandableListItem to make it lighter.

Requested reviews:
  Ubuntu Clock Developers (ubuntu-clock-dev)

For more details, see:
https://code.launchpad.net/~nik90/ubuntu-clock-app/dynamic-load-listview/+merge/287831

Improved ExpandableListItem by dynamically loading/unloading its ListView. Also removed Column from ExpandableListItem to make it lighter.
-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~nik90/ubuntu-clock-app/dynamic-load-listview into lp:ubuntu-clock-app.
=== modified file 'app/components/ExpandableListItem.qml'
--- app/components/ExpandableListItem.qml	2016-02-25 22:16:54 +0000
+++ app/components/ExpandableListItem.qml	2016-03-02 18:33:57 +0000
@@ -33,46 +33,46 @@
     property Component delegate
     property alias titleText: expandableHeader.title
     property alias subText: expandableHeader.subtitle
-    property alias listViewHeight: expandableList.height
+    property alias listViewHeight: expandableListLoader.height
 
-    height: expandableHeader.height + divider.height
-    expansion.height: contentColumn.height
+    height: headerListItem.height
+    expansion.height: headerListItem.height + expandableListLoader.height
     onClicked: expansion.expanded = !expansion.expanded
 
-    Column {
-        id: contentColumn
-
-        anchors {
-            left: parent.left
-            right: parent.right
-        }
-
-        ListItem {
-            height: expandableHeader.height + divider.height
-            ListItemLayout {
-                id: expandableHeader
-
-                Icon {
-                    id: arrow
-
-                    width: units.gu(2)
-                    height: width
-                    SlotsLayout.position: SlotsLayout.Trailing
-                    SlotsLayout.overrideVerticalPositioning: true
-                    anchors.verticalCenter: parent.verticalCenter
-                    name: "go-down"
-                    rotation: expandableListItem.expansion.expanded ? 180 : 0
-
-                    Behavior on rotation {
-                        UbuntuNumberAnimation {}
-                    }
+    ListItem {
+        id: headerListItem
+        height: expandableHeader.height + divider.height
+
+        ListItemLayout {
+            id: expandableHeader
+
+            Icon {
+                id: arrow
+
+                width: units.gu(2)
+                height: width
+                SlotsLayout.position: SlotsLayout.Trailing
+                name: "go-down"
+                rotation: expandableListItem.expansion.expanded ? 180 : 0
+
+                Behavior on rotation {
+                    UbuntuNumberAnimation {}
                 }
             }
         }
-
+    }
+
+    Loader {
+        id: expandableListLoader
+        width: parent.width
+        anchors.top: headerListItem.bottom
+        sourceComponent: expandableListItem.expansion.expanded ? expandableListComponent : undefined
+    }
+
+    Component {
+        id: expandableListComponent
         ListView {
             id: expandableList
-            width: parent.width
             interactive: false
             model: expandableListItem.model
             delegate: expandableListItem.delegate

=== modified file 'debian/changelog'
--- debian/changelog	2016-03-02 12:12:19 +0000
+++ debian/changelog	2016-03-02 18:33:57 +0000
@@ -1,4 +1,11 @@
-ubuntu-clock-app (3.7) UNRELEASED; urgency=medium
+ubuntu-clock-app (3.8) UNRELEASED; urgency=medium
+
+  [ Nekhelesh Ramananthan ]
+  * Dynamic loading of ListView in ExpandableListItem
+
+ -- Nekhelesh <krnekhelesh@nik90-laptop>  Wed, 02 Mar 2016 19:30:48 +0100
+
+ubuntu-clock-app (3.7) wily; urgency=medium
 
   [ Bartosz Kosiorek ]
   * Fix alarm difference time description, during DST change (LP: #1510694)


Follow ups