Merge lp:~pkunal-parmar/ubuntu-calendar-app/WeekView-ScrollToToday into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Kunal Parmar
Approved revision: 571
Merged at revision: 581
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/WeekView-ScrollToToday
Merge into: lp:ubuntu-calendar-app
Prerequisite: lp:~pkunal-parmar/ubuntu-calendar-app/NewDayView-Final
Diff against target: 94 lines (+35/-1)
3 files modified
TimeLineBaseComponent.qml (+18/-0)
WeekView.qml (+15/-0)
tests/autopilot/calendar_app/__init__.py (+2/-1)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/WeekView-ScrollToToday
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Mihir Soni Approve
Review via email: mp+243664@code.launchpad.net

Commit message

Scroll to current day in case of week is current week or today is pressed

Description of the change

Scroll to current day in case of week is current week or today is pressed

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

This fails seems to be caused by new design changes,

I tried to fix it

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (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
Mihir Soni (mihirsoni) wrote :

Looks good to me !!
Thanks kunal.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cerisara (acerisara) wrote :

Kunal, could you try to merge my branch to see if the situation improves?

570. By Kunal Parmar

merge from trunk

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cerisara (acerisara) wrote :

Kunal, could you try again with my branch? It is not in trunk yet. (or, otherwise, try with x_pad set to 0.08).

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Kunal, could you try again with my branch? It is not in trunk yet. (or,
> otherwise, try with x_pad set to 0.08).

ohh, I thought code was merged to my branch, will try agian. Thanks

571. By Kunal Parmar

reducing xpad for swipe

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'TimeLineBaseComponent.qml'
2--- TimeLineBaseComponent.qml 2014-12-18 19:00:07 +0000
3+++ TimeLineBaseComponent.qml 2015-02-17 05:43:06 +0000
4@@ -52,6 +52,24 @@
5 }
6 }
7
8+ function scrollTocurrentDate() {
9+ if ( type != ViewType.ViewTypeWeek ){
10+ return;
11+ }
12+
13+ var today = DateExt.today();
14+ var startOfWeek = today.weekStart(Qt.locale().firstDayOfWeek);
15+ var weekDay = today.getDay();
16+ if( startOfWeek.isSameDay(startDay) && weekDay > 2) {
17+ timeLineView.contentX = (weekDay * timeLineView.delegateWidth);
18+ if( timeLineView.contentX > (timeLineView.contentWidth - timeLineView.width) ) {
19+ timeLineView.contentX = timeLineView.contentWidth - timeLineView.width
20+ }
21+ } else {
22+ timeLineView.contentX = 0;
23+ }
24+ }
25+
26 Connections{
27 target: keyboardEventProvider
28 onScrollUp:{
29
30=== modified file 'WeekView.qml'
31--- WeekView.qml 2014-11-04 18:32:16 +0000
32+++ WeekView.qml 2015-02-17 05:43:06 +0000
33@@ -88,6 +88,7 @@
34 }
35
36 delegate: Loader {
37+ id: timelineLoader
38 width: parent.width
39 height: parent.height
40 asynchronous: !weekViewPath.isCurrentItem
41@@ -108,18 +109,32 @@
42 Component.onCompleted: {
43 if(weekViewPage.isCurrentPage){
44 timeLineView.scrollToCurrentTime();
45+ timeLineView.scrollTocurrentDate();
46 }
47 }
48
49+ onIsActiveChanged: {
50+ timeLineView.scrollTocurrentDate();
51+ }
52+
53 onDateSelected: {
54 weekViewPage.dateSelected(date);
55 }
56
57 Connections{
58+ target: calendarTodayAction
59+ onTriggered:{
60+ if( isActive )
61+ timeLineView.scrollTocurrentDate();
62+ }
63+ }
64+
65+ Connections{
66 target: weekViewPage
67 onIsCurrentPageChanged:{
68 if(weekViewPage.isCurrentPage){
69 timeLineView.scrollToCurrentTime();
70+ timeLineView.scrollTocurrentDate();
71 }
72 }
73 }
74
75=== modified file 'tests/autopilot/calendar_app/__init__.py'
76--- tests/autopilot/calendar_app/__init__.py 2014-12-18 16:00:08 +0000
77+++ tests/autopilot/calendar_app/__init__.py 2015-02-17 05:43:06 +0000
78@@ -214,7 +214,7 @@
79 sleep(1)
80 timeout += 1
81
82- def swipe_view(self, direction, view, x_pad=0.15):
83+ def swipe_view(self, direction, view, x_pad=0.08):
84 """Swipe the given view to left or right.
85
86 Args:
87@@ -400,6 +400,7 @@
88 for event in event_bubbles:
89 # Event-bubbles objects are recycled, only show visible ones.
90 temp = "<b>"+event_name+"</b>"
91+ print(temp + "-----" + event.get_name())
92 if event.get_name() == temp:
93 if (visible and event.visible) or not visible:
94 matched_event = event

Subscribers

People subscribed via source and target branches

to status/vote changes: