ColorSeekBar icon indicating copy to clipboard operation
ColorSeekBar copied to clipboard

java.lang.IllegalArgumentException: width and height must be > 0 - vers.1.4.2

Open shineangelic opened this issue 6 years ago • 6 comments

I tried using version 1.4.3, but not resolving it. More recent version I can compile against is 1.4.2, that gives me this error. Switching back to 1.2.2, everything is fine. I make plain usage in XML:

<com.rtugeek.android.colorseekbar.ColorSeekBar android:id="@+id/colorSliderStop" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/stopLabel" app:colorSeeds="@array/t16_color_slider" />

shineangelic avatar Jul 11 '17 23:07 shineangelic

Please pardon me for responding so late. Can you show me the whole XML layout file? The width and height of the widget may be up to the parent element(Like LinearLayout, RelateLayout....).

rtugeek avatar Sep 16 '17 12:09 rtugeek

Getting this same error in 5.1. Same usage as example, I think I know where to fix. I can make a PR this weekend with a fix. It happens onSizeChanged . Also this only happens with a headless emulator. EDIT: Updating to 1.4.3 fixed it for me.

jlurena avatar Oct 07 '17 02:10 jlurena

Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap + 1143(Bitmap.java:1143) at android.graphics.Bitmap.createBitmap + 1110(Bitmap.java:1110) at android.graphics.Bitmap.createBitmap + 1060(Bitmap.java:1060) at android.graphics.Bitmap.createBitmap + 1021(Bitmap.java:1021) at com.rtugeek.android.colorseekbar.ColorSeekBar.onSizeChanged + 213(ColorSeekBar.java:213) at android.view.View.sizeChange + 21276(View.java:21276) at android.view.View.setFrame + 21237(View.java:21237) at android.view.View.layout + 21089(View.java:21089) at android.widget.LinearLayout.setChildFrame + 1828(LinearLayout.java:1828) at android.widget.LinearLayout.layoutVertical + 1656(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout + 1565(LinearLayout.java:1565) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.LinearLayout.setChildFrame + 1828(LinearLayout.java:1828) at android.widget.LinearLayout.layoutHorizontal + 1809(LinearLayout.java:1809) at android.widget.LinearLayout.onLayout + 1567(LinearLayout.java:1567) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.LinearLayout.setChildFrame + 1828(LinearLayout.java:1828) at android.widget.LinearLayout.layoutVertical + 1656(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout + 1565(LinearLayout.java:1565) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.FrameLayout.layoutChildren + 323(FrameLayout.java:323) at android.widget.FrameLayout.onLayout + 261(FrameLayout.java:261) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.LinearLayout.setChildFrame + 1828(LinearLayout.java:1828) at android.widget.LinearLayout.layoutVertical + 1656(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout + 1565(LinearLayout.java:1565) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.FrameLayout.layoutChildren + 323(FrameLayout.java:323) at android.widget.FrameLayout.onLayout + 261(FrameLayout.java:261) at android.widget.ScrollView.onLayout + 1606(ScrollView.java:1606) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.LinearLayout.setChildFrame + 1828(LinearLayout.java:1828) at android.widget.LinearLayout.layoutVertical + 1656(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout + 1565(LinearLayout.java:1565) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.FrameLayout.layoutChildren + 323(FrameLayout.java:323) at android.widget.FrameLayout.onLayout + 261(FrameLayout.java:261) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at androidx.constraintlayout.widget.ConstraintLayout.onLayout + 1915(ConstraintLayout.java:1915) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.FrameLayout.layoutChildren + 323(FrameLayout.java:323) at android.widget.FrameLayout.onLayout + 261(FrameLayout.java:261) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.LinearLayout.setChildFrame + 1828(LinearLayout.java:1828) at android.widget.LinearLayout.layoutVertical + 1656(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout + 1565(LinearLayout.java:1565) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.FrameLayout.layoutChildren + 323(FrameLayout.java:323) at android.widget.FrameLayout.onLayout + 261(FrameLayout.java:261) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.LinearLayout.setChildFrame + 1828(LinearLayout.java:1828) at android.widget.LinearLayout.layoutVertical + 1656(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout + 1565(LinearLayout.java:1565) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.widget.FrameLayout.layoutChildren + 323(FrameLayout.java:323) at android.widget.FrameLayout.onLayout + 261(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout + 883(DecorView.java:883) at android.view.View.layout + 21094(View.java:21094) at android.view.ViewGroup.layout + 6388(ViewGroup.java:6388) at android.view.ViewRootImpl.performLayout + 3360(ViewRootImpl.java:3360) at android.view.ViewRootImpl.performTraversals + 2811(ViewRootImpl.java:2811) at android.view.ViewRootImpl.doTraversal + 1839(ViewRootImpl.java:1839) at android.view.ViewRootImpl$TraversalRunnable.run + 8212(ViewRootImpl.java:8212) at android.view.Choreographer$CallbackRecord.run + 994(Choreographer.java:994) at android.view.Choreographer.doCallbacks + 806(Choreographer.java:806) at android.view.Choreographer.doFrame + 738(Choreographer.java:738) at android.view.Choreographer$FrameDisplayEventReceiver.run + 980(Choreographer.java:980) at android.os.Handler.handleCallback + 873(Handler.java:873) at android.os.Handler.dispatchMessage + 99(Handler.java:99) at android.os.Looper.loop + 226(Looper.java:226) at android.app.ActivityThread.main + 7183(ActivityThread.java:7183) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 576(RuntimeInit.java:576) at com.android.internal.os.ZygoteInit.main + 942(ZygoteInit.java:942)

nitinbhanderi35 avatar Sep 11 '19 12:09 nitinbhanderi35

@nitinbhanderi35 Can you show the java code and layout here, so that can help me diagnose this issue.

rtugeek avatar Sep 11 '19 13:09 rtugeek

@nitinbhanderi35 Can you show the java code and layout here, so that can help me diagnose this issue.

===> issue android os 9

<com.rtugeek.android.colorseekbar.ColorSeekBar android:id="@+id/sek_color" android:layout_width="match_parent" android:layout_height="@dimen/_60sdp" android:padding="@dimen/_3sdp" app:thumbHeight="@dimen/_22sdp" app:colorSeeds="@array/app_colors" app:showAlphaBar="true" />

nitinbhanderi35 avatar Sep 14 '19 05:09 nitinbhanderi35

@nitinbhanderi35 Can you show the java code and layout here, so that can help me diagnose this issue.

===> issue android os 9

<com.rtugeek.android.colorseekbar.ColorSeekBar android:id="@+id/sek_color" android:layout_width="match_parent" android:layout_height="@dimen/_60sdp" android:padding="@dimen/_3sdp" app:thumbHeight="@dimen/_22sdp" app:colorSeeds="@array/app_colors" app:showAlphaBar="true" />

What's the parent layout of ColorSeekBar

rtugeek avatar Sep 14 '19 13:09 rtugeek