Commit graph

4 commits

Author SHA1 Message Date
Tim Oliver
f66a0ae1e7 Add remaining test coverage for IGListBindingSingleSectionController
Summary: Adds additional tests to `IGListBindingSingleSectionControllerTests` to give `IGListBindingSingleSectionController` 100% code coverage

Reviewed By: candance

Differential Revision: D45147830

fbshipit-source-id: 0753888ab7f8058d72eb463f6444458bae65d964
2023-04-20 14:26:11 -07:00
Tim Oliver
f92b9339ee Standarize the copyright notice in all source files
Summary:
The standardized Meta copyright notice is "Copyright (c) Meta Platforms, Inc. and affiliates." and not "Copyright (c) Meta Platforms, Inc. and its affiliates." (Dropping the "its")

This diff updates the copyright notice in each source file to the correct this.

Reviewed By: willbailey

Differential Revision: D44737667

fbshipit-source-id: 643bf36df76723e70d9d826c53cf8f29b8a0c8cc
2023-04-06 02:44:16 -07:00
Tim Oliver
a1b9c2ddb3 Updated corporate branding in IGListKit source files
Summary:
A quick push to fix something I noticed while studying how IGListKit works. This simply replaces "Facebook, Inc" with "Meta Platforms, Inc" in all of the source files where the company copyright notice is posted. This should help bring our external facing projects more in line with our new corporate branding.

There's still a lot more references to "Facebook" as a company in the library (especially around linking to other Meta sponsored open source libraries), but this might need additional scrutiny and review on a case-by-case basis, so let's handle those ones separately.

Reviewed By: lorixx

Differential Revision: D41207363

fbshipit-source-id: 57cdbf5eb1023b41a5f32c0c05e01628686a19fe
2022-11-15 21:47:29 -08:00
Zhisheng Huang
b4dc116e20 Add a IGListBindingSingleSectionController
Summary:
= Problem =

Most of the UICollectionView/List UI only needs to deal with 1 dimensional array of data. The current N section N item setup is a big more complicated for most use case who only deals with 1 dimensional array.

In fact, the IGListDiff algorithm works pretty with 1 dimensional array. Then inside `IGListAdapterUpdater`, we do a lot changes to ensure UICollectionVie do not crash:
1. Convert section moves -> delete+insert;
2. Convert section reload -> delete+insert;

This results in the animation limitation for the UI updates, we lose the move animation support by UICollectionView and the updates for delete+insert does not look great.

= Solution =

Hence I am proposing to use simple **Single Item** Section Controller, and we can apply the diffing result directly to the UICollectionView, which is much simpler.

However, for the inline section update, we need to support update at the right timing: inside -didUpdateObject:, and now we want to get back the existing cell, and apply data to it.

Ideally, `IGListSingleSectionController` is the right call but `IGListSingleSectionController` is not subclassable and we would also need to change the way -didUpdateObject: works in that class.

Hence I am building this `IGListBindingSingleSectionController`, which only contains single item, and it can update/bind the cell whenever item is updated.

Reviewed By: iperry90

Differential Revision: D18942974

fbshipit-source-id: 539fbe2b72691b649e3ae3d8ed725006bc54b705
2019-12-16 17:50:50 -08:00