NavigationTabBar
NavigationTabBar copied to clipboard
IllegalArgumentException: width and height must be > 0 while trying to split view
So I was using the library on my application and I noticed it crashed everytime I tried to use application on split view.
Stacktrace
Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:877) at android.graphics.Bitmap.createBitmap(Bitmap.java:856) at android.graphics.Bitmap.createBitmap(Bitmap.java:823) at devlight.io.library.ntb.NavigationTabBar.onDraw(NavigationTabBar.java:1077) at android.view.View.draw(View.java:17180) at android.view.View.buildDrawingCacheImpl(View.java:16469) at android.view.View.buildDrawingCache(View.java:16330) at android.view.View.draw(View.java:16938) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.updateDisplayListIfDirty(View.java:16157) at android.view.View.draw(View.java:16946) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1234) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.updateDisplayListIfDirty(View.java:16157) at android.view.View.draw(View.java:16946) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.updateDisplayListIfDirty(View.java:16157) at android.view.View.draw(View.java:16946) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.updateDisplayListIfDirty(View.java:16157) at android.view.View.draw(View.java:16946) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.updateDisplayListIfDirty(View.java:16157) at android.view.View.draw(View.java:16946) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.updateDisplayListIfDirty(View.java:16157) at android.view.View.draw(View.java:16946) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.updateDisplayListIfDirty(View.java:16157) at android.view.View.draw(View.java:16946) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.updateDisplayListIfDirty(View.java:16157) at android.view.View.draw(View.java:16946) at android.view.ViewGroup.drawChild(ViewGroup.java:3776) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3562) at android.view.View.draw(View.java:17183) at com.android.internal.policy.DecorView.draw(DecorView.java:777) at android.view.View.updateDisplayListIfDirty(View.java:16162) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:682) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:688) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:796) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2947) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2738) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2314) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1310) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6550) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:887) at android.view.Choreographer.doCallbacks(Choreographer.java:689) at android.view.Choreographer.doFrame(Choreographer.java:619) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:873) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:173) at android.app.ActivityThread.main(ActivityThread.java:6459) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:938) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:828)
I just added the code in the example and I've the same issue
You MUST init in your code too as shown in the readme file
Same issue only for first startup of app after new install.