balysv / material-ripple

Android L Ripple effect wrapper for Views
Apache License 2.0
2.36k stars 479 forks source link

Could not find a parent AdapterView #45

Open birijan opened 9 years ago

birijan commented 9 years ago

I'm frequently getting exception below while using material-ripple, usually while resuming the app. Can you please check it out and let me know how to ignore such exception.

Thanks in advance.

E/AndroidRuntime(29863): java.lang.RuntimeException: Could not find a parent AdapterView
E/AndroidRuntime(29863):    at com.balysv.materialripple.MaterialRippleLayout.findParentAdapterView(MaterialRippleLayout.java:409)
E/AndroidRuntime(29863):    at com.balysv.materialripple.MaterialRippleLayout.adapterPositionChanged(MaterialRippleLayout.java:423)
E/AndroidRuntime(29863):    at com.balysv.materialripple.MaterialRippleLayout.draw(MaterialRippleLayout.java:474)
E/AndroidRuntime(29863):    at android.view.View.updateDisplayListIfDirty(View.java:14167)
balysv commented 9 years ago

If using app:mrl_rippleInAdapter="true" // if true, MaterialRippleLayout will optimize for use in AdapterViews, there must be an AdapterView in the parent hierarchy of MaterialRippleLayout, otherwise this exception is thrown.

Set app:mrl_rippleInAdapter="false" or check your view hierarchy. Note that RecyclerView is not an AdapterView

crearo commented 8 years ago

This exception is thrown when the MRL exists inside the XML of an included element. That shouldnt happen.