Merge lp:~nik90/podbird/dev-change-click-behavior into lp:podbird/devel

Proposed by Nekhelesh Ramananthan
Status: Merged
Merged at revision: 111
Proposed branch: lp:~nik90/podbird/dev-change-click-behavior
Merge into: lp:podbird/devel
Diff against target: 193 lines (+82/-49)
2 files modified
app/ui/EpisodesPage.qml (+41/-24)
app/ui/EpisodesTab.qml (+41/-25)
To merge this branch: bzr merge lp:~nik90/podbird/dev-change-click-behavior
Reviewer Review Type Date Requested Status
Podbird Developers Pending
Review via email: mp+262519@code.launchpad.net

Commit message

Changed default click behaviour to play an episode rather than show the description as per the recommendation of Kevin Feyder.

Description of the change

Changed default click behaviour to play an episode rather than show the description as per the recommendation of Kevin Feyder.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ui/EpisodesPage.qml'
2--- app/ui/EpisodesPage.qml 2015-05-02 08:51:10 +0000
3+++ app/ui/EpisodesPage.qml 2015-06-20 13:51:00 +0000
4@@ -255,6 +255,29 @@
5 : RegExp("", "gi")
6 }
7
8+ /*
9+ Note (nik90): After the upgrade to Ubuntu.Components 1.2, it seems the new listitems don't have their trailing
10+ action width clamped. As a result when the list item expands and the user swipes left, it leads to a rather huge
11+ trailing edge action. This has been reported upstream at http://pad.lv/1465582. Until this is fixed, the
12+ episode description is shown in a dialog.
13+ */
14+ Component {
15+ id: episodeDescriptionDialog
16+ Dialog {
17+ id: dialogInternal
18+ property string description
19+ title: "<b>%1</b>".arg(i18n.tr("Episode Description"))
20+ text: description
21+ Button {
22+ text: i18n.tr("Close")
23+ color: podbird.appTheme.positiveActionButton
24+ onClicked: {
25+ PopupUtils.close(dialogInternal)
26+ }
27+ }
28+ }
29+ }
30+
31 UbuntuListView {
32 id: episodeList
33
34@@ -363,8 +386,6 @@
35 isInDeterminateDownload: downloader.progress < 0 || downloader.progress > 100 && downloader.downloadingGuid === model.guid
36 progress: downloader.progress
37
38- description: model.description
39-
40 trailingActions: ListItemActions {
41 actions: [
42 Action {
43@@ -403,35 +424,31 @@
44 },
45
46 Action {
47- iconName: currentUrl != "" && playerLoader.item.playbackState === MediaPlayer.PlayingState && currentGuid === model.guid ? "media-playback-pause" : "media-playback-start"
48+ iconName: "info"
49 onTriggered: {
50- var db = Podcasts.init();
51- db.transaction(function (tx) {
52- if (currentGuid === model.guid && currentUrl != "") {
53- if (playerLoader.item.playbackState === MediaPlayer.PlayingState) {
54- playerLoader.item.pause()
55- } else {
56- playerLoader.item.play()
57- }
58- } else {
59- currentGuid = "";
60- currentUrl = model.downloadedfile ? model.downloadedfile : model.audiourl;
61- var rs = tx.executeSql("SELECT position FROM Episode WHERE guid=?", [model.guid]);
62- playerLoader.item.play();
63- playerLoader.item.seek(rs.rows.item(0).position);
64- currentName = model.name;
65- currentArtist = model.artist;
66- currentImage = model.image;
67- currentGuid = model.guid;
68- }
69- });
70+ var popup = PopupUtils.open(episodeDescriptionDialog, episodesPage);
71+ popup.description = model.description
72 }
73 }
74 ]
75 }
76
77 onClicked: {
78- expanded = !expanded;
79+ Haptics.play()
80+ var db = Podcasts.init();
81+ db.transaction(function (tx) {
82+ if (currentGuid !== model.guid) {
83+ currentGuid = "";
84+ currentUrl = model.downloadedfile ? model.downloadedfile : model.audiourl;
85+ var rs = tx.executeSql("SELECT position FROM Episode WHERE guid=?", [model.guid]);
86+ playerLoader.item.play();
87+ playerLoader.item.seek(rs.rows.item(0).position);
88+ currentName = model.name;
89+ currentArtist = model.artist;
90+ currentImage = model.image;
91+ currentGuid = model.guid;
92+ }
93+ });
94 }
95 }
96
97
98=== modified file 'app/ui/EpisodesTab.qml'
99--- app/ui/EpisodesTab.qml 2015-05-13 11:39:05 +0000
100+++ app/ui/EpisodesTab.qml 2015-06-20 13:51:00 +0000
101@@ -213,6 +213,29 @@
102 }
103 }
104
105+ /*
106+ Note (nik90): After the upgrade to Ubuntu.Components 1.2, it seems the new listitems don't have their trailing
107+ action width clamped. As a result when the list item expands and the user swipes left, it leads to a rather huge
108+ trailing edge action. This has been reported upstream at http://pad.lv/1465582. Until this is fixed, the
109+ episode description is shown in a dialog.
110+ */
111+ Component {
112+ id: episodeDescriptionDialog
113+ Dialog {
114+ id: dialogInternal
115+ property string description
116+ title: "<b>%1</b>".arg(i18n.tr("Episode Description"))
117+ text: description
118+ Button {
119+ text: i18n.tr("Close")
120+ color: podbird.appTheme.positiveActionButton
121+ onClicked: {
122+ PopupUtils.close(dialogInternal)
123+ }
124+ }
125+ }
126+ }
127+
128 UbuntuListView {
129 id: episodeList
130
131@@ -279,8 +302,6 @@
132 subtitle: model.duration === 0 || model.duration === undefined ? model.artist
133 : Podcasts.formatEpisodeTime(model.duration) + " | " + model.artist
134
135- description: model.description
136-
137 isDownloaded: model.downloadedfile ? true : false
138
139 showProgressBar: downloader.downloadingGuid === model.guid
140@@ -333,36 +354,31 @@
141 },
142
143 Action {
144- iconName: currentUrl != "" && playerLoader.item.playbackState === MediaPlayer.PlayingState && currentGuid === model.guid ? "media-playback-pause"
145- : "media-playback-start"
146+ iconName: "info"
147 onTriggered: {
148- var db = Podcasts.init();
149- db.transaction(function (tx) {
150- if (currentGuid === model.guid && currentUrl != "") {
151- if (playerLoader.item.playbackState === MediaPlayer.PlayingState) {
152- playerLoader.item.pause()
153- } else {
154- playerLoader.item.play()
155- }
156- } else {
157- currentGuid = "";
158- currentUrl = model.downloadedfile ? model.downloadedfile : model.audiourl;
159- var rs = tx.executeSql("SELECT position FROM Episode WHERE guid=?", [model.guid]);
160- playerLoader.item.play();
161- playerLoader.item.seek(rs.rows.item(0).position);
162- currentName = model.name;
163- currentArtist = model.artist;
164- currentImage = model.image;
165- currentGuid = model.guid;
166- }
167- });
168+ var popup = PopupUtils.open(episodeDescriptionDialog, whatsNewTab);
169+ popup.description = model.description
170 }
171 }
172 ]
173 }
174
175 onClicked: {
176- expanded = !expanded
177+ Haptics.play()
178+ var db = Podcasts.init();
179+ db.transaction(function (tx) {
180+ if (currentGuid !== model.guid) {
181+ currentGuid = "";
182+ currentUrl = model.downloadedfile ? model.downloadedfile : model.audiourl;
183+ var rs = tx.executeSql("SELECT position FROM Episode WHERE guid=?", [model.guid]);
184+ playerLoader.item.play();
185+ playerLoader.item.seek(rs.rows.item(0).position);
186+ currentName = model.name;
187+ currentArtist = model.artist;
188+ currentImage = model.image;
189+ currentGuid = model.guid;
190+ }
191+ });
192 }
193 }
194

Subscribers

People subscribed via source and target branches