ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #09733
[Merge] lp:~fboucault/ubuntu-clock-app/fix_startup_time into lp:ubuntu-clock-app
Florian Boucault has proposed merging lp:~fboucault/ubuntu-clock-app/fix_startup_time into lp:ubuntu-clock-app.
Commit message:
Improved startup time (1600ms saved on BQ E4.5):
- Load Images and Icons asynchronously
- Load bottom edge asynchronously
- Workaround PositionSource bug that was delaying startup by 1000ms
Requested reviews:
Ubuntu Clock Developers (ubuntu-clock-dev)
For more details, see:
https://code.launchpad.net/~fboucault/ubuntu-clock-app/fix_startup_time/+merge/301045
Improved startup time (1600ms saved on BQ E4.5):
- Load Images and Icons asynchronously
- Load bottom edge asynchronously
- Workaround PositionSource bug that was delaying startup by 1000ms
--
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~fboucault/ubuntu-clock-app/fix_startup_time into lp:ubuntu-clock-app.
=== modified file 'app/MainPage.qml'
--- app/MainPage.qml 2016-03-03 14:38:55 +0000
+++ app/MainPage.qml 2016-07-25 09:05:25 +0000
@@ -51,18 +51,21 @@
Timer {
id: hideBottomEdgeHintTimer
interval: 3000
- onTriggered: bottomEdge.hint.status = BottomEdgeHint.Inactive
+ onTriggered: bottomEdgeLoader.item.hint.status = BottomEdgeHint.Inactive
}
- AlarmBottomEdge {
- id: bottomEdge
- objectName: "bottomEdge"
- height: parent.height
- pageStack: mainStack
- alarmModel: _mainPage.alarmModel
- hint.visible: bottomEdge.enabled && isClockPage
- hint.objectName: "bottomEdgeHint"
- Component.onCompleted: hideBottomEdgeHintTimer.start()
+ Loader {
+ id: bottomEdgeLoader
+ asynchronous: true
+ onLoaded: hideBottomEdgeHintTimer.start()
+ Component.onCompleted: setSource("components/AlarmBottomEdge.qml", {
+ "objectName": "bottomEdge",
+ "parent": _mainPage,
+ "pageStack": mainStack,
+ "alarmModel": Qt.binding( function () { return _mainPage.alarmModel } ),
+ "hint.visible": Qt.binding( function () { return _mainPage.isClockPage } ),
+ "hint.objectName": "bottomEdgeHint"
+ })
}
AlarmUtils {
=== modified file 'app/alarm/AlarmSettingsPage.qml'
--- app/alarm/AlarmSettingsPage.qml 2016-07-13 17:30:03 +0000
+++ app/alarm/AlarmSettingsPage.qml 2016-07-25 09:05:25 +0000
@@ -134,6 +134,7 @@
height: width
name: "tick"
visible: alarmSettings.duration === duration
+ asynchronous: true
}
}
@@ -164,6 +165,7 @@
height: width
name: "tick"
visible: alarmSettings.snoozeDuration === duration
+ asynchronous: true
}
}
@@ -213,6 +215,7 @@
width: units.gu(2)
height: width
name: "go-next"
+ asynchronous: true
}
}
=== modified file 'app/alarm/AlarmSound.qml'
--- app/alarm/AlarmSound.qml 2016-07-13 16:56:39 +0000
+++ app/alarm/AlarmSound.qml 2016-07-25 09:05:25 +0000
@@ -294,6 +294,7 @@
name: "media-playback-pause"
visible: _customAlarmSoundDelegate.isChecked &&
previewAlarmSound.playbackState === Audio.PlayingState
+ asynchronous: true
}
Icon {
@@ -303,6 +304,7 @@
width: units.gu(2)
height: width
name: "tick"
+ asynchronous: true
}
}
@@ -376,6 +378,7 @@
name: "media-playback-pause"
visible: _alarmSoundDelegate.isChecked &&
previewAlarmSound.playbackState === Audio.PlayingState
+ asynchronous: true
}
Icon {
@@ -385,6 +388,7 @@
height: width
name: "tick"
anchors.verticalCenter: parent.verticalCenter
+ asynchronous: true
}
}
=== modified file 'app/clock/ClockPage.qml'
--- app/clock/ClockPage.qml 2016-07-13 16:56:39 +0000
+++ app/clock/ClockPage.qml 2016-07-25 09:05:25 +0000
@@ -61,6 +61,16 @@
otherElementsStartUpAnimation.start()
}
+ // FIXME: workaround necessary because PositionSource blocks for over 1000ms
+ // when becoming active the first time. In order not to slowdown startup we
+ // delay requesting the location until the clock app is loaded.
+ //
+ // Ref.: https://bugs.launchpad.net/platform-api/+bug/1606156
+ Connections {
+ target: otherElementsStartUpAnimation
+ onStopped: geoposition.active = true
+ }
+
PositionSource {
id: geoposition
@@ -71,7 +81,7 @@
readonly property real userLatitude: position.coordinate.latitude
- active: true
+ active: false
updateInterval: 1000
onSourceErrorChanged: {
@@ -230,6 +240,7 @@
name: "location"
height: units.gu(2.2)
color: location.color
+ asynchronous: true
}
Label {
=== modified file 'app/components/ActionIcon.qml'
--- app/components/ActionIcon.qml 2016-03-21 19:03:05 +0000
+++ app/components/ActionIcon.qml 2016-07-25 09:05:25 +0000
@@ -39,5 +39,6 @@
height: width
anchors.centerIn: parent
color: UbuntuColors.slate
+ asynchronous: true
}
}
=== modified file 'app/components/AnalogMode.qml'
--- app/components/AnalogMode.qml 2016-02-25 22:16:54 +0000
+++ app/components/AnalogMode.qml 2016-07-25 09:05:25 +0000
@@ -46,6 +46,7 @@
anchors.verticalCenterOffset: showSeconds ? units.dp(2) : units.dp(1)
source: "../graphics/Hour_Hand_Shadow.png"
+ asynchronous: true
fillMode: Image.PreserveAspectFit
// notLocalizedDateTimeString.split(":")[3] is hours
// notLocalizedDateTimeString.split(":")[4] is minutes
@@ -64,6 +65,7 @@
smooth: true
source: "../graphics/Hour_Hand.png"
+ asynchronous: true
fillMode: Image.PreserveAspectFit
// notLocalizedDateTimeString.split(":")[3] is hours
// notLocalizedDateTimeString.split(":")[4] is minutes
@@ -81,6 +83,7 @@
anchors.verticalCenterOffset: showSeconds ? units.dp(2) : units.dp(1)
source: "../graphics/Minute_Hand_Shadow.png"
+ asynchronous: true
fillMode: Image.PreserveAspectFit
// notLocalizedDateTimeString.split(":")[4] is minutes
// notLocalizedDateTimeString.split(":")[5] is seconds
@@ -98,6 +101,7 @@
smooth: true
source: "../graphics/Minute_Hand.png"
+ asynchronous: true
fillMode: Image.PreserveAspectFit
// notLocalizedDateTimeString.split(":")[4] is minutes
// notLocalizedDateTimeString.split(":")[5] is seconds
@@ -116,6 +120,7 @@
visible: showSeconds
source: "../graphics/Second_Hand_Shadow.png"
+ asynchronous: true
fillMode: Image.PreserveAspectFit
// notLocalizedDateTimeString.split(":")[5] is seconds
// We need to calculate degree number for rotation (0 degrees means no rotation).
@@ -133,6 +138,7 @@
smooth: true
visible: showSeconds
source: "../graphics/Second_Hand.png"
+ asynchronous: true
fillMode: Image.PreserveAspectFit
// notLocalizedDateTimeString.split(":")[5] is seconds
// We need to calculate degree number for rotation (0 degrees means no rotation).
@@ -150,6 +156,7 @@
fillMode: Image.PreserveAspectFit
source: "../graphics/Knob.png"
+ asynchronous: true
}
SequentialAnimation {
=== modified file 'app/components/EmptyState.qml'
--- app/components/EmptyState.qml 2016-03-21 19:03:05 +0000
+++ app/components/EmptyState.qml 2016-07-25 09:05:25 +0000
@@ -40,6 +40,7 @@
height: units.gu(10)
width: height
color: "#BBBBBB"
+ asynchronous: true
}
Label {
=== modified file 'app/components/ExpandableListItem.qml'
--- app/components/ExpandableListItem.qml 2016-03-03 10:24:42 +0000
+++ app/components/ExpandableListItem.qml 2016-07-25 09:05:25 +0000
@@ -54,6 +54,7 @@
SlotsLayout.position: SlotsLayout.Trailing
name: "go-down"
rotation: expandableListItem.expansion.expanded ? 180 : 0
+ asynchronous: true
Behavior on rotation {
UbuntuNumberAnimation {}
=== modified file 'app/worldclock/AddWorldCityButton.qml'
--- app/worldclock/AddWorldCityButton.qml 2016-03-21 19:03:05 +0000
+++ app/worldclock/AddWorldCityButton.qml 2016-07-25 09:05:25 +0000
@@ -52,6 +52,7 @@
name: "add"
height: units.gu(2)
width: height
+ asynchronous: true
}
}
Follow ups