Past Activities

As part of our gradual closure of the old 2D, UniWebView parts of the app, I recently brought the Past Activities page over into Unity. As the name might suggest, it’s a scrollable list of the user’s past activities, which they can hover over and open up. A few things to touch on with this:

  • Optimised ScrollView Adapter.
    • The list makes use of the Optimised ScrollView Adapter asset from the asset store, which implements object pooling for scrollview components. As the user scrolls, the list elements are seamlessly recycled and repurposed, creating the illusion of being able to scroll through hundreds of list elements when in reality we’ve only ever instantiated 8.
    • This drastically improves performance since it means A) fewer Instantiate calls, and B) small, manageable scrollview hierarchies.
    • The asset takes a bit of setup and getting used to but has since become a bit of a favourite. I’ve previously used this for Sumdog’s coin ledger, which lets the user scroll through a potentially long list of entries about how they received and spent coins.
  • DOTween.
    • I’m a bit of a DOTween fan tbh, as they massively simplify a lot of things, particularly polish-y touches. I’m using them for the various list elements so that when the user hovers over them they scale up slightly and when they hover off them they scale back down. I’m also using them for popups here and elsewhere in the app, so that rather than setting the popup to active I have it quickly scale up from 0 to 1. I think I also settled on setting the ease to one of the elastic ones (I believe easeOutElastic as visualised here), just to give it a bit of punch when it appears.
  • Asset Bundles.
    • The whole interface and scene is contained in an asset bundle hosted in an AWS S3 bucket, keeping the main app and initial download light for users.
    • This way, only those users who are interested in seeing their past activities need to download the assets required for it.