makovkastar / FloatingActionButton

[DEPRECATED] Android floating action button
MIT License
4.01k stars 819 forks source link

java.lang.IllegalArgumentException: Width (8) and height (0) cannot be <= 0 #160

Open paulomcnally opened 9 years ago

paulomcnally commented 9 years ago
java.lang.IllegalArgumentException: Width (8) and height (0) cannot be <= 0
    at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:999)
    at java.awt.image.BufferedImage.<init>(BufferedImage.java:326)
    at android.graphics.LinearGradient_Delegate$LinearGradientPaint$LinearGradientPaintContext.getRaster(LinearGradient_Delegate.java:175)
    at apple.awt.OSXSurfaceData.setupPaint(OSXSurfaceData.java:752)
    at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:1038)
    at apple.awt.OSXSurfaceData.setupGraphicsState(OSXSurfaceData.java:1004)
    at apple.awt.OSXSurfaceData.doRect(OSXSurfaceData.java:1239)
    at apple.awt.CRenderer.fillRect(CRenderer.java:157)
    at apple.awt.CRenderer.fillRect(CRenderer.java:145)
    at sun.java2d.pipe.ValidatePipe.fillRect(ValidatePipe.java:58)
    at sun.java2d.SunGraphics2D.fillRect(SunGraphics2D.java:2505)
    at android.graphics.Canvas_Delegate$4.draw(Canvas_Delegate.java:582)
    at com.android.layoutlib.bridge.impl.GcSnapshot.drawOnGraphics(GcSnapshot.java:654)
    at com.android.layoutlib.bridge.impl.GcSnapshot.drawInLayer(GcSnapshot.java:614)
    at com.android.layoutlib.bridge.impl.GcSnapshot.draw(GcSnapshot.java:582)
    at android.graphics.Canvas_Delegate.draw(Canvas_Delegate.java:937)
    at android.graphics.Canvas_Delegate.native_drawRect(Canvas_Delegate.java:573)
    at android.graphics.Canvas.native_drawRect(Canvas.java)
    at android.graphics.Canvas.drawRect(Canvas.java:1119)
    at android.view.RectShadowPainter.sideShadow(RectShadowPainter.java:131)
    at android.view.RectShadowPainter.paintShadow(RectShadowPainter.java:79)
    at android.view.ViewGroup_Delegate.drawShadow(ViewGroup_Delegate.java:72)
    at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
    at android.view.View.draw(View.java:15234)
    at android.view.View.draw(View.java:15140)
    at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3405)
    at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
    at android.view.View.draw(View.java:15138)
    at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3405)
    at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
    at android.view.View.draw(View.java:15138)
    at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3405)
    at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
    at android.view.View.draw(View.java:15234)
    at com.android.internal.widget.ActionBarOverlayLayout.draw(ActionBarOverlayLayout.java:501)
    at android.view.View.draw(View.java:15140)
    at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3405)
    at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
    at android.view.View.draw(View.java:15234)
    at android.view.View.draw(View.java:15140)
    at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3405)
    at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:65)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
    at android.view.View.draw(View.java:15234)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:601)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:323)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:497)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:485)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
    at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:485)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:590)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:695)
usmaanz commented 9 years ago

I get the exact same issue. Has anyone got an idea to fix this issue?

This can be replicated by simply having the following code:

<com.melnykov.fab.FloatingActionButton
    android:layout_width="50dp"
    android:layout_height="50dp"/>