Giter Site home page Giter Site logo

Comments (8)

TakuSemba avatar TakuSemba commented on June 5, 2024

you mean you got a crash when you run my sample app?

from multisnaprecyclerview.

encouver avatar encouver commented on June 5, 2024

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.

TakuSemba avatar TakuSemba commented on June 5, 2024

can i see the code where the error happens??

from multisnaprecyclerview.

encouver avatar encouver commented on June 5, 2024

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.

TakuSemba avatar TakuSemba commented on June 5, 2024

Thank you for the code!! I'll look into it. give me a few days.

from multisnaprecyclerview.

TakuSemba avatar TakuSemba commented on June 5, 2024

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.

encouver avatar encouver commented on June 5, 2024

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.

TakuSemba avatar TakuSemba commented on June 5, 2024

thanks

from multisnaprecyclerview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.