Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#16587 closed enhancement (fixed)

ScrollableView should notify me when it is and the end of the scrolling

Reported by: cjolif Owned by: Eric Durocher
Priority: low Milestone: 1.9
Component: DojoX Mobile Version: 1.8.3
Keywords: Cc: avasiliu
Blocked By: Blocking:

Description

In order to be able to for example get additional data when reaching the end of a list I need to be notified when the ScrollableView is reaching the end of a list.

Attachments (4)

ticket16587.patch (17.7 KB) - added by Sebastien Brunot 6 years ago.
Add scroll events to scrollable (beforescroll and afterscroll), and fix the ScrollableView resize method so that it works properly when called during a scroll (IBM CCLA).
pullToRefresh.patch (11.5 KB) - added by Sebastien Brunot 6 years ago.
pull to refresh example using scrolling events (IBM CCLA).
pull-arrow.png (365 bytes) - added by Sebastien Brunot 6 years ago.
image referenced in pullToRefresh.patch (IBM CCLA).
release-arrow.png (400 bytes) - added by Sebastien Brunot 6 years ago.
image referenced in pullToRefresh.patch (IBM CCLA).

Download all attachments as: .zip

Change History (12)

comment:1 Changed 7 years ago by cjolif

Cc: avasiliu added

comment:2 Changed 7 years ago by cjolif

Milestone: tbd1.9

comment:3 Changed 7 years ago by cjolif

Priority: undecidedlow

current solution is to override adjustDestination and use the method parameters to compute if we are out of the range, however an event might simplify this. As we have already a solution put it low priority.

comment:4 Changed 7 years ago by cjolif

actually adjustDestination does not fit exactly my needs because it waits for the touch interaction to end before being notified where in my case I want to start refreshing seamlessly without ending initial interaction.

Last edited 7 years ago by cjolif (previous) (diff)

comment:5 Changed 6 years ago by Sebastien Brunot

I suggest to add scroll events to scrollable (beforescroll and afterscroll) to be notified of scrolling. Each scroll event will contain the following attributes:

  • x: x coordinate of the scroll destination;
  • y: y coordinate of the scroll destination;
  • beforeTop: a boolean that is true if the scroll detination is before the top of the scrollable;
  • beforeTopHeight: the number of pixels before the top of the scrollable for the scroll destination;
  • afterBottom: a boolean that is true if the scroll destination is after the bottom of the scrollable;
  • afterBottomHeight: the number of pixels after the bottom of the scrollable for the scroll destination.

I will be possible to cancel a scroll in the beforescroll event handler, by returning the value false.

I also propose to update the resize method of ScrollableView so that if the view is resized while scrolling is perfomed, the dimensions are updated accordingly and the scroll bars are also resized accordingly (which is not currently the case).

I'm attaching a patch with an implementation proposal.

Changed 6 years ago by Sebastien Brunot

Attachment: ticket16587.patch added

Add scroll events to scrollable (beforescroll and afterscroll), and fix the ScrollableView resize method so that it works properly when called during a scroll (IBM CCLA).

comment:6 Changed 6 years ago by cjolif

Resolution: fixed
Status: newclosed

In [30919]:

fixes #16587. Add scroll events to scrollable (beforescroll and afterscroll), and fix the ScrollableView? resize method so that it works properly when called during a scroll. Thanks Sebastien Brunot (IBM CCLA). !strict.

Changed 6 years ago by Sebastien Brunot

Attachment: pullToRefresh.patch added

pull to refresh example using scrolling events (IBM CCLA).

comment:7 Changed 6 years ago by Sebastien Brunot

I'm adding an example of a "pull to refresh" implementation using the new scroll events.

Changed 6 years ago by Sebastien Brunot

Attachment: pull-arrow.png added

image referenced in pullToRefresh.patch (IBM CCLA).

Changed 6 years ago by Sebastien Brunot

Attachment: release-arrow.png added

image referenced in pullToRefresh.patch (IBM CCLA).

comment:8 Changed 6 years ago by cjolif

In [30960]:

refs #16587. prevent sending events when not needed and pull to refresh example using scrolling events. Thanks Sebastien Brunot (IBM CCLA). !strict.

Note: See TracTickets for help on using tickets.