Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shineangelic opened this issue Jul 11, 2017 · 6 comments

Comments

@shineangelic
Copy link

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"
/>

@rtugeek
Copy link
Owner

rtugeek commented Sep 16, 2017

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....).

@jlurena
Copy link

jlurena commented Oct 7, 2017

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.

@nitinbhanderi35
Copy link

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)

@rtugeek
Copy link
Owner

rtugeek commented Sep 11, 2019

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

@nitinbhanderi35
Copy link

nitinbhanderi35 commented Sep 14, 2019

@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" />

@rtugeek
Copy link
Owner

rtugeek commented Sep 14, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants