Comments (10)
@wching you're killing it! Thanks so much.
That's why I wasn't able to replicate, locally I've been experimenting with the most up to date version of the library. Will be good to know for future reference that often I'll need to drop my versioning down to ensure I'm checking older versions.
@mansigoel94 please let me know if updating to 1.0.6 works!
from android-indefinite-pager-indicator.
Great catch, thanks. I'll check this out in depth soon and have a fix before long.
from android-indefinite-pager-indicator.
@mansigoel94 would you mind sending me the XML layout file that is causing the error? I'm trying to recreate this on my side and I am unable to by just setting the recyclerview's root view layout_margin
to an arbitrary value.
from android-indefinite-pager-indicator.
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
**android:layout_margin="8dp"** (here layout largin would not cause any problem)
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
/>
<com.rbrooks.indefinitepagerindicator.IndefinitePagerIndicator
android:id="@+id/recyclerview_pager_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp" (Here also margin would run just fine)
app:dotColor="@android:color/black"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/rv_top_search"
app:selectedDotColor="@color/colorAccent" />
</android.support.constraint.ConstraintLayout>
But in another layout where you define recycler view items then in rootview margin would break code
example:
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"> (this line would cause code to break.... Also margin_top, margin_bottom and margin_Right would run perfectly, only margin left doesn't)
<ImageView
android:id="@+id/iv_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY"
app:layout_constraintEnd_toEndOf="parent" />
</android.support.constraint.ConstraintLayout>
from android-indefinite-pager-indicator.
Unfortunately, I still haven't been able to recreate the bug on my end. I added the layout_margin
to both the RecyclerView's rootview and the view item's root view and it still is working normally for me.
Upon further inspection of the stacktrace, it seems that this line is the actual bug:
Caused by: java.lang.IllegalStateException: An instance of OnFlingListener already set.
Are you setting an OnFlingListener in your code where you setup your recyclerview? Or are you calling recyclerView.setOnScrollListener(scrollListener)
rather than recyclerView.addOnScollListener(scrollListener)
? If so, this could be the issue as it would likely be overriding the IndefinitePagerIndicator's internal onScrollListener that's used to update the indicator.
from android-indefinite-pager-indicator.
@mansigoel94 any update on this? I'm going to close the issue if my comment above is the overall issue.
from android-indefinite-pager-indicator.
No I haven't used any ScrollListener or FlingListener and this error is still reproducible on my machine. I will share sample project with you.
from android-indefinite-pager-indicator.
https://github.com/mansigoel94/Library-Issue.git.
Check this code, I have added one todo for you where 'layout-margin' is causing library to crash
from android-indefinite-pager-indicator.
@mansigoel94 based on the code you shared, I can see that you are using version 1.0.3 and indeed the crash happens because null is getting to the RecyclerView's
findContainingItemView(View view)
method.
That was fixed by @rbro112 in this commit (line 268):
2311872
which was basically a fix released on version 1.0.4 🎉
So I think the solution to your bug will be updating to the latest version [ current is 1.0.6 ] of the library 😃
from android-indefinite-pager-indicator.
Looks like 1.0.6+ is the fix. Closing this issue!
from android-indefinite-pager-indicator.
Related Issues (20)
- There is no anti-aliasing on dot view. HOT 1
- Decouple From Concrete Classes HOT 4
- feature request HOT 2
- Support for Vertical Layout
- Indicator position HOT 6
- I love this pager indicator!!! Any chance it could support custom layout manager? HOT 2
- Missing file HOT 1
- Missing tests
- Programmatically customization HOT 4
- RecyclerView with reverseLayout enabled
- Indicator count HOT 1
- NPE when set ViewPager null (in java context) (version 1.0.9) HOT 3
- viewpager2 support HOT 1
- space between recycler view and indicator HOT 1
- Dependencies update! HOT 2
- I want to select 4 dots at a time
- Missing screenshot
- No transparent background when using Theme.MaterialComponents.Light.DarkActionBar HOT 1
- [suggestion]It will be useful if there is an "Orignal style" option HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-indefinite-pager-indicator.