Comments (8)
you mean you got a crash when you run my sample app?
from multisnaprecyclerview.
The sample run flawlessly.
It's in my app that is showing the error at runtime just in the starting of the app.
The library is included in the gradle file, and the tags are just a copy paste of your sample app.
from multisnaprecyclerview.
can i see the code where the error happens??
from multisnaprecyclerview.
Fragment:
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
final View rootView = inflater.inflate(R.layout.fragment_mapa_nc, container, false);
.
.
.
LinearLayoutManager managerProductos = new LinearLayoutManager(rootView.getContext(), LinearLayoutManager.HORIZONTAL, false);
recyclerViewProductos.setLayoutManager(managerProductos);
LinearLayoutManager managerServicios = new LinearLayoutManager(rootView.getContext(), LinearLayoutManager.HORIZONTAL, false);
recyclerViewProductos.setLayoutManager(managerServicios);
.
.
.
return rootView;
}
After the onCreateView return, shows the error in the StackTrace
Gradle:
compile "com.github.takusemba:multisnaprecyclerview:1.0.2"
Layout with the issue:
<!-- A RecyclerView with some commonly used attributes -->
<android.support.v7.widget.RecyclerView
android:id="@+id/vistaListaPro"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:padding="2dp"
android:layout_height="match_parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="Productos"
android:textSize="16sp" />
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="@+id/recyclerViewPr"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_snap_count="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:text="Servicios"
android:textSize="16sp" />
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView
android:id="@+id/recyclerViewSe"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
app:msrv_gravity="start"
app:msrv_snap_count="1" />
StackTrace:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.zzzzz.xx, PID: 29758
java.lang.IllegalArgumentException: other than LinearLayoutManger is not supported
at com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView.onAttachedToWindow(MultiSnapRecyclerView.java:48)
at android.view.View.dispatchAttachedToWindow(View.java:17184)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3289)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1657)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1385)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6722)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:886)
at android.view.Choreographer.doCallbacks(Choreographer.java:698)
at android.view.Choreographer.doFrame(Choreographer.java:633)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:872)
at android.os.Handler.handleCallback(Handler.java:769)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6540)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
08-16 04:06:23.672 29758-29758/com.zzzzz.xxE/UncaughtException: java.lang.IllegalArgumentException: other than LinearLayoutManger is not supported
at com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView.onAttachedToWindow(MultiSnapRecyclerView.java:48)
at android.view.View.dispatchAttachedToWindow(View.java:17184)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3289)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3296)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1657)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1385)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6722)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:886)
at android.view.Choreographer.doCallbacks(Choreographer.java:698)
at android.view.Choreographer.doFrame(Choreographer.java:633)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:872)
at android.os.Handler.handleCallback(Handler.java:769)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6540)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
from multisnaprecyclerview.
Thank you for the code!! I'll look into it. give me a few days.
from multisnaprecyclerview.
it seems like recyclerView doesn't have a layoutManager at the point where you return view in onCreateView
can you check if the recyclerView has a layoutManager at the end of onCreateView by simplely printing recyclerView.getLayoutManager?
from multisnaprecyclerview.
The error was that I had two layoutManagers and the second was not initialized, it was something I didn't realize until now. It was a copy and paste and not checking.
LinearLayoutManager managerProductos = new LinearLayoutManager(rootView.getContext(), LinearLayoutManager.HORIZONTAL, false);
recyclerViewProductos.setLayoutManager(managerProductos);
LinearLayoutManager managerServicios = new LinearLayoutManager(rootView.getContext(), LinearLayoutManager.HORIZONTAL, false);
recyclerViewServicios.setLayoutManager(managerServicios);
I'm closing this issue.
from multisnaprecyclerview.
thanks
from multisnaprecyclerview.
Related Issues (20)
- it is not available to set item which i want to set in center HOT 3
- The rolling speed is too slow, can you adjust the rolling speed? HOT 1
- Backward scrolling sometimes snaps twice HOT 9
- A warning appear. HOT 2
- Set snapGravity programmatically HOT 1
- Snap Programatically HOT 3
- How to center the visible items afte snapping/ HOT 1
- Any idea how to handle screen orientation? HOT 1
- snap last item with ItemDecoration HOT 8
- Not able to show last item with gravity start HOT 1
- Alternatives to msrv_speed_ms_per_inch HOT 3
- Hi, thank you for the request. HOT 1
- New Feature as requirement HOT 5
- The application may be doing too much work on its main thread. HOT 1
- Richiejack32 HOT 1
- >for me
- Version 1.1.0 released, but code here shows it's 1.0.3 HOT 3
- Is it possible to snap every X views? HOT 2
- It's not available to fragment? HOT 5
- java.lang.IllegalArgumentException: other than LinearLayoutManger is not supported 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 multisnaprecyclerview.