Anchored approach to scrolling
At an electronic device having access to a plurality of data objects: displaying a viewport comprising graphical representations of a first subset of the plurality of data objects that are ordered. While displaying the graphical representations of the first subset, the device receives a request to navigate through graphical representations of the plurality of data objects in the viewport. The request is associated with an input magnitude. In response to the request: generate a layout for a second subset of the plurality of data objects based on the input magnitude and an anchor within the plurality of data objects that was selected based on user input; and changing the content of the viewport by displaying graphical representations of the data objects of the second subset according to the layout.
1. A non-transitory computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by an electronic device with a display, cause the device to:
display a viewport having content comprising graphical representations of a first subset of a plurality of data objects, wherein the data objects of the first subset are ordered, and wherein the first subset of data objects is associated with a first anchor;
while displaying the graphical representations of the first subset of the plurality of data objects in the viewport, receive a request to navigate through graphical representations of the plurality of data objects in the viewport, wherein the request is associated with an input magnitude; and
in response to receiving the request:
in accordance with a determination that the input magnitude corresponds to less than a threshold amount of movement of the graphical representations, generate layout of graphical representations of a second subset of the plurality of data objects based on the first anchor and the input magnitude, and change the content of the viewport by displaying graphical representations of the data objects of the second subset according to the layout;
in accordance with a determination that the input magnitude corresponds to more than the threshold amount of movement of the graphical representations, select a second anchor based on the input magnitude, generate layout of graphical representations of a third subset of data objects based on the second anchor, and change the content of the viewport by displaying graphical representations of the data objects of the third subset according to the layout.
2. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions to cause the device to select the second anchor comprise instructions to cause the device to:
determine an approximate amount of movement through the plurality of data objects that corresponds to the input magnitude and select the second anchor based on the approximate amount of movement.
3. The non-transitory computer-readable storage medium of claim 1 , wherein the first subset of data objects overlaps at least partly with the second subset of data objects.
4. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions to cause the device to generate the layout of graphical representations of the second subset of data objects comprises instructions to cause the device to:
identify at least one data object of the plurality of data objects positioned before the first or second anchor within the order of the plurality of data objects, and include the identified at least one data objects in the second subset.
5. The non-transitory computer-readable storage medium of claim 4 , wherein the instructions to cause the device to generate layout of graphical representations of the second subset of data objects comprises instructions to cause the device to:
identify at least one data object of the plurality of data objects positioned after the first or second anchor within the order of the plurality of data objects, and include the identified at least one data objects in the second subset.
6. The non-transitory computer-readable storage medium of claim 4 , wherein the instructions to cause the device to identify at least one data object of the plurality of data objects positioned before the first anchor or the second anchor within the order of the plurality of data objects comprises instructions to cause the device to:
determine a position, in the viewport, corresponding to the first or second anchor;
determine an amount of available display area, in the viewport, between the first anchor and a boundary of the viewport;
determine a number of graphical representations of data objects that can be displayed within the amount of available display area; and
select a number of data objects positioned before the position corresponding to the first anchor as the identified at least one data objects, the number of data objects selected equaling the number of graphical representations determined as can be displayed within the amount of available display area.
7. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions to cause the device to select the same number of data objects comprises instructions to cause the device to:
select consecutive data objects positioned before the position corresponding to the first or second anchor.
8. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions to cause the device to generate a layout for a second subset of the plurality of data objects comprises instructions to cause the device to:
obtain a characteristic size of graphical representations of the plurality of data objects;
convert the input magnitude into a corresponding change in position within the order of the plurality of data objects based on the characteristic size of graphical representations of the plurality of data objects; and
determine the second anchor using the position within the order of the plurality of data objects corresponding to the first anchor, and the corresponding change in position.
9. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions to cause the device to generate a layout for a second subset of the plurality of data objects comprises instructions to cause the device to:
determine an amount of viewport navigation corresponding to the input magnitude;
identify at least one data object abutting the first anchor within the ordered plurality of data objects;
determine an actual size of one or more graphical representations of the at least one data objects abutting the first anchor; and
select one or more of the at least one data objects as the second subset based on the actual size of the one or more graphical representations of the at least one data objects and the corresponding amount of viewport navigation.
10. The non-transitory computer-readable storage medium of claim 1 , wherein the threshold amount of movement is based on the size of the viewport.
11. The non-transitory computer-readable storage medium of claim 1 , wherein the first anchor within the plurality of data objects was selected based on user input and corresponds to a data object of the plurality of data objects.
12. The non-transitory computer-readable storage medium of claim 1 , wherein the first anchor within the plurality of data objects was selected based on user input and corresponds to a position before or after a data object of the plurality of data objects.
13. The non-transitory computer-readable storage medium of claim 1 , wherein the first anchor within the plurality of data objects was selected based on user input and corresponds to a position in the content of the viewport.
14. The non-transitory computer-readable storage medium of claim 1 , wherein the request to navigate through graphical representations of the plurality of data objects in the viewport comprises a request to scroll the content of the viewport.
15. The non-transitory computer-readable storage medium of claim 1 , wherein the request to navigate through graphical representations of the plurality of data objects in the viewport comprises a request to resize the viewport.
16. The non-transitory computer-readable storage medium of claim 1 , wherein the instructions to cause the device to change the content of the viewport comprise instructions to cause the device to change the content of the viewport after generating the layout for the second subset.
17. The non-transitory computer-readable storage medium of claim 1 , wherein the plurality of data objects comprises files, and the viewport is a graphical user interface window.
18. The non-transitory computer-readable storage medium of claim 1 , wherein the plurality of data objects comprises messages, and the viewport is a region displayed by a messaging application.
19. A method comprising:
at an electronic device configured to access a plurality of data objects:
displaying a viewport having content comprising graphical representations of a first subset of the plurality of data objects that are ordered, and wherein the first subset of data objects is associated with a first anchor;
while displaying the graphical representations of the first subset of the plurality of data objects in the viewport, receiving a request to navigate through graphical representations of the plurality of data objects in the viewport, wherein the request is associated with an input magnitude; and
in response to receiving the request:
in accordance with a determination that the input magnitude corresponds to less than a threshold amount of movement of the graphical representations, generating layout of graphical representations of a second subset of the plurality of data objects based on the first anchor and the input magnitude, and changing the content of the viewport by displaying graphical representations of the data objects of the second subset according to the layout;
in accordance with a determination that the input magnitude corresponds to more than the threshold amount of movement of the graphical representations, selecting a second anchor based on the input magnitude, generating layout of graphical representations of a third subset of data objects based on the second anchor, and changing the content of the viewport by displaying graphical representations of the data objects of the third subset according to the layout.
20. An electronic device, comprising:
a display;
a memory; and
a processor coupled to the display and the memory, the processor configured to:
display a viewport having content comprising graphical representations of a first subset of a plurality of data objects, wherein the data objects of the first subset are ordered, and wherein the first subset of data objects is associated with a first anchor;
while displaying the graphical representations of the first subset of the plurality of data objects in the viewport, receive a request to navigate through graphical representations of the plurality of data objects in the viewport, wherein the request is associated with an input magnitude; and
responsive to receiving the request:
in accordance with a determination that the input magnitude corresponds to less than a threshold amount of movement of the graphical representations, generate layout of graphical representations of a second subset of the plurality of data objects based on the first anchor and the input magnitude, and change the content of the viewport by displaying graphical representations of the data objects of the second subset according to the layout;
in accordance with a determination that the input magnitude corresponds to more than the threshold amount of movement of the graphical representations, select a second anchor based on the input magnitude, generate layout of graphical representations of the third subset of data objects based on the second anchor, and change the content of the viewport by displaying graphical representations of the data objects of the third subset according to the layout.