[NUI] Introduce CollectionView and related classes. (#2525)
authorSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Tue, 9 Feb 2021 04:19:19 +0000 (13:19 +0900)
committerheeyongsong <35289263+heeyongsong@users.noreply.github.com>
Tue, 9 Feb 2021 05:36:55 +0000 (14:36 +0900)
commite8633c34be7296487a54b63c46e8fc105a61cb1c
tree954a42b4f8e38d699961a1846816c265a50b167e
parentcd18dbd598f838fd67c36a72b864803a4033cb33
[NUI] Introduce CollectionView and related classes. (#2525)

* Introduce CollectionView and related classes.

View :
[ItemsView] Base class of model based view. create item by DataTemplate and
            layouting them with layouter using source data. inherited from ScrollableBase.
[CollectionView] groupable and selectable ItemsView.

Item :
[ViewItem] Base item for CollectionView.
[ViewItem.Internal] Internal partial class of ViewItem.
[ViewItemStyle] Style class of ViewItem.
[OneLineLinearItem] Linear type ViewItem of 1 line text Label and Icon, Extra View.
[OutLineGridItem] Grid type ViewItem of outline caption Label and ImageView Image and View Badge.

Layouter :
[ItemsLayouter] Base compositor class of item layouter on ItemsView.
[LinearLayouter] Layouter class of layouting item in linear list. restricted for CollectionView class only.
[GridLayouter] Layouter class of layouting item in grid list. restricted for CollectionView class only.

Item Source :
[ItemsSourceFactory] Factory of creating IItemSource from IEnumerable source.
[IItemSource] Interface for encapsulated data source from IEnumerable user source.
[IGroupedItemSource] Interface for grouped user data.
[EmptySource] Empty data source.
[ListSource] List data source.
[ObservableItemSource] Item source who provide observable notifications.
[ObservableGroupedSource] Grouped item source who provide observable notifications.
[UngroupedItemSource] Ungrouped item source.

Enum and Interface :
[ICollectionChangedNotifier] Interface of collection changed notifier.
[ItemSelectionMode] Mode enum value for Selection.
[ItemSizingStrategy] Sizing strategy for item measure.
[SelectionChangedEventArgs] Event for Selection changed notify.

Helper Class :
[MarshalingObservableCollection] Marshaling ObservableCollection for itemSource.
[SelectionList] Internal list for SelectionModel.

Other Changes :
Moving and change internal to public of DataTemplate related classes.

Known Issues :
- Empty items or pages shows when scroll fast, jump by ScrollTo().
- ScrollTo() is moving incorrectly.
- Scrolling event passing scrollPosition negative value.
- Application cannot initialize the cached ViewItem.
- Image trembling while scrolling.

Remaining Works :
- Implement groupable features.
- Implement observable changes(ICollectionChangedNotifier).
- Implement dynamic size and dynamic template selector.
- Implement Item / Layouter animations and support custom animations.
- Adding samples and test.
- Adding Unit Test.
- Documents and guides.

Design Documents :
https://code.sec.samsung.net/confluence/display/ENUIFWC/5.+Model-based++User+Interfaces

* [NUI] Update templates to EditorBrowsableState.Never

* [CollectionView] fix wrong initialize layouter and item count which makes missing 0 and last indexed item in Header/Footer exist

* [CollectionView] fix missing call of OnRelayout in base class.

* [CollectionView] Implement Groupable Features and Refactoring Items

1. Implement Groupable features in CollectionView, LinearLayouter,
    GridLayouter.
2. Refactoring items and adding styles.
   OneLineLinearItem => DefaultLinearItem : SubLabel added.
                                            Use RelativeLayout.
    Apply DefaultLinerItemStyle.
   OutLineGridItem => DefaultGridItem : Label changed Caption.
                                        Use RelativeLayout.
Support CaptionOrientation.
Apply DefaultGridItemStyle.
   DefaultTitleItem is added for Header / GroupHeader.
3. Sample is udpated.
4. Remove _ in the code.

* [CollectionView] Refactoring class directories

- Move all item source related classes in ItemSource
- Move all item class in Item
- Move all layouter class in Layouter

* [NUI] add copy-right license pre-comments

* Introduce CollectionView and related classes.

View :
[ItemsView] Base class of model based view. create item by DataTemplate and
            layouting them with layouter using source data. inherited from ScrollableBase.
[CollectionView] groupable and selectable ItemsView.

Item :
[ViewItem] Base item for CollectionView.
[ViewItem.Internal] Internal partial class of ViewItem.
[ViewItemStyle] Style class of ViewItem.
[OneLineLinearItem] Linear type ViewItem of 1 line text Label and Icon, Extra View.
[OutLineGridItem] Grid type ViewItem of outline caption Label and ImageView Image and View Badge.

Layouter :
[ItemsLayouter] Base compositor class of item layouter on ItemsView.
[LinearLayouter] Layouter class of layouting item in linear list. restricted for CollectionView class only.
[GridLayouter] Layouter class of layouting item in grid list. restricted for CollectionView class only.

Item Source :
[ItemsSourceFactory] Factory of creating IItemSource from IEnumerable source.
[IItemSource] Interface for encapsulated data source from IEnumerable user source.
[IGroupedItemSource] Interface for grouped user data.
[EmptySource] Empty data source.
[ListSource] List data source.
[ObservableItemSource] Item source who provide observable notifications.
[ObservableGroupedSource] Grouped item source who provide observable notifications.
[UngroupedItemSource] Ungrouped item source.

Enum and Interface :
[ICollectionChangedNotifier] Interface of collection changed notifier.
[ItemSelectionMode] Mode enum value for Selection.
[ItemSizingStrategy] Sizing strategy for item measure.
[SelectionChangedEventArgs] Event for Selection changed notify.

Helper Class :
[MarshalingObservableCollection] Marshaling ObservableCollection for itemSource.
[SelectionList] Internal list for SelectionModel.

Other Changes :
Moving and change internal to public of DataTemplate related classes.

Known Issues :
- Empty items or pages shows when scroll fast, jump by ScrollTo().
- ScrollTo() is moving incorrectly.
- Scrolling event passing scrollPosition negative value.
- Application cannot initialize the cached ViewItem.
- Image trembling while scrolling.

Remaining Works :
- Implement groupable features.
- Implement observable changes(ICollectionChangedNotifier).
- Implement dynamic size and dynamic template selector.
- Implement Item / Layouter animations and support custom animations.
- Adding samples and test.
- Adding Unit Test.
- Documents and guides.

Design Documents :
https://code.sec.samsung.net/confluence/display/ENUIFWC/5.+Model-based++User+Interfaces

* [NUI] Update templates to EditorBrowsableState.Never

* [CollectionView] fix wrong initialize layouter and item count which makes missing 0 and last indexed item in Header/Footer exist

* [CollectionView] fix missing call of OnRelayout in base class.

* [CollectionView] Implement Groupable Features and Refactoring Items

1. Implement Groupable features in CollectionView, LinearLayouter,
    GridLayouter.
2. Refactoring items and adding styles.
   OneLineLinearItem => DefaultLinearItem : SubLabel added.
                                            Use RelativeLayout.
    Apply DefaultLinerItemStyle.
   OutLineGridItem => DefaultGridItem : Label changed Caption.
                                        Use RelativeLayout.
Support CaptionOrientation.
Apply DefaultGridItemStyle.
   DefaultTitleItem is added for Header / GroupHeader.
3. Sample is udpated.
4. Remove _ in the code.

* [CollectionView] Refactoring class directories

- Move all item source related classes in ItemSource
- Move all item class in Item
- Move all layouter class in Layouter

* [NUI] add copy-right license pre-comments

* [NUI] Remove Old RecyclerView and Renamed ItemsView to RecyclerView

Old RecyclerView was never published or browsed, so get rid of this class and renamed ItemsView to RecyclerView.

RecyclerVIew/ -> Removed.
ItemsView -> RecyclerView
ViewItem -> RecyclerViewItem
ViewItemStyle -> RecyclerViewItemStyle

fix warnings.

* [NUI] fix build errors and comments.

FishEyeLayoutManager and WearableList no longer supported as recyclerView is removed.

* [NUI] Update Samples

* [NUI] apply cache in group header and footer

* [NUI] re-alive wearable list and move RecyclerView in wearble.

* Introduce CollectionView and related classes.

View :
[ItemsView] Base class of model based view. create item by DataTemplate and
            layouting them with layouter using source data. inherited from ScrollableBase.
[CollectionView] groupable and selectable ItemsView.

Item :
[ViewItem] Base item for CollectionView.
[ViewItem.Internal] Internal partial class of ViewItem.
[ViewItemStyle] Style class of ViewItem.
[OneLineLinearItem] Linear type ViewItem of 1 line text Label and Icon, Extra View.
[OutLineGridItem] Grid type ViewItem of outline caption Label and ImageView Image and View Badge.

Layouter :
[ItemsLayouter] Base compositor class of item layouter on ItemsView.
[LinearLayouter] Layouter class of layouting item in linear list. restricted for CollectionView class only.
[GridLayouter] Layouter class of layouting item in grid list. restricted for CollectionView class only.

Item Source :
[ItemsSourceFactory] Factory of creating IItemSource from IEnumerable source.
[IItemSource] Interface for encapsulated data source from IEnumerable user source.
[IGroupedItemSource] Interface for grouped user data.
[EmptySource] Empty data source.
[ListSource] List data source.
[ObservableItemSource] Item source who provide observable notifications.
[ObservableGroupedSource] Grouped item source who provide observable notifications.
[UngroupedItemSource] Ungrouped item source.

Enum and Interface :
[ICollectionChangedNotifier] Interface of collection changed notifier.
[ItemSelectionMode] Mode enum value for Selection.
[ItemSizingStrategy] Sizing strategy for item measure.
[SelectionChangedEventArgs] Event for Selection changed notify.

Helper Class :
[MarshalingObservableCollection] Marshaling ObservableCollection for itemSource.
[SelectionList] Internal list for SelectionModel.

Other Changes :
Moving and change internal to public of DataTemplate related classes.

Known Issues :
- Empty items or pages shows when scroll fast, jump by ScrollTo().
- ScrollTo() is moving incorrectly.
- Scrolling event passing scrollPosition negative value.
- Application cannot initialize the cached ViewItem.
- Image trembling while scrolling.

Remaining Works :
- Implement groupable features.
- Implement observable changes(ICollectionChangedNotifier).
- Implement dynamic size and dynamic template selector.
- Implement Item / Layouter animations and support custom animations.
- Adding samples and test.
- Adding Unit Test.
- Documents and guides.

Design Documents :
https://code.sec.samsung.net/confluence/display/ENUIFWC/5.+Model-based++User+Interfaces

* [NUI] Update templates to EditorBrowsableState.Never

* [CollectionView] fix wrong initialize layouter and item count which makes missing 0 and last indexed item in Header/Footer exist

* [CollectionView] fix missing call of OnRelayout in base class.

* [CollectionView] Implement Groupable Features and Refactoring Items

1. Implement Groupable features in CollectionView, LinearLayouter,
    GridLayouter.
2. Refactoring items and adding styles.
   OneLineLinearItem => DefaultLinearItem : SubLabel added.
                                            Use RelativeLayout.
    Apply DefaultLinerItemStyle.
   OutLineGridItem => DefaultGridItem : Label changed Caption.
                                        Use RelativeLayout.
Support CaptionOrientation.
Apply DefaultGridItemStyle.
   DefaultTitleItem is added for Header / GroupHeader.
3. Sample is udpated.
4. Remove _ in the code.

* [CollectionView] Refactoring class directories

- Move all item source related classes in ItemSource
- Move all item class in Item
- Move all layouter class in Layouter

* [NUI] add copy-right license pre-comments

* Introduce CollectionView and related classes.

View :
[ItemsView] Base class of model based view. create item by DataTemplate and
            layouting them with layouter using source data. inherited from ScrollableBase.
[CollectionView] groupable and selectable ItemsView.

Item :
[ViewItem] Base item for CollectionView.
[ViewItem.Internal] Internal partial class of ViewItem.
[ViewItemStyle] Style class of ViewItem.
[OneLineLinearItem] Linear type ViewItem of 1 line text Label and Icon, Extra View.
[OutLineGridItem] Grid type ViewItem of outline caption Label and ImageView Image and View Badge.

Layouter :
[ItemsLayouter] Base compositor class of item layouter on ItemsView.
[LinearLayouter] Layouter class of layouting item in linear list. restricted for CollectionView class only.
[GridLayouter] Layouter class of layouting item in grid list. restricted for CollectionView class only.

Item Source :
[ItemsSourceFactory] Factory of creating IItemSource from IEnumerable source.
[IItemSource] Interface for encapsulated data source from IEnumerable user source.
[IGroupedItemSource] Interface for grouped user data.
[EmptySource] Empty data source.
[ListSource] List data source.
[ObservableItemSource] Item source who provide observable notifications.
[ObservableGroupedSource] Grouped item source who provide observable notifications.
[UngroupedItemSource] Ungrouped item source.

Enum and Interface :
[ICollectionChangedNotifier] Interface of collection changed notifier.
[ItemSelectionMode] Mode enum value for Selection.
[ItemSizingStrategy] Sizing strategy for item measure.
[SelectionChangedEventArgs] Event for Selection changed notify.

Helper Class :
[MarshalingObservableCollection] Marshaling ObservableCollection for itemSource.
[SelectionList] Internal list for SelectionModel.

Other Changes :
Moving and change internal to public of DataTemplate related classes.

Known Issues :
- Empty items or pages shows when scroll fast, jump by ScrollTo().
- ScrollTo() is moving incorrectly.
- Scrolling event passing scrollPosition negative value.
- Application cannot initialize the cached ViewItem.
- Image trembling while scrolling.

Remaining Works :
- Implement groupable features.
- Implement observable changes(ICollectionChangedNotifier).
- Implement dynamic size and dynamic template selector.
- Implement Item / Layouter animations and support custom animations.
- Adding samples and test.
- Adding Unit Test.
- Documents and guides.

Design Documents :
https://code.sec.samsung.net/confluence/display/ENUIFWC/5.+Model-based++User+Interfaces

* [NUI] Update templates to EditorBrowsableState.Never

* [CollectionView] fix wrong initialize layouter and item count which makes missing 0 and last indexed item in Header/Footer exist

* [CollectionView] fix missing call of OnRelayout in base class.

* [CollectionView] Implement Groupable Features and Refactoring Items

1. Implement Groupable features in CollectionView, LinearLayouter,
    GridLayouter.
2. Refactoring items and adding styles.
   OneLineLinearItem => DefaultLinearItem : SubLabel added.
                                            Use RelativeLayout.
    Apply DefaultLinerItemStyle.
   OutLineGridItem => DefaultGridItem : Label changed Caption.
                                        Use RelativeLayout.
Support CaptionOrientation.
Apply DefaultGridItemStyle.
   DefaultTitleItem is added for Header / GroupHeader.
3. Sample is udpated.
4. Remove _ in the code.

* [CollectionView] Refactoring class directories

- Move all item source related classes in ItemSource
- Move all item class in Item
- Move all layouter class in Layouter

* [NUI] add copy-right license pre-comments

* [NUI] Remove Old RecyclerView and Renamed ItemsView to RecyclerView

Old RecyclerView was never published or browsed, so get rid of this class and renamed ItemsView to RecyclerView.

RecyclerVIew/ -> Removed.
ItemsView -> RecyclerView
ViewItem -> RecyclerViewItem
ViewItemStyle -> RecyclerViewItemStyle

fix warnings.

* [NUI] fix build errors and comments.

FishEyeLayoutManager and WearableList no longer supported as recyclerView is removed.

* [NUI] Update Samples

* [NUI] apply cache in group header and footer

* [NUI] re-alive wearable list and move RecyclerView in wearble.

Co-authored-by: dongsug-song <35130733+dongsug-song@users.noreply.github.com>
46 files changed:
src/Tizen.NUI.Components/Controls/RecyclerView/CollectionView.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ICollectionChangedNotifier.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultGridItem.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultLinearItem.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/Item/DefaultTitleItem.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.Internal.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/Item/RecyclerViewItem.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSelectionMode.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSizingStrategy.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/EmptySource.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/IItemSource.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ItemsSourceFactory.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ListSource.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/MarshalingObservableCollection.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableGroupedSource.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableItemSource.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/UngroupedItemSource.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/GridLayouter.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/ItemsLayouter.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/Layouter/LinearLayouter.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/RecyclerView.cs
src/Tizen.NUI.Components/Controls/RecyclerView/SelectionChangedEventArgs.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Controls/RecyclerView/SelectionList.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Style/DefaultGridItemStyle.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Style/DefaultLinearItemStyle.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Style/DefaultTitleItemStyle.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Style/RecyclerViewItemStyle.cs [new file with mode: 0644]
src/Tizen.NUI.Components/Theme/DefaultTheme.cs
src/Tizen.NUI.Components/Theme/DefaultThemeMobile.cs
src/Tizen.NUI.Wearable/src/public/RecyclerView/GridRecycleLayoutManager.cs [moved from src/Tizen.NUI.Components/Controls/RecyclerView/GridRecycleLayoutManager.cs with 99% similarity]
src/Tizen.NUI.Wearable/src/public/RecyclerView/LinearRecycleLayoutManager.cs [moved from src/Tizen.NUI.Components/Controls/RecyclerView/LinearRecycleLayoutManager.cs with 99% similarity]
src/Tizen.NUI.Wearable/src/public/RecyclerView/RecycleAdapter.cs [moved from src/Tizen.NUI.Components/Controls/RecyclerView/RecycleAdapter.cs with 98% similarity]
src/Tizen.NUI.Wearable/src/public/RecyclerView/RecycleItem.cs [moved from src/Tizen.NUI.Components/Controls/RecyclerView/RecycleItem.cs with 96% similarity]
src/Tizen.NUI.Wearable/src/public/RecyclerView/RecycleLayoutManager.cs [moved from src/Tizen.NUI.Components/Controls/RecyclerView/RecycleLayoutManager.cs with 99% similarity]
src/Tizen.NUI.Wearable/src/public/RecyclerView/RecyclerView.cs [new file with mode: 0755]
src/Tizen.NUI/src/internal/XamlBinding/Internals/IDataTemplate.cs [deleted file]
src/Tizen.NUI/src/public/Template/DataTemplate.cs [moved from src/Tizen.NUI/src/internal/XamlBinding/DataTemplate.cs with 71% similarity]
src/Tizen.NUI/src/public/Template/DataTemplateExtensions.cs [moved from src/Tizen.NUI/src/internal/XamlBinding/DataTemplateExtensions.cs with 80% similarity]
src/Tizen.NUI/src/public/Template/DataTemplateSelector.cs [moved from src/Tizen.NUI/src/internal/XamlBinding/DataTemplateSelector.cs with 78% similarity]
src/Tizen.NUI/src/public/Template/ElementTemplate.cs [moved from src/Tizen.NUI/src/internal/XamlBinding/ElementTemplate.cs with 96% similarity]
src/Tizen.NUI/src/public/Template/IDataTemplate.cs [new file with mode: 0755]
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CollectionViewDemo/CollectionViewGridSample.cs [new file with mode: 0755]
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CollectionViewDemo/CollectionViewLinearSample.cs [new file with mode: 0755]
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CollectionViewDemo/Gallery.cs [new file with mode: 0644]
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CollectionViewDemo/Group/CollectionViewGridGroupSample.cs [new file with mode: 0644]
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CollectionViewDemo/Group/CollectionViewLinearGroupSample.cs [new file with mode: 0644]