You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases CardSliderTransformer#scalingEquation doesn't return valid Float.
// gives position NaN in some casesoverridefuntransformPage(page:View, position:Float)
The following line throws an error when trying to assign NaN as elevation.
// This will be during transformation
(page asCardView).cardElevation =
scalingEquation(viewPager.minShadow, viewPager.baseShadow, absPosition)
privatefunscalingEquation(minValue:Float, maxValue:Float, absPosition:Float) =
(minValue - maxValue) * absPosition + maxValue
Stacktrace as per the Logcat
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.taglr.debug, PID: 5855
java.lang.IllegalArgumentException: Cannot set 'elevation' to Float.NaN
at android.view.View.sanitizeFloatPropertyValue(View.java:17041)
at android.view.View.sanitizeFloatPropertyValue(View.java:17015)
at android.view.View.setElevation(View.java:17137)
at androidx.cardview.widget.CardViewApi21Impl.setElevation(CardViewApi21Impl.java:78)
at androidx.cardview.widget.CardView.setCardElevation(CardView.java:376)
at com.github.islamkhsh.CardSliderTransformer.transformPage(CardSliderTransformer.kt:40)
at androidx.viewpager.widget.ViewPager.onPageScrolled(ViewPager.java:1915)
at androidx.viewpager.widget.ViewPager.pageScrolled(ViewPager.java:1842)
at androidx.viewpager.widget.ViewPager.scrollToItem(ViewPager.java:694)
at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1786)
at android.view.View.layout(View.java:22509)
at android.view.ViewGroup.layout(ViewGroup.java:7190)
at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1915)
at android.view.View.layout(View.java:22509)
at android.view.ViewGroup.layout(ViewGroup.java:7190)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:22509)
at android.view.ViewGroup.layout(ViewGroup.java:7190)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.layoutDecoratedWithMargins(RecyclerView.java:9555)
at androidx.recyclerview.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:690)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:170)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4115)
at androidx.recyclerview.widget.RecyclerView.onMeasure(RecyclerView.java:3521)
at android.view.View.measure(View.java:25056)
at androidx.constraintlayout.widget.ConstraintLayout.internalMeasureChildren(ConstraintLayout.java:1227)
at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(ConstraintLayout.java:1572)
at android.view.View.measure(View.java:25056)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7745)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at androidx.cardview.widget.CardView.onMeasure(CardView.java:260)
at android.view.View.measure(View.java:25056)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.measureChildWithMargins(RecyclerView.java:9352)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1653)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at androidx.recyclerview.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1391)
at androidx.recyclerview.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1128)
at androidx.recyclerview.widget.RecyclerView.scrollStep(RecyclerView.java:1855)
at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5281)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:988)
at android.view.Choreographer.doCallbacks(Choreographer.java:765)
at android.view.Choreographer.doFrame(Choreographer.java:697)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:967)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7285)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
The text was updated successfully, but these errors were encountered:
omtodkar
pushed a commit
to omtodkar/CardSlider
that referenced
this issue
Oct 7, 2019
In some cases
CardSliderTransformer#scalingEquation
doesn't return valid Float.The following line throws an error when trying to assign NaN as elevation.
Stacktrace as per the Logcat
The text was updated successfully, but these errors were encountered: