Fixing issue where toasts were getting queued. (Bug 6572269)
Change-Id: Iceb27c4c5a4168beb5a5ae37a0c597e1940bff04
This commit is contained in:
@@ -300,6 +300,8 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
||||
PendingAddWidgetInfo mCreateWidgetInfo = null;
|
||||
private boolean mDraggingWidget = false;
|
||||
|
||||
private Toast mWidgetInstructionToast;
|
||||
|
||||
// Deferral of loading widget previews during launcher transitions
|
||||
private boolean mInTransition;
|
||||
private ArrayList<AsyncTaskPageData> mDeferredSyncWidgetPageItems =
|
||||
@@ -577,8 +579,12 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
|
||||
|
||||
} else if (v instanceof PagedViewWidget) {
|
||||
// Let the user know that they have to long press to add a widget
|
||||
Toast.makeText(getContext(), R.string.long_press_widget_to_add,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
if (mWidgetInstructionToast != null) {
|
||||
mWidgetInstructionToast.cancel();
|
||||
}
|
||||
mWidgetInstructionToast = Toast.makeText(getContext(),R.string.long_press_widget_to_add,
|
||||
Toast.LENGTH_SHORT);
|
||||
mWidgetInstructionToast.show();
|
||||
|
||||
// Create a little animation to show that the widget can move
|
||||
float offsetY = getResources().getDimensionPixelSize(R.dimen.dragViewOffsetY);
|
||||
|
||||
Reference in New Issue
Block a user