flexbox-layout
ItemAnimators
Our great sponsors
flexbox-layout | ItemAnimators | |
---|---|---|
6 | 1 | |
18,153 | 339 | |
0.1% | - | |
0.0 | 10.0 | |
about 1 year ago | almost 4 years ago | |
Kotlin | Java | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
flexbox-layout
-
Animations and Performance in Nested RecyclerViews
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.
-
Am I the only one that feels Compose is a step backward?
You could use FlexBoxLayout, though that's for the old system.
ItemAnimators
-
Animations and Performance in Nested RecyclerViews
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:
What are some alternatives?
android-flowlayout - Linear layout, that wrap its content to the next line if there is no space in the current line.
android-gridlayout - A backwards compatible implementation of GridLayout for Android
MultiLineRadioGroup - Multi Line Radio Group is a Radio Group layout to show radio buttons in more than one line.
FlowLayout - Android implementation of FlowLayout. Layout arranges its children in multiple rows depending on their width.
android-linear-layout-manager - Linear Layout Manager which supports WRAP_CONTENT
DragLinearLayout - Android LinearLayout with drag and drop to reorder.
SmartRefreshLayout - 🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
FlycoTabLayout - An Android TabLayout Lib
Android Accordion Swipe Layout - Accordion Swipe Layout for Android
Scrollable - Android scrollable tabs
FoldingCell - :octocat: 📃 FoldingCell is a material design expanding content cell inspired by folding paper material made by @Ramotion
melonDS-android - Android port of melonDS