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
1=== modified file 'app/podbird.qml'
2--- app/podbird.qml 2017-01-02 23:58:38 +0000
3+++ app/podbird.qml 2017-06-10 21:55:08 +0000
4@@ -127,6 +127,7 @@
5 property int skipForward: 30
6 property int skipBack: 10
7 property bool downloadOverWifiOnly: true
8+ property bool enableBottomEdge: true
9 }
10
11 FileManager {
12@@ -469,7 +470,6 @@
13
14 Loader {
15 id: playerControlLoader
16-
17 anchors.bottom: parent.bottom
18 height: units.gu(7)
19 width: parent.width
20@@ -479,13 +479,13 @@
21 states: [
22 State {
23 name: "shown"
24- when: player.playlist.itemCount !== 0 && !mainStack.currentPage.isNowPlayingPage
25+ when: player.playlist.itemCount !== 0
26 PropertyChanges { target: playerControlLoader; anchors.bottomMargin: 0 }
27 },
28
29 State {
30 name: "hidden"
31- when: player.playlist.itemCount === 0 || mainStack.currentPage.isNowPlayingPage || !playerControl.visible
32+ when: player.playlist.itemCount === 0 || !playerControl.visible
33 PropertyChanges { target: playerControlLoader; anchors.bottomMargin: -units.gu(7) }
34 }
35 ]
36@@ -494,7 +494,7 @@
37 Transition {
38 from: "hidden"; to: "shown"
39 SequentialAnimation {
40- ScriptAction { script: playerControlLoader.source = Qt.resolvedUrl("ui/PlayerControls.qml") }
41+ ScriptAction { script: playerControlLoader.setSource( Qt.resolvedUrl("ui/PlayerControls.qml") ,{ bottomEdge : bottomEdgeLoader.item})}
42 UbuntuNumberAnimation { target: playerControlLoader; property: "anchors.bottomMargin"; duration: UbuntuAnimation.SlowDuration }
43 }
44 },
45@@ -503,7 +503,7 @@
46 from: "shown"; to: "hidden"
47 SequentialAnimation {
48 UbuntuNumberAnimation { target: playerControlLoader; property: "anchors.bottomMargin"; duration: UbuntuAnimation.SlowDuration }
49- ScriptAction { script: playerControlLoader.source = "" }
50+ ScriptAction { script: playerControlLoader.setSource( "" ); }
51 }
52 }
53 ]
54@@ -525,4 +525,14 @@
55 }
56 }
57
58+ Loader {
59+ id: bottomEdgeLoader
60+ asynchronous: true
61+ Component.onCompleted: setSource("ui/BottomEdge.qml", {
62+ "objectName": "bottomEdge",
63+ "parent": podbird,
64+ "hint.objectName": "bottomEdgeHint"
65+ })
66+ }
67+
68 }
69
70=== added file 'app/ui/BottomEdge.qml'
71--- app/ui/BottomEdge.qml 1970-01-01 00:00:00 +0000
72+++ app/ui/BottomEdge.qml 2017-06-10 21:55:08 +0000
73@@ -0,0 +1,29 @@
74+import QtQuick 2.4
75+import Ubuntu.Components 1.3
76+
77+
78+BottomEdge {
79+ id: bottomEdge
80+ objectName: "bottomEdge"
81+
82+ hint {
83+ id:bottomEdgeHint
84+ enabled: bottomEdge.status != BottomEdge.Committed && podbird.settings.enableBottomEdge
85+ visible : player.playlist.itemCount !== 0 && podbird.settings.enableBottomEdge
86+ status: BottomEdgeHint.Inactive
87+ }
88+
89+ onCollapseCompleted : {
90+ bottomEdgeHint.status = BottomEdgeHint.Inactive
91+ }
92+
93+
94+ contentComponent: NowPlayingPage {
95+ implicitWidth: bottomEdge.width
96+ implicitHeight: bottomEdge.height
97+ enabled: bottomEdge.status === BottomEdge.Committed
98+ active: bottomEdge.status === BottomEdge.Committed
99+ visible: (bottomEdge.status !== BottomEdge.Hidden)
100+ onCloseBottomEdge: bottomEdge.collapse()
101+ }
102+}
103
104=== modified file 'app/ui/NowPlayingPage.qml'
105--- app/ui/NowPlayingPage.qml 2016-03-17 00:37:17 +0000
106+++ app/ui/NowPlayingPage.qml 2017-06-10 21:55:08 +0000
107@@ -30,6 +30,8 @@
108
109 property bool isNowPlayingPage: true
110
111+ signal closeBottomEdge()
112+
113 header: PageHeader {
114 title: i18n.tr("Now Playing")
115
116@@ -38,13 +40,13 @@
117 }
118
119 leadingActionBar.actions: Action {
120- iconName: "back"
121+ iconName: nowPlayingPageSections.selectedIndex === 1 && currentViewLoader.item.ViewItems.dragMode ? "back" : "go-down"
122 text: i18n.tr("Back")
123 onTriggered: {
124 if (nowPlayingPageSections.selectedIndex === 1 && currentViewLoader.item.ViewItems.dragMode) {
125 currentViewLoader.item.ViewItems.dragMode = !currentViewLoader.item.ViewItems.dragMode
126 } else {
127- mainStack.pop()
128+ closeBottomEdge()
129 }
130 }
131 }
132@@ -55,7 +57,7 @@
133 onTriggered: {
134 Podcasts.clearQueue()
135 player.playlist.clear()
136- mainStack.pop()
137+ closeBottomEdge()
138 }
139 }
140
141
142=== modified file 'app/ui/PlayerControls.qml'
143--- app/ui/PlayerControls.qml 2016-12-22 21:00:02 +0000
144+++ app/ui/PlayerControls.qml 2017-06-10 21:55:08 +0000
145@@ -23,14 +23,18 @@
146 Rectangle {
147 id: controlRect
148
149+ property var bottomEdge: null
150+
151 color: podbird.appTheme.bottomBarBackground
152
153 MouseArea {
154 z: -1
155 anchors.fill: parent
156 onClicked: {
157- mainStack.push(Qt.resolvedUrl("NowPlayingPage.qml"))
158+ //mainStack.push(Qt.resolvedUrl("NowPlayingPage.qml"))
159+ bottomEdge.commit();
160 }
161+
162 }
163
164 Image {
165
166=== modified file 'app/ui/SettingsPage.qml'
167--- app/ui/SettingsPage.qml 2016-12-08 17:20:48 +0000
168+++ app/ui/SettingsPage.qml 2017-06-10 21:55:08 +0000
169@@ -150,6 +150,20 @@
170
171 ListItem {
172 ListItemLayout {
173+ id: bottomEdgeSwitchLayout
174+ title.text: i18n.tr("Enable bottom edge slide interaction")
175+ Switch {
176+ SlotsLayout.position: SlotsLayout.Last
177+ checked: podbird.settings.enableBottomEdge
178+ onClicked: podbird.settings.enableBottomEdge = checked
179+ }
180+ }
181+ divider.visible: false
182+ height: bottomEdgeSwitchLayout.height
183+ }
184+
185+ ListItem {
186+ ListItemLayout {
187 id: gridViewLayout
188 title.text: i18n.tr("Displays podcasts in a list view")
189 Switch {

Subscribers

People subscribed via source and target branches

to all changes: