Merge lp:~etherpulse/podbird/bottom_edge into lp:podbird/devel

Proposed by Eran Uzan
Status: Needs review
Proposed branch: lp:~etherpulse/podbird/bottom_edge
Merge into: lp:podbird/devel
Diff against target: 189 lines (+68/-9)
5 files modified
app/podbird.qml (+15/-5)
app/ui/BottomEdge.qml (+29/-0)
app/ui/NowPlayingPage.qml (+5/-3)
app/ui/PlayerControls.qml (+5/-1)
app/ui/SettingsPage.qml (+14/-0)
To merge this branch: bzr merge lp:~etherpulse/podbird/bottom_edge
Reviewer Review Type Date Requested Status
Podbird Developers Pending
Review via email: mp+325450@code.launchpad.net

Description of the change

Added bottom edge support (it can be turned off in the settings).

To post a comment you must log in.

Unmerged revisions

159. By Eran Uzan

Added bottom edge support toggle in setting page

158. By Eran Uzan

Removed unneeded code

157. By Eran Uzan

Added bottom edge

156. By Eran Uzan

Merged with upstream/devel

155. By Eran Uzan

Merged with lp:podbird/devel

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'app/podbird.qml'
--- app/podbird.qml 2017-01-02 23:58:38 +0000
+++ app/podbird.qml 2017-06-10 21:55:08 +0000
@@ -127,6 +127,7 @@
127 property int skipForward: 30127 property int skipForward: 30
128 property int skipBack: 10128 property int skipBack: 10
129 property bool downloadOverWifiOnly: true129 property bool downloadOverWifiOnly: true
130 property bool enableBottomEdge: true
130 }131 }
131132
132 FileManager {133 FileManager {
@@ -469,7 +470,6 @@
469470
470 Loader {471 Loader {
471 id: playerControlLoader472 id: playerControlLoader
472
473 anchors.bottom: parent.bottom473 anchors.bottom: parent.bottom
474 height: units.gu(7)474 height: units.gu(7)
475 width: parent.width475 width: parent.width
@@ -479,13 +479,13 @@
479 states: [479 states: [
480 State {480 State {
481 name: "shown"481 name: "shown"
482 when: player.playlist.itemCount !== 0 && !mainStack.currentPage.isNowPlayingPage482 when: player.playlist.itemCount !== 0
483 PropertyChanges { target: playerControlLoader; anchors.bottomMargin: 0 }483 PropertyChanges { target: playerControlLoader; anchors.bottomMargin: 0 }
484 },484 },
485485
486 State {486 State {
487 name: "hidden"487 name: "hidden"
488 when: player.playlist.itemCount === 0 || mainStack.currentPage.isNowPlayingPage || !playerControl.visible488 when: player.playlist.itemCount === 0 || !playerControl.visible
489 PropertyChanges { target: playerControlLoader; anchors.bottomMargin: -units.gu(7) }489 PropertyChanges { target: playerControlLoader; anchors.bottomMargin: -units.gu(7) }
490 }490 }
491 ]491 ]
@@ -494,7 +494,7 @@
494 Transition {494 Transition {
495 from: "hidden"; to: "shown"495 from: "hidden"; to: "shown"
496 SequentialAnimation {496 SequentialAnimation {
497 ScriptAction { script: playerControlLoader.source = Qt.resolvedUrl("ui/PlayerControls.qml") }497 ScriptAction { script: playerControlLoader.setSource( Qt.resolvedUrl("ui/PlayerControls.qml") ,{ bottomEdge : bottomEdgeLoader.item})}
498 UbuntuNumberAnimation { target: playerControlLoader; property: "anchors.bottomMargin"; duration: UbuntuAnimation.SlowDuration }498 UbuntuNumberAnimation { target: playerControlLoader; property: "anchors.bottomMargin"; duration: UbuntuAnimation.SlowDuration }
499 }499 }
500 },500 },
@@ -503,7 +503,7 @@
503 from: "shown"; to: "hidden"503 from: "shown"; to: "hidden"
504 SequentialAnimation {504 SequentialAnimation {
505 UbuntuNumberAnimation { target: playerControlLoader; property: "anchors.bottomMargin"; duration: UbuntuAnimation.SlowDuration }505 UbuntuNumberAnimation { target: playerControlLoader; property: "anchors.bottomMargin"; duration: UbuntuAnimation.SlowDuration }
506 ScriptAction { script: playerControlLoader.source = "" }506 ScriptAction { script: playerControlLoader.setSource( "" ); }
507 }507 }
508 }508 }
509 ]509 ]
@@ -525,4 +525,14 @@
525 }525 }
526 }526 }
527527
528 Loader {
529 id: bottomEdgeLoader
530 asynchronous: true
531 Component.onCompleted: setSource("ui/BottomEdge.qml", {
532 "objectName": "bottomEdge",
533 "parent": podbird,
534 "hint.objectName": "bottomEdgeHint"
535 })
536 }
537
528}538}
529539
=== added file 'app/ui/BottomEdge.qml'
--- app/ui/BottomEdge.qml 1970-01-01 00:00:00 +0000
+++ app/ui/BottomEdge.qml 2017-06-10 21:55:08 +0000
@@ -0,0 +1,29 @@
1import QtQuick 2.4
2import Ubuntu.Components 1.3
3
4
5BottomEdge {
6 id: bottomEdge
7 objectName: "bottomEdge"
8
9 hint {
10 id:bottomEdgeHint
11 enabled: bottomEdge.status != BottomEdge.Committed && podbird.settings.enableBottomEdge
12 visible : player.playlist.itemCount !== 0 && podbird.settings.enableBottomEdge
13 status: BottomEdgeHint.Inactive
14 }
15
16 onCollapseCompleted : {
17 bottomEdgeHint.status = BottomEdgeHint.Inactive
18 }
19
20
21 contentComponent: NowPlayingPage {
22 implicitWidth: bottomEdge.width
23 implicitHeight: bottomEdge.height
24 enabled: bottomEdge.status === BottomEdge.Committed
25 active: bottomEdge.status === BottomEdge.Committed
26 visible: (bottomEdge.status !== BottomEdge.Hidden)
27 onCloseBottomEdge: bottomEdge.collapse()
28 }
29}
030
=== modified file 'app/ui/NowPlayingPage.qml'
--- app/ui/NowPlayingPage.qml 2016-03-17 00:37:17 +0000
+++ app/ui/NowPlayingPage.qml 2017-06-10 21:55:08 +0000
@@ -30,6 +30,8 @@
3030
31 property bool isNowPlayingPage: true31 property bool isNowPlayingPage: true
3232
33 signal closeBottomEdge()
34
33 header: PageHeader {35 header: PageHeader {
34 title: i18n.tr("Now Playing")36 title: i18n.tr("Now Playing")
3537
@@ -38,13 +40,13 @@
38 }40 }
3941
40 leadingActionBar.actions: Action {42 leadingActionBar.actions: Action {
41 iconName: "back"43 iconName: nowPlayingPageSections.selectedIndex === 1 && currentViewLoader.item.ViewItems.dragMode ? "back" : "go-down"
42 text: i18n.tr("Back")44 text: i18n.tr("Back")
43 onTriggered: {45 onTriggered: {
44 if (nowPlayingPageSections.selectedIndex === 1 && currentViewLoader.item.ViewItems.dragMode) {46 if (nowPlayingPageSections.selectedIndex === 1 && currentViewLoader.item.ViewItems.dragMode) {
45 currentViewLoader.item.ViewItems.dragMode = !currentViewLoader.item.ViewItems.dragMode47 currentViewLoader.item.ViewItems.dragMode = !currentViewLoader.item.ViewItems.dragMode
46 } else {48 } else {
47 mainStack.pop()49 closeBottomEdge()
48 }50 }
49 }51 }
50 }52 }
@@ -55,7 +57,7 @@
55 onTriggered: {57 onTriggered: {
56 Podcasts.clearQueue()58 Podcasts.clearQueue()
57 player.playlist.clear()59 player.playlist.clear()
58 mainStack.pop()60 closeBottomEdge()
59 }61 }
60 }62 }
6163
6264
=== modified file 'app/ui/PlayerControls.qml'
--- app/ui/PlayerControls.qml 2016-12-22 21:00:02 +0000
+++ app/ui/PlayerControls.qml 2017-06-10 21:55:08 +0000
@@ -23,14 +23,18 @@
23Rectangle {23Rectangle {
24 id: controlRect24 id: controlRect
2525
26 property var bottomEdge: null
27
26 color: podbird.appTheme.bottomBarBackground28 color: podbird.appTheme.bottomBarBackground
2729
28 MouseArea {30 MouseArea {
29 z: -131 z: -1
30 anchors.fill: parent32 anchors.fill: parent
31 onClicked: {33 onClicked: {
32 mainStack.push(Qt.resolvedUrl("NowPlayingPage.qml"))34 //mainStack.push(Qt.resolvedUrl("NowPlayingPage.qml"))
35 bottomEdge.commit();
33 }36 }
37
34 }38 }
3539
36 Image {40 Image {
3741
=== modified file 'app/ui/SettingsPage.qml'
--- app/ui/SettingsPage.qml 2016-12-08 17:20:48 +0000
+++ app/ui/SettingsPage.qml 2017-06-10 21:55:08 +0000
@@ -150,6 +150,20 @@
150150
151 ListItem {151 ListItem {
152 ListItemLayout {152 ListItemLayout {
153 id: bottomEdgeSwitchLayout
154 title.text: i18n.tr("Enable bottom edge slide interaction")
155 Switch {
156 SlotsLayout.position: SlotsLayout.Last
157 checked: podbird.settings.enableBottomEdge
158 onClicked: podbird.settings.enableBottomEdge = checked
159 }
160 }
161 divider.visible: false
162 height: bottomEdgeSwitchLayout.height
163 }
164
165 ListItem {
166 ListItemLayout {
153 id: gridViewLayout167 id: gridViewLayout
154 title.text: i18n.tr("Displays podcasts in a list view")168 title.text: i18n.tr("Displays podcasts in a list view")
155 Switch {169 Switch {

Subscribers

People subscribed via source and target branches

to all changes: