Merge lp:~ahayzen/music-app/refactor-pull-now-playing-sidebar into lp:music-app

Proposed by Andrew Hayzen
Status: Rejected
Rejected by: Andrew Hayzen
Proposed branch: lp:~ahayzen/music-app/refactor-pull-now-playing-sidebar
Merge into: lp:music-app
Diff against target: 385 lines (+152/-11)
15 files modified
app/components/MusicPage.qml (+45/-4)
app/components/NowPlayingSidebar.qml (+60/-0)
app/components/NowPlayingToolbar.qml (+2/-0)
app/components/Queue.qml (+4/-2)
app/music-app.qml (+29/-3)
app/ui/AddToPlaylist.qml (+1/-0)
app/ui/Albums.qml (+1/-0)
app/ui/ArtistView.qml (+1/-0)
app/ui/Artists.qml (+1/-0)
app/ui/Genres.qml (+1/-0)
app/ui/Playlists.qml (+1/-0)
app/ui/Recent.qml (+1/-0)
app/ui/Songs.qml (+1/-0)
app/ui/SongsView.qml (+3/-2)
debian/changelog (+1/-0)
To merge this branch: bzr merge lp:~ahayzen/music-app/refactor-pull-now-playing-sidebar
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Andrew Hayzen Needs Information
Review via email: mp+253839@code.launchpad.net

Commit message

* Make NowPlaying into a conditional sidebar

Description of the change

* Make NowPlaying into a conditional sidebar

Pull of lp:~music-app-dev/music-app/refactor-now-playing-as-sidebar into lp:music-app/refactor with conflicts resolved :)

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Note this pulls in lp:~ahayzen/music-app/async-loader-pages as well.

848. By Andrew Hayzen

* Reverse cherry pick lp:~ahayzen/music-app/async-loader-pages out of this branch

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

OK reverse cherry picked async-loader-pages out, but this [0] patch still remains not sure it is needed in this specific branch, but it does fix columnflow issues.

0 - http://bazaar.launchpad.net/~music-app-dev/music-app/refactor-now-playing-as-sidebar/revision/842

849. By Andrew Hayzen

* Fix bad merge conflict

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

Currently there are issues with app rotation in vivid. These are fixed with the full implementation of shell rotation (which has not yet landed). This MP is more or less blocked from using autorotation until that lands in vivid and vivid becomes the stable channel.

850. By Andrew Hayzen

* Merge of lp:music-app/refactor

851. By Andrew Hayzen

* Fix uses of header instead of blurredHeader

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Is this still valid / wanted?

Revision history for this message
Victor Thompson (vthompson) wrote :

This pulls in the final portion of the code that was prototyped for the "converged" music app that was demoed at MWC. Currently it is blocked by the vivid rotation bug [1]. We discussed possibly disabling auto-rotation and landing this, but we assumed the auto-rotation bug would be fixed soon. If we want to have the "converged" app available, we can disable auto-rotation and land this.

1 - lp:1448017

852. By Andrew Hayzen

* Merge of lp:music-app/refactor

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

PASSED: Continuous integration, rev:852
http://91.189.93.70:8080/job/music-app-ci/1330/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/music-app-vivid-amd64-ci/182

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/music-app-ci/1330/rebuild

review: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Inline note to self :-)

review: Needs Information
853. By Andrew Hayzen

* Add changelog

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

PASSED: Continuous integration, rev:853
http://91.189.93.70:8080/job/music-app-ci/1342/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/music-app-vivid-amd64-ci/194

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/music-app-ci/1342/rebuild

review: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

I've been playing with this branch a bit on my desktop and a Nexus 7. One thing I think we should do is to optimize the side panel Now Playing page a bit more.

1. The text for the current song title should be smaller
2. The padding between components could be made a lot smaller
3. Maybe we put the progress current time and duration on the same Row as the ProgressBar?
4. Maybe the buttons could be a bit smaller?
5. Perhaps we can make the side panel smaller such that the blurred header is "square" and the cover art utilizes this space better

If we try to minimize items 2, 3, and 4 then perhaps the cover art could be made to fit the blurred header a bit more better, ie be square.

