Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be738686 authored by Steven Ng's avatar Steven Ng Committed by Android (Google) Code Review
Browse files

Merge "Notify WidgetHostView drag content change only at onDraw" into sc-dev

parents fd0a75e1 6f98e1eb
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.launcher3.widget;
import android.appwidget.AppWidgetProviderInfo;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Handler;
@@ -120,8 +121,12 @@ public class LauncherAppWidgetHostView extends NavigableAppWidgetHostView
        } else {
            super.setColorResources(colors);
        }
    }

        if (mDragListener != null) {
    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        if (mIsInDragMode && mDragListener != null) {
            mDragListener.onDragContentChanged();
        }
    }
+3 −1
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ public final class AppWidgetHostViewDragListener implements DragController.DragL

    /** Notifies when there is a content change in the drag view. */
    public void onDragContentChanged() {
        if (mDragObject.dragView != null) {
            mDragObject.dragView.invalidate();
        }
    }
}