Merge "Notify WidgetHostView drag content change only at onDraw" into sc-dev
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
mDragObject.dragView.invalidate();
|
||||
if (mDragObject.dragView != null) {
|
||||
mDragObject.dragView.invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user