UPDATE 10.10.2023 - 7.0.0 More of a rebranding than an update. There were no significant changes on the backlog at the moment of this update, so enjoy the new paint job! Breaking changes: - Namespaces changed from Com.TheFallenGames to Com.ForbiddenByte - All Resources folders cahnged from xx/Resources/Com.TheFallenGames/OSA to xx/Resources/Com.ForbiddenByte.OSA Refer to the Migration guide for this version for a step-by-step transition. - Removed useless, old-fashioned classes: IInitializable8, Singleton8. In case you've used them, you really shouldn't have, but they were just 2-3 lines of code, so you'll be fine. Changes: - ScrollbarFixer8: set the default minCompressedSize to 0.01 to have compression by default (which also affects wizard-generated scrollbars) UPDATE 16.09.2023 - 6.5.4 Features: - Added LRUCachingPool which is better than FIFOCachingPool in most cases. Demos using FIFOCachingPool weren't updated. - AbstractViewsHolder: added OnBeforeRecycleOrDisable(int newItemIndex) and calling it accordingly from OSA, to contain any VH internal lifecycle events instead of relying on overriding OSA.OnBeforeRecycleOrDisableViewsHolder() each time. GridAdapter also adjusted to follow the same flow for its CellViewsHolders - Added GuessShouldKeepEndStationaryOnResize(..) which is a big help in cases where you're dealing with size changes, especially async ones. It guesses the value of the keepEndEdgeStationary parameter of OSA's resizing methods. - Added ForceRebuildViewsHolderAndUpdateSizeWithAutoEndEdge(..) that uses the above to rebuild items (such as in auto-sized items), where the value of keepEndEdgeStationary is now guesstimated, giving a much smoother UX and minimizing jumps in surrounding content. Fixes: - Fixed small, impactless inconsistency in RemoteImageBehaviour Other: - Added keepVelocity to ForceRebuildViewsHolderAndUpdateSize - Verified for Unity 2023 Micro breaking changes: - The keepVelocity of ForceRebuildViewsHolderAndUpdateSize is true by default, while previously it was false. This shouldn't be an issue in most cases. UPDATE 28.05.2023 - 6.4.0: Minor breaking changes: - Minumum Unity version increased from 2018.4.36f1 to 2019.4.40f1 (this is considered minor b/c, as of June 12 2023, Unity 2018.x usage is at 0.37%) Fixes: - ScrollbarFixer8: If viewport is assigned, search starts from there, so that the user can add the scrollbar wherever they want - Fixed Arial.ttf not available in UNITY_2022_2_OR_NEWER - Fixed ForceUpdateVisibleItems that looped from 0 to VisibleItemsCount-1 instead of VisibleItemsCount - ScrollbarFixer8: fixed bug when having interractable children in the Scrollbar, added ignoreDragWithoutPointerDown for this (default false) Features: - Improved Looping UX: OSA can finally SmoothScrollTo via the shortest path when looping is enabled! - Added IScrollHandler to InputFieldInScrollRectFixerBase as only drags were being handled, ignoring mouse wheel scrolling - DateTimePickerDialog: allow specifying prefab path in resources - Added worldPositionStays param to AbstractViewsHolder.Init(..) - Fixed OnDrag event being intercepted in some cases even if OnBeginDrag ignored it - Added ForceUpdateCellViewsHolderIfVisible to GridAdapter Other: - Made OSA Wizard window main button more explicit: step 1/2 and step 2/2 are now shown on the button to clearly express that there are 2 initialization steps - Some comments/doc cleanup/improvements - Fixed BaseOSAWindow OSA logo & version text padding - PageView demo: toggled the `IgnoreDragWithoutPointerDown` property on the `ScrollbarFixer8` in the scene page_view_worldspace, as that's necessary for the `DiscreteScrollbar` to work (clicking on the scrollbar slots to jump to any page) - Updated playmaker readme to specify all asmdefs - Updated WebGL and APK demos UPDATE 07.08.2022 - 6.1.0: Minor breaking changes: - Minumum Unity version increased from 2018.4.34f1 to 2018.4.36f1 Features: - Added OSA.ForceUpdateVisibleItems(). Similar to ForceUpdateViewsHolderIfVisible(), but it only updates the visible items, one by one - ScrollbarFixer8: Move scrollbar on pointer down. Scrollbar now moves when you click on an empty area in the scrollbar instantly rather than after you start dragging. This is better UX, but might be a small breaking change for some Fixes: - Fixed error when you change item count during OSA being disabled. This should still be unsupported, but at least we're treating it correctly. Throwing an exception when count is changed would be a big breaking change at this stage - Fixed ScrollbarFixer8 not compressing correctly in some cases. It was disregarding minSize/maxSize - Fixed UnityEditor.Experimental.SceneManagement not being available starting with 2021.2, giving an error Changes: - ScrollbarFixer8: autoHideCollapseEffect is now false by default, as most users don't use it - ScrollbarFixer8: sizeUpdateInterval is now 0.01f by default for a smoother experience, and also the min allowed value was decreased to 0.005 for even more smoothness, if desired UPDATE 15.12.2021 - 6.0.1: Breaking changes: - Minimum Unity version increased from 2017.4.3f1 to 2018.4.34f1 - Reorganized project's structure to separate Core, Demos and Utilities in their own subdirectories. Please delete the previous OSA package before importing this one. - OSA.asmdef split into OSA.Core.asmdef, OSA.Utilities.asmdef and OSA.Demos.asmdef. You'll get script errors, so go and replace your references to target the appropriate new asmdef(s) Refer to the Migration guide for this version for a step-by-step transition. Features: - Support for Unity's new input system - Added AnimationParams.CallDoneOnScrollCancel field for getting ondone callbacks when a SmoothScrollTo gets cancelled - OSA: added ForceRebuildLayoutNow() which now allows you to do direct layout rebuilding, unlike the existing ScheduleForceRebuildLayout() - OSAContentDecorator: making use of the new ForceRebuildLayoutNow() instead of ScheduleForceRebuildLayout() to update OSA's padding immediately via the decorator's new AdaptToPadding() method. Useful when changing the decorator's size dynamically and you need the OSA's padding to follow immediately rather than wait for 1-2 frames. - Allowing the OSA folder to be moved anywhere. A 'PluginPathTracker.asset' file is present in the pack and we resolve paths by querying this asset's local path. Fixes: - Fixed drag behavior & improved pointer tracking logic, including when using multiple pointers (ex. multi-touch) - Fixed texture for dark theme OSA Wizard - Fixed OSA Wizard iterating through assemblies not finding all types Changes: - Documented the FilterableDataHelper - Updated TableView TMPro instructions - Removed OSADebugger.prefab from package and updated all scenes - The version of TMPro that was used to generate the TableView-TMPro subpack is now 1.4.1. Older ones might work, but it wasn't tested - The new asmdef 'OSA.Utilities.Editor.asmdef' references TMPro because most of the users use TMPro and it should save them some time if they want to import the TableView-TMPro subpackage. For those of you that don't use TMPro, you'll probably get a warning which says 'OSA.Utilities.Editor.asmdef' is missing a reference. You can just select it and remove the reference. There was no other middle-ground solution we could think of. If you have a better idea on how to handle this, shoot at lucian@forbiddenbyte.com Known issues: - On Unity 2021.1.15f1, clicking on the TableView's dropdown for Enum types gets you a NullReferenceException at: "UnityEngine.UI.Dropdown.AlphaFadeList (System.Single duration, System.Single start, System.Single end) (at Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Dropdown.cs:1062)". Seems like a pretty fresh error that might be solved in the near future. This person seems to be the only one affected on Unity2021 apart from us: https://www.cyberforum.ru/unity/thread2782999.html Might be related to (but the fix of disabling 'Enter Play Mode Options' doesn't work): https://forum.unity.com/threads/dropdown-behavior-broken-after-hot-reload-unity-2020-3-5f1.1098775/ If you updated to the latest Unity version and the bug persists, write us on Discord and we may find a temp workaround. UPDATE 23.07.2021 - 5.3.1: Breaking changes: - AbstractViewHolder.Init() it not virtual anymore. Added InitWithExistingRoot. Added OnRootCreated which you can now override to handle custom cases Features: - OSAProactiveNavigatior: a more reliable and flexible way of handling UI navigation. Check the input_navigation demo scene - BaseParams: added AdditionalSpacingTowardsEdge property to BaseParams.NavigationParams. Increase this to add more space between the focused (selected) item and the edge towards which you navigate - OSAContentDecorator: added SetInset public method to so you can modify the inset at any time during runtime - FilterableDataHelper: an easy way to only display items that satisfy a certain condition. This spares you from keeping 2 lists (original and filtered) in memory. Check the filterable_data demo scene Fixes: - Fixed Gravity changes not being picked up after a layout rebuild (like when resizing OSA) - Fixed several issues when doing a multi-touch by mistake (#OSA-44) - GridAdapter: fixed a bug where you could not ScrollTo the proper group in the same frame with setting the count. However, an issue still remains where you cannot ScrollTo during the same frame as Initializing, due to a Unity bug where RectTransform reports an incorrect size in Awake -- solution currently is to initialize OSA in Start. Note this doesn't affect SmoothScrollTo() - Fixed compile error on UWP on Unity 2021 Changes: - Dragging now only works with the 1st pointer (finger). Fixes #OSA-44 - OSA now allows you to drag the content even if there are no items (this fixes situations like decorators not moving when the list is empty) - ContentVisual: removed code that forcefully matched the content to the parent size. This shouldn't be done in code, as the user should always have the freedom of placing it and its anchors however they want - LoopingSpinnerExample: improved the detection of the middle item using Snapper - OSAInternal: made some methods protected internal instead of protected, so the user can also use them - CellGroupViewsHolder.Init() is now public to allow users to call it separately, in case they want a different flow to their cell group creation - Replaced the use of deprecated WWW with UnityWebRequest New demos: - input_navigation: showcasing the above-mentioned OSAProactiveNavigatior - filterable_data: showcasing the above-mentioned FilterableDataHelper UPDATE 02.11.2020 - 5.1.2: - OSAContentDecorator: Now allowing Inset to be non-zero when controlling OSA's padding (will simply put additional padding) + more responsiveness. Also, now it allows anchor scaling on x and y (OSA only controls the position) - Fixed content draggable when there are no items (which also affected decorators when the list was empty) - Fixed some demos - TableView: added Size property to ColumnInfo, as well as CurrentSize to ColumnState which can be modified after init. These dictate the size (width) of the column PATCH 24.07.2020 - 5.1.1: - Fixed a bug when importing the TMPro support for TableView. - Updated instructions for TableView TMPro support. Make sure to check them if you've used this feature. UPDATE 20.07.2020 - 5.1.0-5.1.1: Breaking changes: - OSA is now located under "/Plugins/Com.ForbiddenByte/OSA". If migrating from previous versions, Please make a backup first! And it is mandatory to use the migration guide! - Minimum Unity version increased from 5.6 to 2017.4.1f1. - If you used CancelAnimationsIfAny(), please override CancelUserAnimations instead, if the intention was to hook into this callback, or call CancelAllAnimations() if you manually want to cancel animations. Demos were updated accordingly to exemplify this (MainExample, ExpandItemToVariableSizeExample, AnimatedInsertRemoveExample). - ExpandCollapseAnimationState from namespace Demos.Common is now deprecated in favor of Util.ExpandCollapseAnimationState (Util namespace is better suited). This may give you some "ambiguous reference" error, if you've used it in your own implementations - simply use the namespace-qualified class name or remove "using Com.ForbiddenByte.OSA.Demos.Common" (recommended). - IScrollRectProxy how has ContentInsetFromViewportStart and ContentInsetFromViewportEnd properties which must be implemented. See ScrollbarFixer8 for an example. If you didn't explicitly implement this interface, this doesn't affect you. - _VisibleItemsCount is now no longer available to inheritors. Use VisibleItemsCount instead. - OSA's menu items are now located under Tools/Com.ForbiddenByte/OSA Features: - ScrollbarFixer8: Scrollbar "Pulling" effect as in the classic ScrollRect. Thanks to "GladFox" (Unity forums) - ScrollbarFixer8: added maxSize property - Added 2 new settings under BaseParams.Optimization: KeepItemsPoolOnEmptyList and KeepItemsPoolOnLayoutRebuild; these instruct OSA to not destroy any item when it normally would. Useful if creating/destroying an item is expensive. - Added OSA.GetItemSignedVisibility() to find how much of an item visible and, if only partially visible, in which direction is it cut. - Added OSA.BringToView() as a version of OSA.SmoothBringToView() which executes instantly (like ScrollTo() does). - Added setting BaseParams.Optimization.KeepItemsSizesOnLayoutRebuild which can be used as an optimization if item size calculations are expensive. - Added SimpleDataHelper.ResetItemsByReplacingListInstance(): Useful when you already have your C# List of models and a call to List`1.AddRange() is expensive. - Added GridParams.PreserveCellAspectRatio which when having a fixed amount of cells per group (row or col), it resizes them to fill the available space but keeping their aspect ratio. - Added OnApplyCustomGalleryEffects and OnRemoveCustomGalleryEffects callbacks with useful params to control even more aspects of the gallery effect. - Added OSA.ForceUpdateViewsHolderIfVisible(int) which updates a single item, but also tranparently honors ScheduleTwinPass calls during its execution. From now on, this should be the universal way of updating an item that has externally changed, since it handles everything for you, including size changes. - Added BaseParams.Animation property, which contains animation-related properties. SmoothScrollTo now has 3 lerp modes, defined in params: SLOW_OUT, FAST_IN_SLOW_OUT, SLOW_IN_OUT. - TableView: Added TableViewText.Color property - Added navigation for lists and grids, configurable through BaseParams.Navigation property. You can now navigate the ScrollView using Keyboard/Joysticks or other similar input mthods. - Added IsSnappingAnimationRunning(), IsScrollToAnimationRunning(), IsUserAnimationRunning(), IsAnyAnimationRunning(). - Added LazyList.UncacheValue() which can be used to force calling the item creator function again the next time the item at that index is requested. - Allowing disabling DragEnabled and ScrollEnabled at any time without casualties (finally (: ) - OSASnapperFocusedItemInfo script: Notifies you when the currently focused item by Snapper8 changes. Fixes: - Fixed Snapper8 not working correctly when resizing animation is also used (snapping cancels all animations, but now snapping doesn't even start if there was a resizing in the current frame - this also counts all resizes, including CSF-based ones, which may also fix other undiscovered bugs) - Fixed a bug in gallery effect where it didn't correctly resize the cached recycleable items when ScaleToZeroInsteadOfDisable=true - Fixed resizing items outside viewport didn't work properly sometimes, and it didn't push/pull the visible items when expected (thanks Gladyon (Unity forum)). - Improvement in BaseParamsWithPrefab: On Unity 2017.1 and up, the RectTransform.rect.width and height report the "correct" values (values the prefab had at the moment it was created in the assets section), but in older versions the reported width and height were 0 or negative. For the older versions, we show a warning when the prefab is supposed to control the item size. - Better tracking of size changes during SmoothScrollTo and GridAdapter's ScrollTo which in some cases it could've made the content jump. - Fixed Snapper8 not working correctly when a resizing animation is also used (snapping cancels all animations, but now snapping doesn't even start if there was a resizing in the current frame - this also counts all resizes, including CSF-based ones, which may also fix other undiscovered bugs). - BaseParams: Fixed major bug in serializing old versions of BaseParams - Fixed bug where if an item is inserted during a pull from the extremity, the content jumps. - Fixed some edge cases in demos using CSF-based item resizing - Fixed bug where _SmoothScrollCoroutine wasn't set to null after a SmoothScrollTo was cancelled, leading to an invalid - but benign - state. - Fixed bug in grid's rebuildlayout which didn't clear/update items in the bin when the NumCellsPerGroup changes. - ItemDraggingExample: Fixed small but hard to solve bug where the last item couldn't be replaced when another one was dragged on top of it. This needed several changes to be made to the visual manifestation of dragging. For ex, now which items are closer is calculated based on their Center, not their Top edge. - Fixed occasional small gaps at start/end of the viewport when caling SetVirtualAbstractNormalizedScrollPosition() - found by using the Scrollbar. - Fixed FIFOCachingPool not destroying objects. - Fixed snapper not snapping to the next neighbor the first time for pageview-like scrollviews. - Fixed vh.OnBeforeDestroy() not being called in OSA.OnBeforeDestroyViewsHolder() (thanks novaVision (Unity forum)). - When ScrollbarFixer8 wasn't a descendant of the target ScrollRect, it couldn't detect it. Now starting the search from the provided Viewport rather than from its own parent. Changes: - Made Snapper8.GetMiddleVH public for convenience: get's the currently "focused item". For more functionality, use the OSASnapperFocusedItemInfo script instead. - Deprecated (warning) ExpandCollapseOnClick in favor ExpandCollapseAnimationState. All demos were updated accordingly. - ItemDragging demo: improved item dragging, allowing dragspace to be the scrollview itself, rather than only the viewport - LazyList now implements IList - Added BaseParamsWithPrefab.PrefabControlsDefaultItemSize (true by default, for backwards-compatibility). This can be turned off to allow non-scene prefabs on Unity versions prior to 2017.1 - Added OSA.CancelUserAnimations which is now called each time the user needs to cancel his custom animations related to item sizes/scrolling - BaseParams: turned effects and optimization into properties with unity-serialized private fields - Deprecated ExpandCollapseAnimationState from Demos in favor of the class with the same name but under Utils folder (since this is an utility, not a demo-related class). - Demos: Changed class SceneEntry to DemoSceneEntry to emphasize even more its usage in hope to prevent users from thinking that they actually need it in their own code. - Exposed BaseParams.AssertValidWidthHeight() to inheritors so you can use it yourself when you have custom prefabs assigned params (see MultiplePrefabsExample). - Removed shadows in several scenes to keep the ui clean. New demos: - simple_nested_scrollviews_tabbed: A commonly known view that has "Pages" through which you scroll horizontally like in a PageView; and each page contains a vertical list of sub-items. - different_prefab_per_orientation: A simple example of how you can change the prefab at any time and re-create the items. This one changes the prefab based on Viewport's aspect ratio, allowing a more detailed view of the data when it detects a it's in "landscape". BIG UPDATE 24.10.2019 - 5.0: Features: - TableAdapter, which is now the biggest sub-component of the OSA package, apart form GridAdapter and DateTimePickerDialog. Generally intended for displaying data which resemble a table from a database, i.e. having "columns of potentially different types" and several "rows", which are called tuples here. The maximum supported tuples count is int.MaxValue-1. Highlights: -- Easy to set up via OSA Wizard -- All major data types: string, int, long, float, double, bool, enumeration (can specify any enum type), raw object (displayed via ToString()) -- Values can be edited via an input field, a Toggle or a dropdown. -- Column sorting, when the dataset's size allows it -- Setting a cell's value to null, or an entire column to null (if the dataset's size allows it) -- Partially configurable prefabs for columns, rows, cells in columns' header and cells in rows -- Tuple resizing modes: NONE (default), AUTO_FIT (fit each tuple's height to its contents) and MANUAL (resize any tuple via dragging an arrow) -- Data can be fully managed by you implementing ITableColumns and ITupleProvider, or you can use the existing BasicTableData, BufferredTableData or AsyncBufferredTableData (which together with AsyncLoadingUIController can fully achieve async data loading from non-immediately available data sources). See the provided example for usage. -- Support for using TextMesh Pro (which replaces the Text, InputField, Dropdown with TMPro counterparts). Instructions under OSA/Extra/PluginSupport. The table_view scene & its associated scripts demonstrate most of a TableAdapter's functionality. - BufferredDataSource which retrieves data in chunks synchronously - AsyncBufferredDataSource does a similar job as BufferredDataSource, and allows placeholder data to be shown during data retrieval. See example usage in TableView's AsyncLoadingUIController - Added CreateBufferredRecycleableItems and AddBufferredRecycleableItem(s) methods to OSA, which allow you to pre-instantiate some items and keep them in memory to avoid any subsequent object creation/destruction. For this, a special "bufferren recycleable items" internal list was created, apart from the "recycleable items", and it contains items that won't be directly destroyed, unless they're "promoted" to the "recycleable items" list. This can also be achieved by setting a higher BaseParams.optimization.RecycleBinCapacity (which previously didn't work, but was fixed in v5.0). You can pass a custom index for the views holders. Useful when having multiple prefabs and you wan to distinguish between them, since CreateViewsHolder(int) is called for these. OSA calls it with -1 by default, but in case of multiple prefabs, you'll use a different negative value for each prefab type. - Added UseUnscaledTime to BaseParams which controls whether OSA is affected by Time.timeScale or not (not affected, by default). - Added CutMovementOnPointerDown to BaseParams.Effects which, if true, stops any movement or inertia immediately when a touch/click begins - Added ScrollSensivityOnXAxis to BaseParams to control the perceived sensivity to the Mouse's horizontal scrolling wheel (where supported) or similar input methods that send scroll signals on the horizontal axis - Added ForwardDragSameDirectionAtBoundary to BaseParams which, if true, forwards the drag/scroll events in the same direction to the parent when the current scrolled position is at boundary, thus allowing scrolling through nested Scroll Views that have the same scroll direction. - Added ItemTransversalSize to BaseParams, which now allow changing the transversal size of items (i.e. widths for vertical ScrollViews and vice-versa) - Added Gallery (of type GalleryEffectParams) property to BaseParams, which allows more fine-tuned behavior than previous GalleryEffectAmount and GalleryEffectViewportPivot properties. Scale and Rotation can be changed now. - Added KeepItemsSortedInHierarchy to BaseParams.Optimization, which allows you to keep the actual GameObjects of items sorted in hierarchy via their ItemIndex Use if performance is not a problem. Certain use-cases, like the TableView, don't work nicely with this. - Improved Snapper8: Allowing skipping neighbors if the previous snap didn't finish naturally (when, most probably, the user swapped again fast, with the sole intent of skipping an item). Initially needed for PageView-like setups, where snapping takes control much more than dragging. New demo scenes: - TableView, which is now the biggest component of OSA, apart form GridExample and DateTimePicker - Simple multiple prefabs, which is much more simpler than the Multiple prefabs example, and thus easier to study - Grid with subgategories, providing very efficient way of displaying multiple categories of grid-like groups, allowing a customizable prefab to be used for categories' header - Nested ScrollViews in same direction - allowing a parent ScrollView take controll of the scroll/drag event after the children reached its maximum scrolling position in the current direction of the scroll. Changes: - OSA now has UpdateItemSizeOnTwinPass() callback, which is called to give a finer control over how the item sizes are calculated on twin pass. The default implementation calls forcerebuild and takes the rect's size, but inheritors can customize this however they want - Added PostRebuildLayoutDueToScrollViewSizeChange() which is now called after a rebuild, so the user can have a chance of executing some code AFTER every other resizing-related code in OSA was executed - Added OnBeforeDestroy() to AbstractViewsHolder which is called in tandem with OnBeforeRecycleOrDisableViewsHolder(), but now allows the VH itself to know about its lifecycle, for better code isolation. - Grid: deferred cell group GO prefab creation by having a CreateCellGroupPrefabGameObject virtual method - Grid: also added OnBeforeDestroy() to CellGroupViewsHolder, which calls OnBeforeDestroy() on each child cell ViewsHolder - An OnScrollViewSizeChanged() flow is now executed also when the Viewport's size changes directly, without having the ScrollView itself change its size. - OnScrollViewSizeChanged() is now called only when the ScrollView/Viewport changes its size in the scrolling direction, if BaseParams.ItemTransversalSize is -1 (meaning item's transversal size is not managed by OSA) and transversal padding is set to anything but -1 (meaning "center the item transversally"). In other words, on transversal size change of Viewport or ScrollView OSA doesn't refresh if it's configured to control neither of the items' position or size transversally. This is useful when items transversal position and size are managed outside, like a TableAdapter does to its Tuple ViewsHolders. - Added UnmarkForRebuild() to AbstractViewsHolder, which is called after a ViewsHolder was marked for rebuild and was rebuilt. Also called in OnBeforeRecycleOrDisableViewsHolder(). This was initially useful for cases where you want to resize an item via ContentSizeFitter: you'd enable the CSF in MarkForRebuild() and disabled it in OnItem[Height/Width]ChangedPreTwinPass(), but now you can do it directly in UnmarkForRebuild(), and keep the code more isolated. - Added ForceRebuildViewsHolder() and ForceRebuildViewsHolderAndUpdateSize() to OSA - useful when you only update 1 single item via CSF or similar, which doesn't require a whole "twin pass" (calling ScheduleComputeVisibilityTwinPass()). The ViewsHolder passed to these methods can also be an external one (i.e. not managed by OSA) - Added virtual OnScrollPositionChanged() to OSA, which can now be overridden to execute custom code on this event - Item dragging demo now puts empty spaces at positions where you drag selected item - Added Init() method to IOSA, so adapters can be initialized from outside without having to declare the explicit adapter implementation - InputFieldInScrollRectFixer utility script was improved and some issues fixed, and InputFieldInScrollRectFixerTMPro was also added for use with TextMesh Pro - On demo scenes and in most prefabs, added ShadowRemover script which removes Shadow on Unity versions smaller than 2019.1. A lot of Shadow scripts seem increase the workload of Gfx.WaitForPresent() in profiler, in those Unity versions. - Added keepVelocity parameter to OSA.RequestChangeItemSizeAndUpdateLayout - Added SetOrUpdateManuallyCreatedValues() to LazyList, for when you want to add a range of values created externally - useful when working with buffers/chunks of downloaded items. - Added AlsoControlItemTransversalSize property to BaseParamsWithPrefab, in case you want to use the prefab's own transversal size to set BaseParam's ItemTransversalSize - RectTransformEdgeDragger moved from Demos to Utils, as now it's used by TableAdapter Fixes: - Fixed snapping not being enabled after OSA being disabled during snapping/auto-scrolling - Fixed (ContentSizeFitter) twin pass not working properly if the items' sizes become smaller than DefaultItemSize. The proper (best performance) fix is to make sure the prefab's initial size is the smallest of all possible items - Fixed RemoteImageBehaviour major bug when loading from cache didn't update the _CurrentRequestedURL leading to old textures in the RawImage component not being replaced by the requested ones - Fixed RemoteImageBehaviour same key cached multiple times - Fixed OSA being negatively impacted by high drag threshold + now also taking drag threshold into account just like ScrollRect does, i.e. the content doesn't jump by that amount anymore in first drag. This was more apparent with users with TouchScript, which reports an abnormally high difference between the position in OnInitializePotentialDrag and OnBeginDrag - Fixed CellGroupViewsHolder not accounting for potential unknown, already-existing children of the root. Fixed by explicitly keeping track of the instantiated cell GOs - Fixed improperly working RectTransformEdgeDragger - Fixed BaseParams.optimization.RecycleBinCapacity not working as expected. Now OSA doesn't destroy items before filling the recycling buffer, if this value is specified - Fixed major bug when OSA.ShouldDestroyRecycleableItem() returns false and IsRecycleable also sometimes returns false (for example, in multiple prefabs cases), which lead to GetNumExcessObjects() returning more than 0 in ChangeItemsCount (which threw an Exception). - Fixed ShouldDestroyRecycleableItem() not working as expected. Now items for which this returns false are included in the "bufferred recycleable items" which aren't destroyed - Fixed OnBeforeDestroyViewsHolder() not being called in all cases (when ClearVisibleItems or ClearRecycleableItems is called) - Fixed major bug in OSA when changing items count while release from pull is in progress AND there are no visible items - Fixed NPE bug in ChildGridExample of Nested scrollviews example - Fixed LazyList doing some unneeded allocations that should've impacted initial load time a bit. Also fixed another internal bug. Breaking or behavior-altering changes since v4.3: - Migrated almost all of BaseParam's, GridParams', BaseParamsWithPrefab's fields to properties, thus changing names like itemPrefab into ItemPrefab - All OSA assets, except the Playmaker integration, are now exported with text serialization (serialization before exporting was set to Force text in Project settings) - Added Time and DeltaTime properties in OSA.cs to enforce derived classes to explicitly use either OSA's Time or UnityEngine.Time - Scroll direction using mouse wheel or similar input devices now behaves exactly as in Unity's ScrollRect. Because of this, the following scroll directions were reversed: mouse scroll on both X and Y axes in horizontal OSAs. These can be manipulated separately by the ScrollSensivity and ScrollSensivityOnXAxis properties. - CreateViewsHolder(int) can now be called with negative values of the itemIndex parameter, when new items are needed in the "buffered recycleable items" list. Note that this is done ATM only as a result of calling AddBufferredRecycleableItem(s) - BaseParams.Effects.CutMovementOnPointerDown is true by default, thus altering previosu behavior where a ScrollView that's self-scrolling due to inertia only stopping the the drag begins, instead of when the touch/click begins - BaseParams.UseUnscaledTime is true by default, which means OSA won't be influenced by Time.timeScale, thus altering the previous behavior - The Gallery property must now be used instead of the obsolete GalleryEffectAmount and GalleryEffectViewportPivot - Added OnDisable() and OnEnable() which now need to be overridden if you need to execute code in these callbacks. This means that any of your existing OSA implementations that declare their own OnDisable() or OnEnable() need to make sure these callbacks don't hide tehe base's callbacks, since Unity only calls one of them - Moved TransientSpeedBetweenDrags from BaseParam to BaseParam.effects - If you use RectTransformEdgeDragger utility script in your own scenes, you need to recreate it, as it has a new way of operating. See other example scenes BIG UPDATE 22.03.2019 - 4.3: Features: - Transient speed between immediate subsequent drags now increases exponentially (as opposed to linearily). This translates to much faster dragging speed with each subsequent immediate drag event. Good for UX - PercentageContentPadding script which can be used to specify the desired padding as a percentage of the viewport's size, which is useful for things like horizontal galleries where the list should start and end exactly in the middle (as opposed to far left and far right, respectively), regardless of screen size - PackedGridLayoutGroup script, which uses Binary Tree 2D Packing algorithm to arrange items of different sizes in a given amount of space as efficiently as possible - Grid's SmoothScrollTo now moves exactly at the target cell, rather than to its group's center. This is more useful for complex cell group layouts that need more SmoothScrollTo passes to reach the target precisely - General-purpose pooling script. Can be used with (but not limited to) RemoteImageBehaviour to prevent re-downloading images New demo scenes: - Hierarchy (aka TreeView) with sticky headers, supporting an arbitrary depth. At the moment, there's 1 header that sticks depending on what's the first visible item's depth. It uses the OSAHierarchyStickyHeader script and IHierarchyNodeModel, IHierarchyNodeViewsHolder, IHierarchyParams, IHierarchyOSA interfaces - Packed grid - Similar to a usual grid, but items in the groups can now be of different sizes and are packed randomly using the PackedGridLayoutGroup script on the cell group - Animated insertion and deletion of items - collapse an item to 0 size before deletion, and the opposite on insertion - Collapsing and expanding items to their own size, given by a ContentSizeFitter Changes: - Cleanup: only the minimal amount of assets are now in the main package. Utilities and Demos were included in their own packages found under "OSA/Extra/" - Removed old migration code from <4.1 to 4.1-4.2. Only upgrading from v4.2 to v4.3 is now possible. Upgrading from an earlier version requires doing multiple intermediary upgrades. Contact us for support on this - OSA.Start() now calls Init() only if it wasn't called already - this allows overriding Awake and calling Init() yourself to initialize it immediately after the game object is activated without the need to also override Start just to prevent a call to base.Start() which the default implementation uses for initialization - AbstractViewsHolder.Init() now has also takes the parent in which the item's prefab will be instantiated. All of the examples were updated to reflect this Refer to the "Potentially breaking changes" below for how this could affect you, in case of migration - Divided all nested classes in OSASubComponents into their own files under Core/SubComponents - Added correctItemPosition param to RequestChangeItemSizeAndUpdateLayout, that helps when the item's local position was externally changed and the adapter needs to correct it - OSA's menus were moved from frame8->OSA to Tools->OSA - Added forceLayoutRebuildOnDrag and forceLayoutRebuildOnBeginSmoothScroll fields to BaseParams.Optimization, which can be used as quick solutions if items suddenly become displaced, until the exact reason is found. They're a convenience and not an excuse for skipping the search for the actual cause. - Restricted the allowed items count when looping + restricting twin pass to 800M for now, because of overlapping issues - GridAdapter: added OnCellViewsHolderCreated which is called for each of the cells in the group the moment the group is first created. No more need to get the entire group and iterate over the cells in it when you need to execute code when a cell is first created - Grids now allow you to specify a custom LayoutGroup for the cellGroup prefab - Hierarrchy OSA now uses IHierarchyNodeModel, IHierarchyNodeViewsHolder, IHierarchyParams, IHierarchyOSA. This allows for external management, but it's not mandatory - Throwing an exeption on invalid OSA's or defailtitem's size. The sizes can be invalid if OSA or the prefab is instantiated outside of a Canvas. - General optimization & internal improvements - Throwing and OSAException now instead of invalidopex and unityex in the core osa classes (demos excluded) - GridParams.grid.MaxCellsPerGrpup can now be lower than -1, to force more items than the space allows. For example, -2 sets 2x more items than the space allows. This may be useful for advanced scenarios where a custom LayoutGroup for the cellGroup is used - Added onDone Action as parameter to SmoothScrollTo and SmoothBringToView, which is more convenient than using the onProgress callback and checking for the value to be 1f - Added OnRefreshWithSign event to PullToRefreshBehaviour to also receive the refresh sign (in case pulling from both ends is enabled). This is now used to insert items either at the start or at end, depending on which edge is pulled - Playmaker support was also updated and re-tested Fixes: - Fixed GridParams exposing MaxCellsPerGroup directly and even serializing it. Now it only uses the grid.MaxCellsPergroup. Refer to the "Potentially breaking changes" section below - Fixed reaching list's start with high velocities ending up suddenly jumping at the end - Fixed scrolling speed suddenly stopping sometimes when doing multiple fast swaps (it's more apparent on high-density mobile displays) - Fixed items before the removed ones disappearing when removing items from before viewport, from an index bigger than 0 and when the final result would've made the content smaller than viewport - Fixed Snapper8 alternately starting and ending snapping very fast over the entire snapping duration, which didn't look very smooth - Fixed PullToRefreshBehaviour - Fixed DraggableItem not being dragged if a child button was pressed - Fixed OSA calling MyUpdate and MyLateUpdate without waiting to be initialized first. This allows enabling the script without immediately initializing it - Fixed SmoothScrollTo animation when twin passes occur during it - Fixed RectTransformEdgeDragger script to work in multiple Canvas spaces - Fixed AspectRatioFitterByLayoutElement working even if it's disabled - Fixed BringToView not being implemented for grids - it falls back to SmoothScrollTo for now - Fixed some warnings & visual studio-only warnings Potentially breaking changes: 1. AbstractViewsHolder.Init(RectTransform, int, bool = true, bool = true) changed to Init(RectTransform, RectTransform, int, bool = true, bool = true). It now takes an additional parameter on the 2nd place which specifies the parent where the prefab should be instantiated (usually, the content). Wherever you see this error, pass the Content (usually accessed via _Params.Content) 2. GridParams.MaxCellsPerGroup is now exposed as GridParams.grid.MaxCellsPerGroup, so make sure to and correct its value in inspector, if you use a constant number of cells per group, rather than a variable number (-1, default) UPDATE 30.11.2018 - 4.2: - Playmaker support (see manual for compatibility) - Removed 3.2->4.0 migration support (4.2 is only upgradable from 4.1) - Fix: MainExample.cs error on .net 4.6 when replacing items in a list while iterating it through "foreach" - IOSA: added "InsertAtIndexSupported" and "RemoevFromIndexSupported" properties. OSA returns true for both, while GridAdapter doesn't. This allows the DataHelpers to fully control an OSA instance's data through an IOSA interface, regardless if it's a grid or list (grids don't support insert/remove at index) - Fix: data helpers had some minor bugs - Other small fixes UPDATE 05.11.2018 - v4.1.1: - improved code aestethics in cetain areas and removed some warnings - OSA: OnInitialized and OnItemsRefreshed virtual methods provided as a replacement for subscribing to Initialized and ItemsRefreshed events (which is not agood practice) - Fix: NPE in ClearVisibleItems UPDATE 24.07.2018 - v4.1: The v3.2 to v4.0 migration guide also works for v3.2 to v4.1. It was updated to reflect this - renamed the root folder SRIA to OSA - replaced the historical name "SRIA" to OSA (Optimized ScrollView Adapter) in code and in the docs. Thus, SRIA becomes OSA, ISRIA becomes IOSA etc. - created SimpleDataHelper and LazyDataHelper to abstractize the list manipulation & adapter notifying under a single method, when favorable - better structure of the demos and sources. - OSA: fixed bug where some items occasionally overlap when the item count exceeds a certain value (around 100M) and scrolling big distances using the scrollbar - OSA: added keepVelocity parameter to the Refresh method, similarly to how it'd added to InsertItems/RemoveItems/ResetItems - OSA: preserving the ScrollView's velocity on resizing - OSA: renamed the property Initialized to IsInitialized - OSA: added Initialized event that fires at the end of Init - OSA: added SmoothBringToView(), which brings a partially visible or not visible item into the view, until it's completely visible - OSA: GetItemRealInsetFromParentStart(RectTransform), GetItemRealInsetFromParentEnd(RectTransform) - OSA: fixed ScrollPositionChanged not being called sometimes - OSA: updating gallery effect in OnScrollPositionChanged, which removes the subtle delays in scaling when fast-scrolling - OSA: fixed recycleable items having their localScale restored to 1 when there's no gallery effect, but it should only be done if _Params.optimization.scaleToZeroInsteadOfDisable is false, since in that case the scale of disabled items is 0 and should remain that way until enabled - OSA: ViewsHolders are now enabled before calling UpdateViewsHolder on them and only checking if they're still enabled after (exception otherwise). "enabled" in this context means: non-zero scale, if _Params.optimization.scaleToZeroInsteadOfDisable; active gameObject, else - IOSA: added InsertItems/RemoveItems/ResetItems/Refresh - IOSA: made ContentVirtualSizeToViewportRatio obsolete in favor of the new IScrollRectProxy.GetContentSizeToViewportRatio() (extension method) - IScrollRectProxy.cs: added properties: Viewport, Content; added method GetViewportSize(); added extension methods GetScrollableArea() and GetContentSizeToViewportRatio() - Params: added DragEnabled and ScrollEnabled properties to BaseParams. If ForwardDragEvents is enabled: it's not affected by them + if DragEnabled is false, the events are always forwarded, regardless of the x/y delta diff - Params: made BaseParamsWithPrefab serializable so it can be used directly, especially now, when the list data can be managed with DataHelpers - Utils: improved RectTransformExtensions.SetInsetAndSizeFromParentEdgeWithCurrentAnchors() method which doesn't require a parent to be passed to it anymore - Utils: added UnityScrollRectProxy script, which provides access to a Unity's ScrollRect through IScrollRectProxy - Utils: added NonInteractableScrollRect script, which is a plain Unity's ScrollRect that doesn't receive manual input, only through scripts. - Demos: DrawerCommandPanel is now decoupled from the examples and is not a singleton anymore, but we still don’t recommend using the example scripts in production (at least clone them and start from there, so you can go back and see the original one if something goes wrong) - Demos: each scene now has an "SceneEntry" component attached to a game object named "Entry", which dictates what happens in the scene and manages most of the UI, so the adapter code in "Example" is more cleaner and separable - Demos: replaced all uses of BaseParamsWithPreabAndData and BaseParamsWithPreabAndLazyData with the simpler BaseParamsWithPrefab and managing data using SimpleDataHelper and LazyDataHelper, respectively - Demos: improved PullToRefreshBehaviour & gizmo, which can now be pulled from end - Demos: using SceneEntry scripts instead of helpers and to also move there DrawerCommandPanel stuff so the examples will be more isolated - Demos: fixed MultiplePrefabs example avatar image & item indices in titles when using insert/remove - Demos: fixed NestedScrollViews example not scrolling inside the child ScrollView if the drag starts on empty space - Demos: fixed Hierarchy example not restoring the dropdown arrow when calling CollapseAll - Demos: fixed items in Main example not properly clipping children on resize when gallery effect is 0. This is a RectMask2D unity bug which has a simple workaround - Demos: fixed non-overlay Canvases in item_dragging and page_view_worldspace to have Mask+Image on Viewport instead of RectMask2D as this it seems to not work on 2018.1 and 2018.2 with WebGL. Probably it happens on other platforms/unitys too - Demos: renamed scene _Main to _Home BIG UPDATE 10.07.2018 - v4.0: Minimum supported Unity version is 5.4.3 and up. OSA v3.2 is still available for Unity 4.7+ users (contact us via email) See migration guide from v3.2 to v4.0 here Features: - works as an independent component and it doesn't need a ScrollRect anymore, which gives us much more control & improves reliability - max items count is now int.MaxValue-1 (2,147,483,646), both for lists and grids - substantial speed improvement overall - ability to take an item's views GameObject from the list and do whatever you like with it + inversely, insert an item with an already-instantiated prefab. This was needed to implement the drag&drop scene, but can also be useful in other scenarios - dragging the items within the list(re-ordering), between 2 lists (transferring) or outside (orphaning - setting aside to drag later into a list). Example scene provided - items' sizes can now change when looping is enabled, including changing through ContentSizeFitter - scrollview nesting out of the box (supports both OSA and Unity's ScrollRect as parents) + example scene - nested scrollviews example scene: Vertical list with horizontal GridView adapters as children - existing items won't get destroyed & re-created after a Remove/Insert operation, since they don't change their data. Only their indices may change as a natural consequence, so OnItemIndexChangedDueInsertOrRemove() was provided to handle that - optional parallax effect when assigning a RawImage to ContentVisual property. The amount is adjustable via inspector - GridAdapter now can have variable number of columns AND rows by setting MaxCellsPerGroup to -1 and cell's preferredHeight/Width and/or minHeight/Width - support for all render modes (screen-, camera- and world-space) - added "scaleToZeroInsteadOfDisable" field to BaseParams.Optimization, which enables ability to scale out-of-view objects to zero instead of de-activating them, since GameObject.SetActive is slightly more expensive to call each frame (especially when scrolling via the scrollbar). This is not a major speed improvement, but rather a slight memory improvement. It's recommended to use this option if your game/business logic doesn't require the game objects to be de-activated - optional scrollbar rotation effect when pulling the end of the content - added some more utility scripts & methods (notably, for space-conversion) Fixes: - fixed looping misbehaving when having items of sizes different than DefaultSize - fixed SmoothScrollTo duration when looping or when content size changes during scroll (like when using ContentSizeFitter) - fixed both snapping and galleryeffect on camera- and world-space render mode - fixed alignment of cells within the cell-group and within the GridView - fixed misplaced items when removing a lot of items frame by frame (as it's done when collapsing a folder in the hierarchy example) and contentGravity is not START - fixed space conversion utility methods not working for world- and camera-space canvases - 100% reliable way of setting the ScrollView's velocity (as opposed to the classic ScrollRect, which didn't always work) - preserving velocity on ScrollView resizing (like orientation changes on mobile or window resizing) Potentially breaking changes: - the content is a fixed panel now with the same size as the viewport. During scroll, only the items are scrolling. However, if you have a background that needs to scroll together with the items, we provide a RawImage "ContentVisual" property that changes its X or Y property of the UV rect any time the scrollview is dragged. This is also used for the parallax effect - content's anchors are set to and the content's size is set to the viewport's at init time - some utility methods now use double-precision float instead of single-precision, including some events, like IScrollRectProxy.ScrollPositionChanged - some properties are now of type double, including parameters of a few methods. If you get errors because you overrode some of these methods/properties, simply change the parameters type to double - removed the updateMode property. The visibility computations are now reliably triggered, since we don't depend on a ScrollRect anymore. The UpdateMode=MONOBEHAVIOUR_UPDATE may be added as an experimental feature in the near future in a different form (like a method that you call), for those that want it back for performance reasons - SRIA.Refresh now takes 2 bools: contentPanelEndEdgeStationary and keepVelocity (same as the Insert/Remove/Reset methods) BIG UPDATE 15.12.2017 - v3.2: - added graphical interface to aid in generatin of a scollview w/ scrollbar and configuring it with SRIA - usage of the SRIA creation wizard is covered in great detail with screenshots in Instructions.pdf - major bugfix: content was freezing with movementtype=clamped - fixed broken snapping animation when there are 2-3 items which cover the entire viewport - BaseParamsWithPreab.InitIfNeeded(): throwing exception if the prefab is null after this call - minor bugfixes - added "Ask a question" to the menu bar UPDATE 28.11.2017 - v3.1: - added responsive datetime picker popup which can be opened directly from code without additional setup - added 3 demo scenes: datetime picker, PageView, hierarchy - improved/expanded Snapper's functionality - allowing snapping for updateMode=ON_SCROLL - bugfixes UPDATE 22.10.2017 - v3.0.2: - hotfix: fixed UWP support & updated instructions - reflection is now used less places and only if both of these are true: 1. not building for UMP; 2. not using SRIAStandardInputModule. - fixed unity's 2017.2 bug that made the items with a ContentSizeFitter return to original size after CSF was disabled UPDATE 13.10.2017 - v3.0.1: - hotfix: "cannot add RectTransform in Awake()" Unity internal error for some Unity versions BIGGEST UPDATE SO FAR 07.10.2017 - v3.0 !IMPORTANT: migrating from 2.x.x requires several steps to be made and a prior full backup is mandatory. See the changes section Features: - the adapter's main class ScrollRecttItemsAdapter8 was renamed to SRIA and it's now a MonoBehaviour which should be attached to the ScrollRect - content panel's real size is now clamped to 10*viewportSize to allow smooth scrolling. This was made possible by keeping track of the "virtual" content size & position - 100x more items can now be added, up to 10 000 000 in the provided demos - item size changing is now smooth regardless of the items count - Snapper8 script integrated with the base adapter provides snapping functionality which can be fine-tuned via inspector - ScrollbarFixer8 was greatly improved and now includes animated auto-hide and optional fade in/out - much more cleaner & intuitive UI for the demo scenes w/ navigation - created LazyList, which can be used to hold large amounts of item models which are constructed only when first accessed - items' sizes are now stored only if they differ from the "default size", which can be set in the inspector. This massively improves the performance of ChangeItemsCount() call, but also cuts RAM utilization dramatically - gallery effect - items can be scaled (not resized!) based on their positions relative to a set viewport point (configurable) - Items can now be inserted/removed from anywhere in the list without re-initializing the remaining ones. InsertItems, RemoveItems, ResetItems methods are provided - added chat demo scene with message pop-up animation - added IncrementalItemFetching example scene & script - ScrollRect's inertia can now be preserved after changing the items count - RequestChangeItemSizeAndUpdateLayout can now be used even for items that aren't visible Changes: - renamed ScrollRecttItemsAdapter8 to SRIA, which implements the non-generic interface ISRIA in order to provide common functionality in any context as an interface (since generic classes can't be referenced through a base type variable) - ISRIA implements IScrollRectProxy - because the adapter is now a MonoBehaviour, the example scripts directly inherrit from it, thus needing less code to be written - ScrollbarFixer8 is now mandatory due to content's real size not growing past 10*viewportSize - items' sizes are now assumed to be Params.DefaultItemSize and they can be set per-item in the CollectItemsSizes callback, which is called each time the items count changes - a lot of variables/classes were refactored with different names/signatures, so a migration from a version prior 3.0 should only be done after a complete backup - BaseParams: deprecated the confusing minNumberOfObjectsToKeepInMemory and added recycleBinCapacity instead, which is a more adequate term, now clearly representing the maximum allowed items that can be disabled (in the 'recycle bin') at any moment - BaseParams: added contentGravity, which specifies the conten's prosition when the content is smaller than the viewport (it sets the viewport pivot) - SRIA: not implementing OnScreenSizeChangedEventDispatcher.IOnScreenSizeChangedListener anymore + not adding the OnScreenSizeChangedEventDispatcher component. the changes in size are now checked directly inside the adapter's MyUpdate. This also makes it easier to track any size change, not only the screen change + (more importantly) the user doesn't need to call Notify anymore. NotifyScrollViewSizeChanged was removed and OnScrollViewSizeChanged was added instead, which is called for you - SRIA: added ShouldDestroyRecyclableItem() which is called for all recyclable items after a compute visibility pass to see what recycled items to keep. - SRIA: renamed GetMinNumObjectsToKeepInMemory to GetMaxNumObjectsToKeepInMemory - SRIA: added destroyedItemsSinceLastScrollViewSizeChange to internal state, which it's used to minimize gc calls - SRIA: added OnBeforeRecycleOrDisableViewsHolder, which is very handy in preparing the views for potentially being recycled (thus decoupling it from UpdateViewsHolder, which is not responsible from clearing the previous data anymore) - SRIA: added GetItemsCount() - SRIA: the "Twin" pass is now done immediately after the ComputeVisibility, thus allowing the adapter to have any BaseParams.updateMode, not only MONOBEHAVIOUR_UPDATE - BaseParams: setting padding to be the same as spacing if looping (since here there's no concept of "start" or "end") - SRIA: renamed ChangeItemCountTo to ChangeItemsCount and also changed its signature to allow much more versatility, like inserting/removing items at a specific index - SRIA: possibility to start a new SmoothScroll, cancelling the current one by allowing another parameter "overrideCurrentScrollingAnimation" - SRIA: added GetViewsHolderOfClosestItemToViewportPoint() - ISRIA: added ScrollPositionChanged, which is the only reliable way of receiving the correct OnScroll event (similar to the standar ScrollRect.onValueChanged) - SRIA: Dispose is not required to be called anymore, because it's automatically called in SRIA's own OnDestroy() - MultiplePrefabsExample: expanding now works like a toggle group (used the newly feature of changing a non-visible item's size). max 1 item can be expanded at once - ExpandCollapseOnClick: fastin-slowout resizing instead of linear - AbstractViewsHolder: InitIfNeeded() is now also called when the ScrollView size changes and it now includes the ISRIA reference as a param - removed simple_tutorial from build & from navigation because it's similar to simple_pull_to_refresh - created new documentation for v3.0. The old one will still be available at the same link Bug-fixes: - pull-to-refresh allowed a second pull to be executed before the previous one finished - SimpleImageDownloader: setting the instance to null in on destroy - a lot more undocumented bugs HOTFIX 06.07.2017 - v2.5.1: - fixed a small GridParams bug that was adding additional space between cells UPDATE 31.05.2017: - support for Content Size Fitter (for items with unknown sizes at init time) + example scene - complete example scene demonstrating the implementation of a "select items & act" behavior, commonly used in apps/games where the user can perform an action on a subset of the items list (in this case, it can delete them). BIG UPDATE 10.05.2017 - v2.5: Features: - Much better support for multiple prefabs (using different view holder & models with the same adapter). Dedicated example scene & scripts - Creating & updating the view holder are now done in 2 different callbacks, to separate concerns - Pull To Refresh utility w/ dedicated example scene & scripts - Code reference extended to include everything + migrated online (can be accessed via Unity's menu bar) - SimpleImageDownloader utlity with smart queue management to decrease overall bandwidth usage !IMPORTANT! if updating from a previous version: You need to change a few things, although it's HIGLY recommended to just delete the previous package and import this instead, because you may introduce hard-to-detect bugs that can make some nuclear reactors blow, somewhere over the rainbow. All classes that were in the global namespace were moved to an appropriately-named namespace to avoid conflicts. What to delete (because it was moved in another folder or it's not used anymore or it was renamed): - Prefabs/LiteExample folder - ScrollRectItemsAdapterExample.cs and SimpleTutorial.cs from the Scripts folder - Scripts/Util/ScrollToPanelUI.cs - Scripts/Util/UpdateModesPanelUI.cs - Scripts/Util/ObjectsVirtualParent.cs - Scripts/Util/GridView/CellGroupViewHolder.cs (was replaced with CellGroupViewsHolder.cs) - Scripts/Util/GridView/CellViewHolder.cs (was replaced with CellViewsHolder.cs) Important syntax changes & refactorings: - ScrollRectItemsAdapter8.InitOrUpdateViewHolder was renamed to UpdateViewsHolder and it guarantees (if you respect the adapter's lifecycle) that the newOrRecycled.root is not null. Here you are not needed to instantiate the prefab anymore, only update its views. - ScrollRectItemsAdapter8.CreateViewsHolder was added. Here the view holder instance is created, the prefab is instantiated etc. (see the example scenes) - GridAdapter.UpdateCellViewHolder was renamed to GridAdapter.UpdateCellViewsHolder General, must-know code changes: - added 2 Init methods in AbstractViewHolder to ease the view holder creation & initialization in ScrollRectItemsAdapter8.CreateViewsHolder() callback. These remove the need to manually instantiate the prefab, assign the viewholder's itemIndex, call CollectViews() on it etc. ScrollRectItemsAdapter8: - added ItemsRefreshed event that has 2 ints params: first is the old count, and the second is the new count - added VisibleItemsCount - removed VisibleItemsCopy property, because it's not efficient to create a list each time. Instead, GetItemViewsHolder(int viewHolderIndex) was added together with VisibleItemsCount to allow iterating through the visible items - Init(): calling Dispose here, if the previous value of _Params is not null (i.e. the adapter is re-used). Although it wasn't intensively tested, since it's easier to just reload the entire scene or at least destroy the scroll view & re-instantiate it (a prefab can be used for it) - Added Refresh() that just calls ChangeItemsCountTo(), which is equivalent to a refresh. - Added 3rd parameter to ScrollTo and SmoothScrollTo which gives maximum flexibility in terms of how far do you want the target item to be relative to the viewport's start edge - Removed GetItemNormalizedOffsetFromParentStart_NotAccurate() - Dispose(): actually releasing all the resources. Destroying all cached recyclable items & the visible ones, setting count to 0, setting _Params to null etc. - renamed InitOrUpdateItemViewHolder to UpdateViewsHolder, since now CreateViewsHolder() takes care of the creation. - added abstract CreateViewsHolder() which you must override to create the viewholder (which is no more done in InitOrUpdateItemViewHolder()) - added ClearCachedRecyclableItems(), ClearVisibleItems(), which destroys the respective items & sets their count to 0 - renamed InternalParams to InternalState & _InternalParams field to _InternalState. Bugfixes: - small issue with spacing in GridAdapter ScrollRectItemsAdapter8: - added _SmoothScrollCoroutine field to keep track of whether the ScrollTo is playing or not, in order to reject any new ScrollTo request during the execution of another - all the cached recyclable items & the visible ones are destroyed & their corresponding arrays are cleared when the items count changes to 0, thus most probably indicating that the user wants the scrollview to be cleared. PENDING for v3.0: -adding a "Lite" optimizer script capable to handle common use-scenarios and that will require only a few lines of code to be written by you - the main setup will be done in inspector. option for automatic json parsing may be also added, apart from the standard way of having a model class that stores the info about each item. UPDATE 28.04.2017 - v2.4: - added support for grid-like layouts in simple scenarios via the new GridAdapter utility class. GridExample.cs shows exactly how it's used. A scene grid_example.unity was also added to demo the feature. - added comfortable scene navigation between the examples, so you can test them all at once during runtime - major bugfix for the 'example.unity' scene: the FPS drop for some unity versions was due the non-optimized panel being in the same scene with the optimized one. Now there are 2 separate sub-scenes for the main example. 5.2.5f1, 5.4.1f1, 5.4.2f2, 5.4.3f1 are no more causing issues. Also, the asset was always working with these versions, only that 'example.unity' scene was slow. UPDATE 06.04.2017 - v2.3: - added item looping feature (useful for things like spinners). A new scene was added for this and the possibility to navigate to it and back from the main scene("example.unity"). The feature can be enabled by setting BaseParams.loopItems=true - minor bugfixes - major bugfixes (done in post-v2.2 updates, but not mentioned) UPDATE 24.01.2017 - v2.2: the biggest update so far: -ScrollTo() method: self-explanatory; -SmoothScrollTo() method: same as above, but it uses an internal Coroutine to animate the movement. scroll time can be provided, as well as an "onDone" callback; -RequestChangeItemSize() method: allows you to request a new height/width for a specific item if it's visible - this can optionally be done for consecutive frames in order to obtain an expand/collapse animation, which is very common; -added support for manually requesting a size change for a specific item, if it's visible (commonly needed for an expand/collapse animation) -added ScrollTo that snaps the scrollview so that the requested item is at the top -added SmoothScrollTo that can have the animation's duration adjustable and a callback can be provided for receiving updates for each animation step and the possibility of canceling it -IMPORTANT: using params to set spacing/padding. Using a LayoutGroup for this is no longer supported (should be an easy migration, though) -possibility to run visibility computations each frame via a MonoBehaviour.Update OR only when OnScroll event triggers OR in both cases -added a simple fps counter in top-left -added ExpandOnClick utility script in the example scenes (items now expand/shrink when clicked) -added ScrollbarFixer8 in the example scenes, a very handy utility that preserves the ScrollView's inertia regardless of the content's size (this is a bug with Unity itself) + autohide/hide-when-not-needed functionalities as a bonus -not destroying any objects, unless ChangeItemCountTo is called -bugfix: changing item count to 0 acted weird -bugfix: "teleporting" the scrollbar put items slightly outside content panel for horizontal ScrollViews when large data sets were used -improved the way an item's size changes dynamically when large data sets are used - added WebGL demo and updated the demo APK -other important optimizations -fixed a major bug occurring when using items of different sizes -fixed a lot of minor bugs -added much more comments and 'repaired' some of them -updated documentation UPDATE 03.12.2016 - v2.1: huge improvements. There was more than one update prior the current one(as we received a lot of features requests by email in the meantime). The link is the same. Check it to see the entire change log, but here are a few of the changes: - source files released - got rid of the DLL - auto-adapting for screen changes (size/orientation) - added simple_tutorial.unity scene with a much simpler version of the example scene (also used for the tutorial video) -fixed top/bottom padding not working properly UPDATE 27.08.2016 - v2.0: Hey guys, happy to announce V2.0 is out, improved and with horizontal scrolling support Additional changes in v 2.0 - compatible with CanvasScaler