diff --git a/core/src/main/java/icyllis/modernui/core/ActivityWindow.java b/core/src/main/java/icyllis/modernui/core/ActivityWindow.java index 374c03501..59972f4e2 100644 --- a/core/src/main/java/icyllis/modernui/core/ActivityWindow.java +++ b/core/src/main/java/icyllis/modernui/core/ActivityWindow.java @@ -165,7 +165,12 @@ private void onFramebufferSizeCallback(long w, int width, int height) { mWidth = width; mHeight = height; if (mRoot != null) { - mRoot.mHandler.post(() -> mRoot.setFrame(mWidth, mHeight)); + mRoot.mHandler.post(() -> { + // on minimized, window size is 0 + if (mWidth != 0 && mHeight != 0) { + mRoot.setFrame(mWidth, mHeight); + } + }); } } diff --git a/core/src/main/java/icyllis/modernui/graphics/Canvas.java b/core/src/main/java/icyllis/modernui/graphics/Canvas.java index 32fcd6db3..e47515ae9 100644 --- a/core/src/main/java/icyllis/modernui/graphics/Canvas.java +++ b/core/src/main/java/icyllis/modernui/graphics/Canvas.java @@ -119,7 +119,10 @@ protected Canvas() { * @param alpha The alpha to apply to the offscreen when it is * drawn during restore() * @return value to pass to restoreToCount() to balance this call + * @deprecated this method does nothing, you should manually create a layer, or possibly manage a + * pool of layers, or use {@link icyllis.modernui.view.View#LAYER_TYPE_HARDWARE}. */ + @Deprecated public final int saveLayer(@Nullable RectF bounds, int alpha) { if (bounds == null) { // ok, it's big enough @@ -134,7 +137,10 @@ public final int saveLayer(@Nullable RectF bounds, int alpha) { * bounds' rectangle. * * @see #saveLayer(RectF, int) + * @deprecated this method does nothing, you should manually create a layer, or possibly manage a + * pool of layers, or use {@link icyllis.modernui.view.View#LAYER_TYPE_HARDWARE}. */ + @Deprecated public abstract int saveLayer(float left, float top, float right, float bottom, int alpha); /**