FIELD

The described embodiments set forth techniques for updating a collection view on a computing device using a diffable data source.

BACKGROUND

Recent years have shown a proliferation in the number of individuals who own and operate computing devices (e.g., smartphones and tablets). Typically, an individual uses his or her computing device to carry out different types of activities throughout the day, e.g., placing phone calls, sending and receiving electronic messages, accessing the internet, and the like. In some instances, such a computing device may display visual representations of data collections. For example, a user may store photos on the computing device. The visual representation of the data collection stored on the computing device may periodically change. For example, the data collection may include data stored on the computing device and other data stored on a remotely located computing device, such as in a shared data stream on a cloud-computing device. As the data changes, either on the computing device or in the remotely located computing device, a current view of the data collection visually represented on the computing device may change (e.g., when the data collection syncs with the shared data stream).

One approach that attempts to update the visual representation of the data collection on the computing device, is to replace the current view of the data collection with a future view (e.g., a visual representation of the data collection that represents how the data collection may look after the changes to the data) of the data collection. However, such an approach may not be aesthetically pleasing and may result in an undesirable experience for the user of the computing device.

SUMMARY

Representative embodiments set forth herein disclose techniques for updating a collection view using a diffable data source.

An aspect of the disclosed embodiments is a method for updating a collection view. The method includes, at a computing device receiving a first data array corresponding to a current view of a data collection. The method also includes receiving a second data array corresponding to a future view of the data collection. The method also includes comparing a first data array element of the first data array to a second data array element of the second data array. The method also includes generating a difference data array that, based on a determination that the first data array element is equal to the second data array element, includes the second data array element. The method also includes determining, based on a determination that the first data array element does not equal the second data array element, whether the first data array element is included in the second data array. The method also includes, based on a determination that the first data array element is not included in the second data array, indicating, in the difference data array, that the first data array element is not in the future view of the data collection. The method also includes determining, based on a determination that the first data array element is not included in the second data array, whether the second data array element is included in the first data array. The method also includes, based on a determination that the second data array element is not included in the first data array, indicating, in the difference data array, that the second data array element is not in the current view of the data collection. The method also includes transitioning the data collection from the current view to the future view using the difference data array.

Other embodiments include a non-transitory computer readable storage medium configured to store instructions that, when executed by a processor included in a computing device, cause the computing device to carry out the various steps of any of the foregoing methods. Further embodiments include a computing device that is configured to carry out the various steps of any of the foregoing methods.

Other aspects and advantages of the embodiments described herein will become apparent from the following detailed description taken in conjunction with the accompanying drawings, which illustrate, by way of example, the principles of the described embodiments.

