AligningRecyclerView
master
Download
Gradle
repositories {
maven {
url "https://jitpack.io"
}
}
compile 'com.github.stoyicker:aligningrecyclerview:(insert latest version)'
Maven
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url> </repository> <dependency>
<groupId>com.github.stoyicker</groupId>
<artifactId>aligningrecyclerview</artifactId>
<version>(insert latest version)</version> </dependency>
Compatible with API 9 and higher.
Pull requests are welcome. See the guidelines for contributing.
Usage
Just replace your RecyclerViews with AlignRecyclerViews and you're good to go!
ProGuard
No additional configuration is required.
I can't touch slave views until they're idle. Please fix!
First of all, note that this behavior is intended and not going to be fixed. You can only scroll an AligningRecyclerView manually if it is not scrolling or is scrolling because you manually requested so (rather than because of following another AligningRecyclerView). This said, let's take a look at why:
- Case 1: Trying to scroll an AligningRecyclerView that is bound to another one where a scrolling was initiated with a two-way binding: This case would pop an infinite mutual notification between the views, which is obviously not desirable.
- Case 2: Trying to scroll an AligningRecyclerView that is bound to another one where a scrolling was initiated with a one-way binding: This case can be solved in extremely different ways (like breaking the binding on touch, breaking it and re-adding it later), so I prefer to default to what I consider the simplest one. You are free to override OnScrollListenerManagerOnItemTouchListener (which is public for this purpose) and make your adjustments:
if (rv.getScrollState() != RecyclerView.SCROLL_STATE_IDLE) {
...
}
License
AligningRecyclerView (c) by Jorge Antonio Diaz-Benito Soriano
AligningRecyclerView is licensed under a Creative Commons Attribution 4.0 International License.
You should have received a copy of the license along with this work. If not, see http://creativecommons.org/licenses/by/4.0/.
Open source licenses: See THIRD_PARTY.md