This doesn't need to be done under this MP, but I think it'd be great if this single switch to the converged view did so cleanly.

Revision history for this message
Victor Thompson (vthompson) wrote :

Or perhaps we could make the NowPlayingSidebar component 47 GU high [1]. The down side is that it's not as clear that the queue is under the Now Playing component. Maybe we need to reconsider having 2 headers? We should check with the SDK and see if that's the intended path.

1 - http://i.imgur.com/c3lFxpL.jpg

Revision history for this message
Victor Thompson (vthompson) wrote :

Thinking about it more, I think just making the NowPlayingSidebar 47 GU tall is the best course of action for now. If we want to optimize the spacing and whatnot later we can do so at that time. I don't think the view for the converged device will be as small as the Nexus 7.

854. By Andrew Hayzen

Merge of lp:~vthompson/music-app/fix-orientation

855. By Andrew Hayzen

* Merge of trunk

856. By Andrew Hayzen

* Remove unused orientation sensor

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

PASSED: Continuous integration, rev:856
http://91.189.93.70:8080/job/music-app-ci/1364/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/music-app-vivid-amd64-ci/216

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/music-app-ci/1364/rebuild

review: Approve (continuous-integration)

Unmerged revisions

856. By Andrew Hayzen

* Remove unused orientation sensor

855. By Andrew Hayzen

* Merge of trunk

854. By Andrew Hayzen

Merge of lp:~vthompson/music-app/fix-orientation

853. By Andrew Hayzen

* Add changelog

852. By Andrew Hayzen

* Merge of lp:music-app/refactor

851. By Andrew Hayzen

* Fix uses of header instead of blurredHeader

850. By Andrew Hayzen

* Merge of lp:music-app/refactor

849. By Andrew Hayzen

* Fix bad merge conflict

848. By Andrew Hayzen

* Reverse cherry pick lp:~ahayzen/music-app/async-loader-pages out of this branch

847. By Andrew Hayzen

* Make NowPlaying into a conditional sidebar

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/components/MusicPage.qml'
2--- app/components/MusicPage.qml 2015-08-19 14:03:16 +0000
3+++ app/components/MusicPage.qml 2015-08-25 20:05:00 +0000
4@@ -29,15 +29,36 @@
5 bottomMargin: musicToolbar.visible ? musicToolbar.height : 0
6 fill: parent
7 }
8+ flickable: pageFlickable
9
10+ default property alias content: pageChildrenContainer.data
11 property Dialog currentDialog
12+ property Flickable pageFlickable
13 property bool searchable: false
14 property int searchResultsCount
15 property bool showToolbar: true
16
17+ onVisibleChanged: {
18+ if (visible) {
19+ onPageVisible()
20+ }
21+ }
22+
23+ function onPageVisible() {
24+ mainPageStack.setPage(thisPage);
25+
26+ // Rebind sidebar so that it is visible on this page
27+ nowPlayingSidebarLoader.parent = parent
28+ nowPlayingSidebarLoader.anchors.bottom = parent.bottom
29+ nowPlayingSidebarLoader.anchors.right = parent.right
30+ nowPlayingSidebarLoader.anchors.top = parent.top
31+ // doesn't need to be bound due to us forcing the header to be shown in wideAspect mode
32+ nowPlayingSidebarLoader.anchors.topMargin = thisPage.header.height
33+ }
34+
35 Label {
36 anchors {
37- centerIn: parent
38+ centerIn: pageChildrenContainer
39 }
40 text: i18n.tr("No items found")
41 visible: parent.state === "search" && searchResultsCount === 0
42@@ -57,9 +78,29 @@
43 }
44 }
45
46- onVisibleChanged: {
47- if (visible) {
48- mainPageStack.setPage(thisPage);
49+ Item {
50+ id: pageChildrenContainer
51+ anchors {
52+ bottom: parent.bottom
53+ left: parent.left
54+ top: parent.top
55+ }
56+ width: parent.width - (wideAspect ? nowPlayingSidebarLoader.width : 0)
57+ }
58+
59+ // Hack to keep the header visible as we cannot use flickable: null due to issues with the topMargin
60+ Connections {
61+ target: thisPage.header
62+ onYChanged: {
63+ if (wideAspect) {
64+ thisPage.header.y = 0
65+ }
66+ }
67+ }
68+
69+ Component.onCompleted: {
70+ if (visible) { // onVisible is not sometimes called so use onComplete as well
71+ onPageVisible()
72 }
73 }
74 }
75
76=== added file 'app/components/NowPlayingSidebar.qml'
77--- app/components/NowPlayingSidebar.qml 1970-01-01 00:00:00 +0000
78+++ app/components/NowPlayingSidebar.qml 2015-08-25 20:05:00 +0000
79@@ -0,0 +1,60 @@
80+/*
81+ * Copyright (C) 2013, 2014, 2015
82+ * Andrew Hayzen <ahayzen@gmail.com>
83+ * Daniel Holm <d.holmen@gmail.com>
84+ * Victor Thompson <victor.thompson@gmail.com>
85+ *
86+ * This program is free software; you can redistribute it and/or modify
87+ * it under the terms of the GNU General Public License as published by
88+ * the Free Software Foundation; version 3.
89+ *
90+ * This program is distributed in the hope that it will be useful,
91+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
92+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93+ * GNU General Public License for more details.
94+ *
95+ * You should have received a copy of the GNU General Public License
96+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
97+ */
98+
99+import QtQuick 2.3
100+import Ubuntu.Components 1.1
101+
102+
103+Queue {
104+ clip: true
105+ isSidebar: true
106+ header: Column {
107+ id: sidebarColumn
108+ anchors {
109+ left: parent.left
110+ right: parent.right
111+ }
112+
113+ NowPlayingFullView {
114+ anchors {
115+ fill: undefined
116+ }
117+ clip: true
118+ height: units.gu(30)
119+ width: parent.width
120+ }
121+
122+ NowPlayingToolbar {
123+ anchors {
124+ fill: undefined
125+ }
126+ bottomProgressHint: false
127+ height: units.gu(10)
128+ width: parent.width
129+ }
130+ }
131+
132+ // TODO: Currently the Queue's header is shown when the user
133+ // pulls down on the ListView, this covers it up.
134+ Rectangle {
135+ anchors.fill: parent
136+ color: "#2c2c34"
137+ z: -1
138+ }
139+}
140
141=== modified file 'app/components/NowPlayingToolbar.qml'
142--- app/components/NowPlayingToolbar.qml 2015-07-29 01:23:11 +0000
143+++ app/components/NowPlayingToolbar.qml 2015-08-25 20:05:00 +0000
144@@ -30,6 +30,8 @@
145 }
146 color: styleMusic.common.black
147
148+ property alias bottomProgressHint: playerControlsProgressBar.visible
149+
150 /* Repeat button */
151 MouseArea {
152 id: nowPlayingRepeatButton
153
154=== modified file 'app/components/Queue.qml'
155--- app/components/Queue.qml 2015-06-27 21:06:26 +0000
156+++ app/components/Queue.qml 2015-08-25 20:05:00 +0000
157@@ -37,6 +37,7 @@
158 model: trackQueue.model
159 objectName: "nowPlayingqueueList"
160
161+ property bool isSidebar: false
162 property int normalHeight: units.gu(6)
163 property int transitionDuration: 250 // transition length of animations
164
165@@ -44,7 +45,8 @@
166
167 delegate: MusicListItem {
168 id: queueListItem
169- color: player.currentIndex === index ? "#2c2c34" : styleMusic.mainView.backgroundColor
170+ color: isSidebar ? (player.currentIndex === index ? "#3d3d45" : "#2c2c34")
171+ : (player.currentIndex === index ? "#2c2c34" : styleMusic.mainView.backgroundColor)
172 column: Column {
173 Label {
174 id: trackTitle
175@@ -68,7 +70,7 @@
176 leftSideAction: Remove {
177 onTriggered: trackQueue.removeQueueList([index])
178 }
179- multiselectable: true
180+ multiselectable: !isSidebar
181 reorderable: true
182 rightSideActions: [
183 AddToPlaylist{
184
185=== modified file 'app/music-app.qml'
186--- app/music-app.qml 2015-08-19 14:03:16 +0000
187+++ app/music-app.qml 2015-08-25 20:05:00 +0000
188@@ -36,7 +36,7 @@
189 objectName: "musicMainView"
190 applicationName: "com.ubuntu.music"
191 id: mainView
192-
193+ automaticOrientation: true
194 backgroundColor: styleMusic.mainView.backgroundColor
195 headerColor: styleMusic.mainView.headerColor
196
197@@ -285,9 +285,18 @@
198
199 signal listItemSwiping(int i)
200
201- property bool wideAspect: width >= units.gu(70) && loadedUI
202+ property bool landscape: width > height
203+ property bool wideAspect: loadedUI && landscape && width >= units.gu(70)
204 property bool loadedUI: false // property to detect if the UI has finished
205
206+ onWideAspectChanged: {
207+ // FIXME: if user has gone nowPlaying->Add to playlist nowPlaying won't be popped
208+ if (wideAspect && mainPageStack.currentMusicPage !== null &&
209+ mainPageStack.currentMusicPage.objectName === "nowPlayingPage") {
210+ mainPageStack.pop()
211+ }
212+ }
213+
214 // FUNCTIONS
215
216 onEmptyStateChanged: {
217@@ -716,10 +725,23 @@
218 source: "components/MusicToolbar.qml"
219 visible: (mainPageStack.currentPage.showToolbar || mainPageStack.currentPage.showToolbar === undefined) &&
220 !firstRun &&
221- !noMusic
222+ !noMusic &&
223+ !wideAspect
224 z: 200 // put on top of everything else
225 }
226
227+ Loader {
228+ id: nowPlayingSidebarLoader
229+ active: wideAspect
230+ anchors { // start offscreen
231+ right: parent.right
232+ }
233+ asynchronous: true
234+ source: "components/NowPlayingSidebar.qml"
235+ visible: active
236+ width: units.gu(40)
237+ }
238+
239 PageStack {
240 id: mainPageStack
241
242@@ -982,6 +1004,10 @@
243
244 function pushNowPlaying()
245 {
246+ if (wideAspect) { // no now playing page in wideAspect mode
247+ return;
248+ }
249+
250 // only push if on a different page
251 if (mainPageStack.currentPage.title !== i18n.tr("Now playing")
252 && mainPageStack.currentPage.title !== i18n.tr("Queue")) {
253
254=== modified file 'app/ui/AddToPlaylist.qml'
255--- app/ui/AddToPlaylist.qml 2015-08-19 14:03:16 +0000
256+++ app/ui/AddToPlaylist.qml 2015-08-25 20:05:00 +0000
257@@ -41,6 +41,7 @@
258 // Page that will be used when adding tracks to playlists
259 MusicPage {
260 id: addToPlaylistPage
261+ pageFlickable: addtoPlaylistView
262 objectName: "addToPlaylistPage"
263 // TRANSLATORS: this appears in the header with limited space (around 20 characters)
264 title: i18n.tr("Select playlist")
265
266=== modified file 'app/ui/Albums.qml'
267--- app/ui/Albums.qml 2015-05-03 16:22:31 +0000
268+++ app/ui/Albums.qml 2015-08-25 20:05:00 +0000
269@@ -29,6 +29,7 @@
270 MusicPage {
271 id: albumsPage
272 objectName: "albumsPage"
273+ pageFlickable: albumCardView
274 title: i18n.tr("Albums")
275 searchable: true
276 searchResultsCount: albumsModelFilter.count
277
278=== modified file 'app/ui/ArtistView.qml'
279--- app/ui/ArtistView.qml 2015-05-03 16:22:31 +0000
280+++ app/ui/ArtistView.qml 2015-08-25 20:05:00 +0000
281@@ -33,6 +33,7 @@
282 MusicPage {
283 id: artistViewPage
284 objectName: "artistViewPage"
285+ pageFlickable: artistAlbumView
286 visible: false
287
288 property string artist: ""
289
290=== modified file 'app/ui/Artists.qml'
291--- app/ui/Artists.qml 2015-05-03 16:22:31 +0000
292+++ app/ui/Artists.qml 2015-08-25 20:05:00 +0000
293@@ -35,6 +35,7 @@
294 MusicPage {
295 id: artistsPage
296 objectName: "artistsPage"
297+ pageFlickable: artistCardView
298 title: i18n.tr("Artists")
299 searchable: true
300 searchResultsCount: artistsModelFilter.count
301
302=== modified file 'app/ui/Genres.qml'
303--- app/ui/Genres.qml 2015-05-03 16:22:31 +0000
304+++ app/ui/Genres.qml 2015-08-25 20:05:00 +0000
305@@ -29,6 +29,7 @@
306 MusicPage {
307 id: genresPage
308 objectName: "genresPage"
309+ pageFlickable: genreCardView
310 title: i18n.tr("Genres")
311 searchable: true
312 searchResultsCount: genresModelFilter.count
313
314=== modified file 'app/ui/Playlists.qml'
315--- app/ui/Playlists.qml 2015-06-27 21:06:26 +0000
316+++ app/ui/Playlists.qml 2015-08-25 20:05:00 +0000
317@@ -33,6 +33,7 @@
318 MusicPage {
319 id: playlistsPage
320 objectName: "playlistsPage"
321+ pageFlickable: playlistslist
322 // TRANSLATORS: this is the name of the playlists page shown in the tab header.
323 // Remember to keep the translation short to fit the screen width
324 title: i18n.tr("Playlists")
325
326=== modified file 'app/ui/Recent.qml'
327--- app/ui/Recent.qml 2015-06-27 21:06:26 +0000
328+++ app/ui/Recent.qml 2015-08-25 20:05:00 +0000
329@@ -34,6 +34,7 @@
330 MusicPage {
331 id: recentPage
332 objectName: "recentPage"
333+ pageFlickable: recentCardView
334 title: i18n.tr("Recent")
335
336 property bool changed: false
337
338=== modified file 'app/ui/Songs.qml'
339--- app/ui/Songs.qml 2015-06-27 21:06:26 +0000
340+++ app/ui/Songs.qml 2015-08-25 20:05:00 +0000
341@@ -34,6 +34,7 @@
342 MusicPage {
343 id: songsPage
344 objectName: "songsPage"
345+ pageFlickable: tracklist
346 title: i18n.tr("Songs")
347 searchable: true
348 searchResultsCount: songsModelFilter.count
349
350=== modified file 'app/ui/SongsView.qml'
351--- app/ui/SongsView.qml 2015-07-26 22:43:31 +0000
352+++ app/ui/SongsView.qml 2015-08-25 20:05:00 +0000
353@@ -36,6 +36,7 @@
354 MusicPage {
355 id: songStackPage
356 objectName: "songsPage"
357+ pageFlickable: albumtrackslist
358 visible: false
359
360 property string line1: ""
361@@ -229,11 +230,11 @@
362 }
363 }
364 }
365- property int baseHeight: header.width > units.gu(60) ? units.gu(33.5) : ((header.width - units.gu(5)) / 2) + units.gu(12)
366+ property int baseHeight: blurredHeader.width > units.gu(60) ? units.gu(33.5) : ((blurredHeader.width - units.gu(5)) / 2) + units.gu(12)
367 coverSources: songStackPage.covers
368 height: songStackPage.line1 !== i18n.tr("Playlist") &&
369 songStackPage.line1 !== i18n.tr("Genre") &&
370- header.width <= units.gu(60) ?
371+ blurredHeader.width <= units.gu(60) ?
372 baseHeight + units.gu(3) : baseHeight
373 bottomColumn: Column {
374 Label {
375
376=== modified file 'debian/changelog'
377--- debian/changelog 2015-08-18 21:08:05 +0000
378+++ debian/changelog 2015-08-25 20:05:00 +0000
379@@ -9,6 +9,7 @@
380 [ Andrew Hayzen ]
381 * Fix for console errors when using the parent changed helpers
382 * Add support for a content-hub source in both single and multiple selection modes (LP: #1357324)
383+ * Make NowPlaying into a conditional sidebar
384
385 -- Victor Thompson <victor.thompson@gmail.com> Thu, 23 Jul 2015 21:08:38 -0500
386

Subscribers

People subscribed via source and target branches