Animations and Performance in Nested RecyclerViews

This page summarizes the projects mentioned and recommended in the original post on /r/RedditEng

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • flexbox-layout

    Flexbox for Android

  • In order to properly encapsulate the reaction view logic, we created a class that extends RecyclerView and has a bind method that takes in the list of reactions and updates the RecyclerView’s adapter with that list. Given that we had to support a multi-line layout, we initially looked into using GridLayoutManager to achieve this but ended up finding an open-source library by Google named flexbox-layout that provides a LayoutManager that supports laying out items in multiple flex-rows, which is exactly what we needed. Using these ingredients, we were able to get a simple version of our layout up and running. What’s next was adding custom animations and improving performance.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • recyclerview-animators

    An Android Animation library which easily add itemanimator to RecyclerView items.

  • Next, we looked at overriding SimpleItemAnimator but noticed that this class is missing a lot of logic required for orchestrating the animations. We realized that the Android SDK does not really allow us to easily customize RecyclerView item animations - what a shame! Doing some research on this we found two open-source libraries (here and here - note: this is no endorsement) that provide a variety of custom ItemAnimators by using a base ItemAnimator implementation that is very similar to the DefaultItemAnimator class but allows for proper customization. We ended up creating our own BaseItemAnimator by looking at DefaultItemAnimator and adapting it to our needs and then creating the actual implementation for the reaction feature. This allowed us to customize the “Add” animation like so:

  • ItemAnimators

    ItemAnimators: Supercharged Animators for your RecyclerView

  • Next, we looked at overriding SimpleItemAnimator but noticed that this class is missing a lot of logic required for orchestrating the animations. We realized that the Android SDK does not really allow us to easily customize RecyclerView item animations - what a shame! Doing some research on this we found two open-source libraries (here and here - note: this is no endorsement) that provide a variety of custom ItemAnimators by using a base ItemAnimator implementation that is very similar to the DefaultItemAnimator class but allows for proper customization. We ended up creating our own BaseItemAnimator by looking at DefaultItemAnimator and adapting it to our needs and then creating the actual implementation for the reaction feature. This allowed us to customize the “Add” animation like so:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • How do you make your grid recyclerview items fit with different screen sizes?

    1 project | /r/androiddev | 24 Jan 2023
  • Am I the only one that feels Compose is a step backward?

    2 projects | /r/androiddev | 18 Jan 2022
  • Is it obligatory to use sp?

    1 project | /r/Kotlin | 6 Nov 2021
  • New to iOS dev, how do I create something similar to flexbox layout (from Android) in SwiftUI?

    1 project | /r/iosdev | 31 Oct 2021
  • Example where Flow widget in ConstraintLayout shines

    1 project | /r/android_devs | 24 Mar 2021