Loading src/com/android/launcher3/dragndrop/AppWidgetHostViewDrawable.java +13 −2 Original line number Diff line number Diff line Loading @@ -27,15 +27,21 @@ import android.graphics.drawable.Drawable; import com.android.launcher3.widget.LauncherAppWidgetHostView; /** A drawable which renders {@link LauncherAppWidgetHostView} to a canvas. */ /** * A drawable which renders {@link LauncherAppWidgetHostView} to a canvas. * * TODO(b/183609936) Stop using that class and remove it. */ public final class AppWidgetHostViewDrawable extends Drawable { private final LauncherAppWidgetHostView mAppWidgetHostView; private Paint mPaint = new Paint(); private final Path mClipPath; private final boolean mWasAttached; public AppWidgetHostViewDrawable(LauncherAppWidgetHostView appWidgetHostView) { mAppWidgetHostView = appWidgetHostView; mWasAttached = appWidgetHostView.isAttachedToWindow(); Path clipPath = null; if (appWidgetHostView.getClipToOutline()) { Outline outline = new Outline(); Loading @@ -56,7 +62,12 @@ public final class AppWidgetHostViewDrawable extends Drawable { if (mClipPath != null) { canvas.clipPath(mClipPath); } // If the view was never attached, or is current attached, then draw. Otherwise do not try // to draw, or we might trigger bugs with items that get drawn while requiring the view to // be attached. if (!mWasAttached || mAppWidgetHostView.isAttachedToWindow()) { mAppWidgetHostView.draw(canvas); } canvas.restoreToCount(saveCount); } Loading Loading
src/com/android/launcher3/dragndrop/AppWidgetHostViewDrawable.java +13 −2 Original line number Diff line number Diff line Loading @@ -27,15 +27,21 @@ import android.graphics.drawable.Drawable; import com.android.launcher3.widget.LauncherAppWidgetHostView; /** A drawable which renders {@link LauncherAppWidgetHostView} to a canvas. */ /** * A drawable which renders {@link LauncherAppWidgetHostView} to a canvas. * * TODO(b/183609936) Stop using that class and remove it. */ public final class AppWidgetHostViewDrawable extends Drawable { private final LauncherAppWidgetHostView mAppWidgetHostView; private Paint mPaint = new Paint(); private final Path mClipPath; private final boolean mWasAttached; public AppWidgetHostViewDrawable(LauncherAppWidgetHostView appWidgetHostView) { mAppWidgetHostView = appWidgetHostView; mWasAttached = appWidgetHostView.isAttachedToWindow(); Path clipPath = null; if (appWidgetHostView.getClipToOutline()) { Outline outline = new Outline(); Loading @@ -56,7 +62,12 @@ public final class AppWidgetHostViewDrawable extends Drawable { if (mClipPath != null) { canvas.clipPath(mClipPath); } // If the view was never attached, or is current attached, then draw. Otherwise do not try // to draw, or we might trigger bugs with items that get drawn while requiring the view to // be attached. if (!mWasAttached || mAppWidgetHostView.isAttachedToWindow()) { mAppWidgetHostView.draw(canvas); } canvas.restoreToCount(saveCount); } Loading