RecyclerViewItemAnimators
An Android library which provides simple Item animations to RecyclerView items
Top Related Projects
An Android Animation library which easily add itemanimator to RecyclerView items.
一款支持上下拉刷新、越界回弹、二级刷新、横向刷新、拉伸回弹、平滑滚动、嵌套滚动的多功能刷新控件
:octocat: ≡ GarlandView seamlessly transitions between multiple lists of content. Made by @Ramotion
Phoenix Pull-to-Refresh
BRVAH:Powerful and flexible RecyclerAdapter
Quick Overview
RecyclerViewItemAnimators is a GitHub repository that provides a collection of custom item animators for RecyclerView in Android. It offers various animation effects for adding, removing, and moving items within a RecyclerView, enhancing the user experience with smooth and visually appealing transitions.
Pros
- Offers a wide range of pre-built animation effects for RecyclerView items
- Easy to implement and integrate into existing Android projects
- Customizable animations allow for fine-tuning of effects
- Improves the overall user experience with smooth transitions
Cons
- May introduce performance overhead for large lists or complex animations
- Some animations might not be suitable for all types of content or app designs
- Limited documentation and examples for advanced customization
- Not actively maintained (last update was in 2018)
Code Examples
- Adding a simple scale animation:
val animator = ScaleInAnimator()
recyclerView.itemAnimator = animator
- Implementing a slide-in animation from the right:
val animator = SlideInRightAnimator()
animator.addDuration = 300
recyclerView.itemAnimator = animator
- Combining multiple animations:
val animator = SlideInOutBottomAnimator()
animator.addDuration = 300
animator.removeDuration = 300
animator.moveDuration = 300
recyclerView.itemAnimator = animator
Getting Started
To use RecyclerViewItemAnimators in your Android project:
- Add the dependency to your app's
build.gradle
file:
dependencies {
implementation 'com.github.gabrielemariotti.recyclerview:recyclerview-animators:0.3.0@aar'
}
- In your activity or fragment, set the desired animator to your RecyclerView:
import it.gmariotti.recyclerview.adapter.SlideInLeftAnimator
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val recyclerView = findViewById<RecyclerView>(R.id.recycler_view)
recyclerView.itemAnimator = SlideInLeftAnimator()
}
}
This will apply the SlideInLeftAnimator to your RecyclerView, causing new items to slide in from the left when added to the list.
Competitor Comparisons
An Android Animation library which easily add itemanimator to RecyclerView items.
Pros of recyclerview-animators
- More comprehensive set of animations, including fade, scale, slide, and flip
- Easier integration with custom item decorations
- Better documentation and examples
Cons of recyclerview-animators
- Slightly more complex API for custom animations
- May have a minor performance impact with large datasets
- Less frequent updates and maintenance
Code Comparison
RecyclerViewItemAnimators:
recyclerView.setItemAnimator(new SlideInOutLeftAnimator());
recyclerview-animators:
recyclerView.setItemAnimator(new SlideInLeftAnimator());
recyclerView.getItemAnimator().setAddDuration(300);
recyclerView.getItemAnimator().setRemoveDuration(300);
Both libraries provide easy-to-use animations for RecyclerView items. RecyclerViewItemAnimators offers a simpler API for basic animations, while recyclerview-animators provides more customization options and a wider range of pre-built animations.
recyclerview-animators is generally more feature-rich and actively maintained, making it a better choice for projects requiring diverse animation options. However, RecyclerViewItemAnimators may be preferable for simpler use cases or when minimizing dependencies is a priority.
Ultimately, the choice between these libraries depends on the specific requirements of your project, such as the complexity of animations needed and the importance of ongoing library maintenance.
一款支持上下拉刷新、越界回弹、二级刷新、横向刷新、拉伸回弹、平滑滚动、嵌套滚动的多功能刷新控件
Pros of SmoothRefreshLayout
- Offers a more comprehensive solution for pull-to-refresh functionality
- Supports both vertical and horizontal refresh layouts
- Provides a wider range of customization options for refresh animations
Cons of SmoothRefreshLayout
- More complex implementation due to its extensive features
- Larger library size, which may impact app performance
- Steeper learning curve for developers new to the library
Code Comparison
SmoothRefreshLayout:
SmoothRefreshLayout refreshLayout = findViewById(R.id.refresh_layout);
refreshLayout.setOnRefreshListener(new RefreshingListenerAdapter() {
@Override
public void onRefreshing() {
// Perform refresh operation
}
});
RecyclerViewItemAnimators:
RecyclerView recyclerView = findViewById(R.id.recycler_view);
recyclerView.setItemAnimator(new SlideInUpAnimator());
SmoothRefreshLayout provides a more feature-rich solution for implementing pull-to-refresh functionality, offering extensive customization options and support for both vertical and horizontal layouts. However, it comes with increased complexity and a larger library size.
RecyclerViewItemAnimators focuses specifically on item animations for RecyclerView, providing a simpler implementation for adding animations to list items. It's more lightweight and easier to integrate, but lacks the comprehensive refresh functionality of SmoothRefreshLayout.
Choose SmoothRefreshLayout for advanced refresh capabilities and customization, or RecyclerViewItemAnimators for simpler item animations in RecyclerView implementations.
:octocat: ≡ GarlandView seamlessly transitions between multiple lists of content. Made by @Ramotion
Pros of garland-view-android
- Offers a unique and visually appealing UI component for displaying scrollable lists
- Provides a more immersive and interactive user experience
- Includes built-in animations and transitions for smooth scrolling
Cons of garland-view-android
- More complex implementation compared to RecyclerViewItemAnimators
- Limited to a specific visual style, which may not fit all app designs
- Potentially higher performance overhead due to advanced animations
Code Comparison
garland-view-android:
val garlandView = findViewById<GarlandView>(R.id.garland_view)
garlandView.setAdapter(GarlandAdapter(itemsList))
garlandView.setOnItemClickListener { position -> /* Handle click */ }
RecyclerViewItemAnimators:
val recyclerView = findViewById<RecyclerView>(R.id.recycler_view)
recyclerView.itemAnimator = SlideInOutLeftAnimator()
recyclerView.adapter = MyAdapter(itemsList)
RecyclerViewItemAnimators focuses on providing various animation options for standard RecyclerView items, while garland-view-android offers a complete custom view with its own unique scrolling and animation behavior. RecyclerViewItemAnimators is more flexible and can be easily integrated into existing RecyclerView implementations, whereas garland-view-android provides a specific, eye-catching UI component that may require more significant changes to the app's design and structure.
Phoenix Pull-to-Refresh
Pros of Phoenix
- Offers a unique pull-to-refresh animation with a sun and water droplet effect
- Provides a more visually appealing and engaging user experience
- Easy to implement and customize for different app themes
Cons of Phoenix
- Limited to pull-to-refresh functionality, less versatile than RecyclerViewItemAnimators
- May not be suitable for apps requiring a more professional or minimalist design
- Potentially higher resource consumption due to complex animations
Code Comparison
Phoenix implementation:
val pullToRefreshView = findViewById<PullToRefreshView>(R.id.pull_to_refresh)
pullToRefreshView.setOnRefreshListener {
// Refresh logic here
pullToRefreshView.setRefreshing(false)
}
RecyclerViewItemAnimators implementation:
val recyclerView = findViewById<RecyclerView>(R.id.recycler_view)
recyclerView.itemAnimator = SlideInOutLeftAnimator()
Summary
Phoenix focuses on providing a visually striking pull-to-refresh animation, while RecyclerViewItemAnimators offers a variety of item animations for RecyclerViews. Phoenix is ideal for apps seeking a unique and engaging refresh experience, whereas RecyclerViewItemAnimators is more suitable for apps requiring diverse and customizable item animations within lists or grids.
BRVAH:Powerful and flexible RecyclerAdapter
Pros of BaseRecyclerViewAdapterHelper
- More comprehensive feature set, including drag & drop, swipe, and load more functionality
- Larger community and more frequent updates
- Simplified adapter creation with less boilerplate code
Cons of BaseRecyclerViewAdapterHelper
- Steeper learning curve due to more complex API
- Potentially higher memory footprint for simple use cases
- May introduce unnecessary dependencies for projects requiring only basic RecyclerView functionality
Code Comparison
RecyclerViewItemAnimators:
RecyclerView.ItemAnimator itemAnimator = new SlideInOutLeftItemAnimator(recyclerView);
recyclerView.setItemAnimator(itemAnimator);
BaseRecyclerViewAdapterHelper:
public class MyAdapter extends BaseQuickAdapter<MyItem, BaseViewHolder> {
public MyAdapter(List<MyItem> data) {
super(R.layout.item_layout, data);
}
@Override
protected void convert(BaseViewHolder helper, MyItem item) {
helper.setText(R.id.title, item.getTitle());
}
}
RecyclerViewItemAnimators focuses solely on item animations, providing a simple way to add custom animations to RecyclerView items. BaseRecyclerViewAdapterHelper, on the other hand, offers a more comprehensive solution for RecyclerView management, including simplified adapter creation, item animations, and additional features like drag & drop and load more functionality.
While RecyclerViewItemAnimators is lightweight and easy to implement for basic animation needs, BaseRecyclerViewAdapterHelper provides a more robust toolkit for complex RecyclerView implementations at the cost of a steeper learning curve and potentially unnecessary features for simpler projects.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
RecyclerViewItemAnimators Library
This repo provides:
- Appearance animations
- Simple animators for the item views
Quick start
You can now download it from Sonatype's snapshots repo.
-
Add the snapshots repo to your
build.gradle
repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } }
-
Add build dependency
dependencies { compile 'com.github.gabrielemariotti.recyclerview:recyclerview-animators:0.3.0-SNAPSHOT@aar' }
Feature
These animators work with the RecyclerView
provided by Google with the support library com.android.support:recyclerview-v7:23.1.1
.
Appearance animations: which work when loading on the screen or when scrolling
- Alpha
- SlideInLeft
- SlideInRight
- SlideInBottom
- ScaleIn
Simple Animators: cloned from DefaultItemAnimator
provided by Google customizing the animations.
This part is still in beta.
- SlideInOutLeftItemAnimator : which applies a slide in/out from/to the left animation
- SlideInOutRightItemAnimator : which applies a slide in/out from/to the right animation
- SlideInOutTopItemAnimator : which applies a slide in/out from/to the top animation
- SlideInOutBottomItemAnimator : which applies a slide in/out from/to the bottom animation
- ScaleInOutItemAnimator : which applies a scale animation
- SlideScaleInOutRightItemAnimator : which applies a scale animation with a slide in/out from/to the right animation
Quick example:
Appearance animations:
mAdapter = new MyAdapter(this);
AlphaAnimatorAdapter animatorAdapter = new AlphaAnimatorAdapter(mAdapter, mRecyclerView);
mRecyclerView.setAdapter(animatorAdapter);
Simple Animators:
mRecyclerView.setItemAnimator(new SlideInOutLeftItemAnimator(mRecyclerView));
NOTE: Feedbacks and patches are welcome!
The sample app uses all features available in the widget.
ChangeLog
- Changelog: A complete changelog
Acknowledgements
- Thanks to Niek Haarman for some ideas and code taken from his ListViewAnimations.
Credits
Author: Gabriele Mariotti (gabri.mariotti@gmail.com)
License
Copyright 2014-2015 Gabriele Mariotti
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Top Related Projects
An Android Animation library which easily add itemanimator to RecyclerView items.
一款支持上下拉刷新、越界回弹、二级刷新、横向刷新、拉伸回弹、平滑滚动、嵌套滚动的多功能刷新控件
:octocat: ≡ GarlandView seamlessly transitions between multiple lists of content. Made by @Ramotion
Phoenix Pull-to-Refresh
BRVAH:Powerful and flexible RecyclerAdapter
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot