blob: aa6e08ebc9aa2cb85b268ffdb189f6b748220fb3 [file] [log] [blame]
Sunny Goyal83a8f042015-05-19 12:52:12 -07001package com.android.launcher3.accessibility;
Sunny Goyal71b5c0b2015-01-08 16:59:04 -08002
3import android.annotation.TargetApi;
Sunny Goyal9ca9c132015-04-29 14:57:22 -07004import android.app.AlertDialog;
5import android.appwidget.AppWidgetProviderInfo;
6import android.content.DialogInterface;
Adam Cohenc9735cf2015-01-23 16:11:55 -08007import android.graphics.Rect;
Sunny Goyal71b5c0b2015-01-08 16:59:04 -08008import android.os.Build;
9import android.os.Bundle;
Sunny Goyal9ae77772015-04-29 16:30:23 -070010import android.os.Handler;
Sunny Goyal1a70cef2015-04-22 11:29:51 -070011import android.text.TextUtils;
Sunny Goyala9116722015-04-29 13:55:58 -070012import android.util.Log;
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080013import android.util.SparseArray;
14import android.view.View;
15import android.view.View.AccessibilityDelegate;
16import android.view.accessibility.AccessibilityNodeInfo;
17import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
18
Sunny Goyal83a8f042015-05-19 12:52:12 -070019import com.android.launcher3.AppInfo;
20import com.android.launcher3.AppWidgetResizeFrame;
21import com.android.launcher3.CellLayout;
22import com.android.launcher3.DeleteDropTarget;
Sunny Goyal45478022015-06-08 16:52:41 -070023import com.android.launcher3.DragSource;
Sunny Goyal26119432016-02-18 22:09:23 +000024import com.android.launcher3.folder.Folder;
Sunny Goyal83a8f042015-05-19 12:52:12 -070025import com.android.launcher3.FolderInfo;
26import com.android.launcher3.InfoDropTarget;
27import com.android.launcher3.ItemInfo;
28import com.android.launcher3.Launcher;
29import com.android.launcher3.LauncherAppWidgetHostView;
30import com.android.launcher3.LauncherAppWidgetInfo;
31import com.android.launcher3.LauncherModel;
32import com.android.launcher3.LauncherSettings;
33import com.android.launcher3.PendingAddItemInfo;
34import com.android.launcher3.R;
35import com.android.launcher3.ShortcutInfo;
36import com.android.launcher3.UninstallDropTarget;
37import com.android.launcher3.Workspace;
Vadim Tryshevfedca432015-08-19 17:55:02 -070038import com.android.launcher3.dragndrop.DragController.DragListener;
Adam Cohen091440a2015-03-18 14:16:05 -070039import com.android.launcher3.util.Thunk;
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080040
41import java.util.ArrayList;
42
43@TargetApi(Build.VERSION_CODES.LOLLIPOP)
Sunny Goyal45478022015-06-08 16:52:41 -070044public class LauncherAccessibilityDelegate extends AccessibilityDelegate implements DragListener {
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080045
Sunny Goyala9116722015-04-29 13:55:58 -070046 private static final String TAG = "LauncherAccessibilityDelegate";
47
48 private static final int REMOVE = R.id.action_remove;
49 private static final int INFO = R.id.action_info;
50 private static final int UNINSTALL = R.id.action_uninstall;
51 private static final int ADD_TO_WORKSPACE = R.id.action_add_to_workspace;
52 private static final int MOVE = R.id.action_move;
Sunny Goyal9ae77772015-04-29 16:30:23 -070053 private static final int MOVE_TO_WORKSPACE = R.id.action_move_to_workspace;
Sunny Goyal9ca9c132015-04-29 14:57:22 -070054 private static final int RESIZE = R.id.action_resize;
Adam Cohenc9735cf2015-01-23 16:11:55 -080055
Sunny Goyale9b651e2015-04-24 11:44:51 -070056 public enum DragType {
Adam Cohenc9735cf2015-01-23 16:11:55 -080057 ICON,
58 FOLDER,
59 WIDGET
60 }
61
62 public static class DragInfo {
Sunny Goyale9b651e2015-04-24 11:44:51 -070063 public DragType dragType;
64 public ItemInfo info;
65 public View item;
Adam Cohenc9735cf2015-01-23 16:11:55 -080066 }
67
Sunny Goyala9116722015-04-29 13:55:58 -070068 private final SparseArray<AccessibilityAction> mActions = new SparseArray<>();
Adam Cohen091440a2015-03-18 14:16:05 -070069 @Thunk final Launcher mLauncher;
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080070
Sunny Goyale9b651e2015-04-24 11:44:51 -070071 private DragInfo mDragInfo = null;
72 private AccessibilityDragSource mDragSource = null;
73
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080074 public LauncherAccessibilityDelegate(Launcher launcher) {
75 mLauncher = launcher;
76
77 mActions.put(REMOVE, new AccessibilityAction(REMOVE,
Tony Wickham9aae47f2015-10-01 13:04:22 -070078 launcher.getText(R.string.remove_drop_target_label)));
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080079 mActions.put(INFO, new AccessibilityAction(INFO,
Tony Wickham9aae47f2015-10-01 13:04:22 -070080 launcher.getText(R.string.app_info_drop_target_label)));
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080081 mActions.put(UNINSTALL, new AccessibilityAction(UNINSTALL,
Tony Wickham9aae47f2015-10-01 13:04:22 -070082 launcher.getText(R.string.uninstall_drop_target_label)));
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080083 mActions.put(ADD_TO_WORKSPACE, new AccessibilityAction(ADD_TO_WORKSPACE,
84 launcher.getText(R.string.action_add_to_workspace)));
Adam Cohenc9735cf2015-01-23 16:11:55 -080085 mActions.put(MOVE, new AccessibilityAction(MOVE,
86 launcher.getText(R.string.action_move)));
Sunny Goyal9ae77772015-04-29 16:30:23 -070087 mActions.put(MOVE_TO_WORKSPACE, new AccessibilityAction(MOVE_TO_WORKSPACE,
88 launcher.getText(R.string.action_move_to_workspace)));
Sunny Goyal9ca9c132015-04-29 14:57:22 -070089 mActions.put(RESIZE, new AccessibilityAction(RESIZE,
90 launcher.getText(R.string.action_resize)));
Sunny Goyal71b5c0b2015-01-08 16:59:04 -080091 }
92
93 @Override
94 public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
95 super.onInitializeAccessibilityNodeInfo(host, info);
96 if (!(host.getTag() instanceof ItemInfo)) return;
97 ItemInfo item = (ItemInfo) host.getTag();
98
Tony Wickham9aae47f2015-10-01 13:04:22 -070099 if (DeleteDropTarget.supportsAccessibleDrop(item)) {
Sunny Goyal1a70cef2015-04-22 11:29:51 -0700100 info.addAction(mActions.get(REMOVE));
101 }
102 if (UninstallDropTarget.supportsDrop(host.getContext(), item)) {
103 info.addAction(mActions.get(UNINSTALL));
104 }
Sunny Goyald5bd67d2016-03-11 01:10:19 -0800105 if (InfoDropTarget.supportsDrop(item)) {
Sunny Goyal1a70cef2015-04-22 11:29:51 -0700106 info.addAction(mActions.get(INFO));
107 }
108
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800109 if ((item instanceof ShortcutInfo)
110 || (item instanceof LauncherAppWidgetInfo)
111 || (item instanceof FolderInfo)) {
Adam Cohenc9735cf2015-01-23 16:11:55 -0800112 info.addAction(mActions.get(MOVE));
Sunny Goyal9ae77772015-04-29 16:30:23 -0700113
114 if (item.container >= 0) {
115 info.addAction(mActions.get(MOVE_TO_WORKSPACE));
Sunny Goyal9ca9c132015-04-29 14:57:22 -0700116 } else if (item instanceof LauncherAppWidgetInfo) {
117 if (!getSupportedResizeActions(host, (LauncherAppWidgetInfo) item).isEmpty()) {
118 info.addAction(mActions.get(RESIZE));
119 }
Sunny Goyal9ae77772015-04-29 16:30:23 -0700120 }
Sunny Goyal1a70cef2015-04-22 11:29:51 -0700121 } if ((item instanceof AppInfo) || (item instanceof PendingAddItemInfo)) {
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800122 info.addAction(mActions.get(ADD_TO_WORKSPACE));
123 }
124 }
125
126 @Override
127 public boolean performAccessibilityAction(View host, int action, Bundle args) {
128 if ((host.getTag() instanceof ItemInfo)
129 && performAction(host, (ItemInfo) host.getTag(), action)) {
130 return true;
131 }
132 return super.performAccessibilityAction(host, action, args);
133 }
134
Sunny Goyal9ca9c132015-04-29 14:57:22 -0700135 public boolean performAction(final View host, final ItemInfo item, int action) {
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800136 if (action == REMOVE) {
Sunny Goyale78e3d72015-09-24 11:23:31 -0700137 DeleteDropTarget.removeWorkspaceOrFolderItem(mLauncher, item, host);
138 return true;
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800139 } else if (action == INFO) {
Sunny Goyald5bd67d2016-03-11 01:10:19 -0800140 InfoDropTarget.startDetailsActivityForInfo(item, mLauncher, null);
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800141 return true;
142 } else if (action == UNINSTALL) {
Sunny Goyal1a70cef2015-04-22 11:29:51 -0700143 return UninstallDropTarget.startUninstallActivity(mLauncher, item);
Adam Cohenc9735cf2015-01-23 16:11:55 -0800144 } else if (action == MOVE) {
145 beginAccessibleDrag(host, item);
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800146 } else if (action == ADD_TO_WORKSPACE) {
Sunny Goyala9116722015-04-29 13:55:58 -0700147 final int[] coordinates = new int[2];
148 final long screenId = findSpaceOnWorkspace(item, coordinates);
149 mLauncher.showWorkspace(true, new Runnable() {
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800150
151 @Override
Sunny Goyala9116722015-04-29 13:55:58 -0700152 public void run() {
153 if (item instanceof AppInfo) {
154 ShortcutInfo info = ((AppInfo) item).makeShortcut();
155 LauncherModel.addItemToDatabase(mLauncher, info,
156 LauncherSettings.Favorites.CONTAINER_DESKTOP,
157 screenId, coordinates[0], coordinates[1]);
158
159 ArrayList<ItemInfo> itemList = new ArrayList<>();
160 itemList.add(info);
161 mLauncher.bindItems(itemList, 0, itemList.size(), true);
162 } else if (item instanceof PendingAddItemInfo) {
163 PendingAddItemInfo info = (PendingAddItemInfo) item;
164 Workspace workspace = mLauncher.getWorkspace();
165 workspace.snapToPage(workspace.getPageIndexForScreenId(screenId));
166 mLauncher.addPendingItem(info, LauncherSettings.Favorites.CONTAINER_DESKTOP,
167 screenId, coordinates, info.spanX, info.spanY);
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800168 }
Sunny Goyala9116722015-04-29 13:55:58 -0700169 announceConfirmation(R.string.item_added_to_workspace);
170 }
171 });
172 return true;
Sunny Goyal9ae77772015-04-29 16:30:23 -0700173 } else if (action == MOVE_TO_WORKSPACE) {
174 Folder folder = mLauncher.getWorkspace().getOpenFolder();
Sunny Goyal935fca12015-10-13 10:19:01 -0700175 mLauncher.closeFolder(folder, true);
Sunny Goyal9ae77772015-04-29 16:30:23 -0700176 ShortcutInfo info = (ShortcutInfo) item;
Sunny Goyalc52ba712016-04-05 15:59:05 -0700177 folder.getInfo().remove(info, false);
Sunny Goyal9ae77772015-04-29 16:30:23 -0700178
179 final int[] coordinates = new int[2];
180 final long screenId = findSpaceOnWorkspace(item, coordinates);
181 LauncherModel.moveItemInDatabase(mLauncher, info,
182 LauncherSettings.Favorites.CONTAINER_DESKTOP,
183 screenId, coordinates[0], coordinates[1]);
184
185 // Bind the item in next frame so that if a new workspace page was created,
186 // it will get laid out.
187 new Handler().post(new Runnable() {
188
189 @Override
190 public void run() {
191 ArrayList<ItemInfo> itemList = new ArrayList<>();
192 itemList.add(item);
193 mLauncher.bindItems(itemList, 0, itemList.size(), true);
194 announceConfirmation(R.string.item_moved);
195 }
196 });
Sunny Goyal9ca9c132015-04-29 14:57:22 -0700197 } else if (action == RESIZE) {
198 final LauncherAppWidgetInfo info = (LauncherAppWidgetInfo) item;
199 final ArrayList<Integer> actions = getSupportedResizeActions(host, info);
200 CharSequence[] labels = new CharSequence[actions.size()];
201 for (int i = 0; i < actions.size(); i++) {
202 labels[i] = mLauncher.getText(actions.get(i));
203 }
204
205 new AlertDialog.Builder(mLauncher)
206 .setTitle(R.string.action_resize)
207 .setItems(labels, new DialogInterface.OnClickListener() {
208
209 @Override
210 public void onClick(DialogInterface dialog, int which) {
211 performResizeAction(actions.get(which), host, info);
212 dialog.dismiss();
213 }
214 })
215 .show();
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800216 }
217 return false;
218 }
Adam Cohenc9735cf2015-01-23 16:11:55 -0800219
Sunny Goyal9ca9c132015-04-29 14:57:22 -0700220 private ArrayList<Integer> getSupportedResizeActions(View host, LauncherAppWidgetInfo info) {
Sunny Goyal9ca9c132015-04-29 14:57:22 -0700221 ArrayList<Integer> actions = new ArrayList<>();
222
Sunny Goyald3d8c952015-06-01 10:09:06 -0700223 AppWidgetProviderInfo providerInfo = ((LauncherAppWidgetHostView) host).getAppWidgetInfo();
224 if (providerInfo == null) {
225 return actions;
226 }
227
Sunny Goyal9ca9c132015-04-29 14:57:22 -0700228 CellLayout layout = (CellLayout) host.getParent().getParent();
229 if ((providerInfo.resizeMode & AppWidgetProviderInfo.RESIZE_HORIZONTAL) != 0) {
230 if (layout.isRegionVacant(info.cellX + info.spanX, info.cellY, 1, info.spanY) ||
231 layout.isRegionVacant(info.cellX - 1, info.cellY, 1, info.spanY)) {
232 actions.add(R.string.action_increase_width);
233 }
234
235 if (info.spanX > info.minSpanX && info.spanX > 1) {
236 actions.add(R.string.action_decrease_width);
237 }
238 }
239
240 if ((providerInfo.resizeMode & AppWidgetProviderInfo.RESIZE_VERTICAL) != 0) {
241 if (layout.isRegionVacant(info.cellX, info.cellY + info.spanY, info.spanX, 1) ||
242 layout.isRegionVacant(info.cellX, info.cellY - 1, info.spanX, 1)) {
243 actions.add(R.string.action_increase_height);
244 }
245
246 if (info.spanY > info.minSpanY && info.spanY > 1) {
247 actions.add(R.string.action_decrease_height);
248 }
249 }
250 return actions;
251 }
252
Sunny Goyal316490e2015-06-02 09:38:28 -0700253 @Thunk void performResizeAction(int action, View host, LauncherAppWidgetInfo info) {
Sunny Goyal9ca9c132015-04-29 14:57:22 -0700254 CellLayout.LayoutParams lp = (CellLayout.LayoutParams) host.getLayoutParams();
255 CellLayout layout = (CellLayout) host.getParent().getParent();
256 layout.markCellsAsUnoccupiedForView(host);
257
258 if (action == R.string.action_increase_width) {
259 if (((host.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL)
260 && layout.isRegionVacant(info.cellX - 1, info.cellY, 1, info.spanY))
261 || !layout.isRegionVacant(info.cellX + info.spanX, info.cellY, 1, info.spanY)) {
262 lp.cellX --;
263 info.cellX --;
264 }
265 lp.cellHSpan ++;
266 info.spanX ++;
267 } else if (action == R.string.action_decrease_width) {
268 lp.cellHSpan --;
269 info.spanX --;
270 } else if (action == R.string.action_increase_height) {
271 if (!layout.isRegionVacant(info.cellX, info.cellY + info.spanY, info.spanX, 1)) {
272 lp.cellY --;
273 info.cellY --;
274 }
275 lp.cellVSpan ++;
276 info.spanY ++;
277 } else if (action == R.string.action_decrease_height) {
278 lp.cellVSpan --;
279 info.spanY --;
280 }
281
282 layout.markCellsAsOccupiedForView(host);
283 Rect sizeRange = new Rect();
284 AppWidgetResizeFrame.getWidgetSizeRanges(mLauncher, info.spanX, info.spanY, sizeRange);
285 ((LauncherAppWidgetHostView) host).updateAppWidgetSize(null,
286 sizeRange.left, sizeRange.top, sizeRange.right, sizeRange.bottom);
287 host.requestLayout();
288 LauncherModel.updateItemInDatabase(mLauncher, info);
289 announceConfirmation(mLauncher.getString(R.string.widget_resized, info.spanX, info.spanY));
290 }
291
Adam Cohen091440a2015-03-18 14:16:05 -0700292 @Thunk void announceConfirmation(int resId) {
Adam Cohenc9735cf2015-01-23 16:11:55 -0800293 announceConfirmation(mLauncher.getResources().getString(resId));
294 }
295
Adam Cohen091440a2015-03-18 14:16:05 -0700296 @Thunk void announceConfirmation(String confirmation) {
Adam Cohenc9735cf2015-01-23 16:11:55 -0800297 mLauncher.getDragLayer().announceForAccessibility(confirmation);
298
299 }
300
301 public boolean isInAccessibleDrag() {
302 return mDragInfo != null;
303 }
304
305 public DragInfo getDragInfo() {
306 return mDragInfo;
307 }
308
Sunny Goyal1a70cef2015-04-22 11:29:51 -0700309 /**
310 * @param clickedTarget the actual view that was clicked
311 * @param dropLocation relative to {@param clickedTarget}. If provided, its center is used
312 * as the actual drop location otherwise the views center is used.
313 */
314 public void handleAccessibleDrop(View clickedTarget, Rect dropLocation,
Adam Cohenc9735cf2015-01-23 16:11:55 -0800315 String confirmation) {
316 if (!isInAccessibleDrag()) return;
317
318 int[] loc = new int[2];
Sunny Goyal1a70cef2015-04-22 11:29:51 -0700319 if (dropLocation == null) {
320 loc[0] = clickedTarget.getWidth() / 2;
321 loc[1] = clickedTarget.getHeight() / 2;
322 } else {
323 loc[0] = dropLocation.centerX();
324 loc[1] = dropLocation.centerY();
325 }
Adam Cohenc9735cf2015-01-23 16:11:55 -0800326
Sunny Goyal1a70cef2015-04-22 11:29:51 -0700327 mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(clickedTarget, loc);
Adam Cohenc9735cf2015-01-23 16:11:55 -0800328 mLauncher.getDragController().completeAccessibleDrag(loc);
329
Sunny Goyal1a70cef2015-04-22 11:29:51 -0700330 if (!TextUtils.isEmpty(confirmation)) {
331 announceConfirmation(confirmation);
332 }
Adam Cohenc9735cf2015-01-23 16:11:55 -0800333 }
334
335 public void beginAccessibleDrag(View item, ItemInfo info) {
336 mDragInfo = new DragInfo();
337 mDragInfo.info = info;
338 mDragInfo.item = item;
339 mDragInfo.dragType = DragType.ICON;
340 if (info instanceof FolderInfo) {
341 mDragInfo.dragType = DragType.FOLDER;
342 } else if (info instanceof LauncherAppWidgetInfo) {
343 mDragInfo.dragType = DragType.WIDGET;
344 }
345
346 CellLayout.CellInfo cellInfo = new CellLayout.CellInfo(item, info);
347
348 Rect pos = new Rect();
349 mLauncher.getDragLayer().getDescendantRectRelativeToSelf(item, pos);
Adam Cohenc9735cf2015-01-23 16:11:55 -0800350 mLauncher.getDragController().prepareAccessibleDrag(pos.centerX(), pos.centerY());
Sunny Goyale9b651e2015-04-24 11:44:51 -0700351
352 Workspace workspace = mLauncher.getWorkspace();
353
354 Folder folder = workspace.getOpenFolder();
355 if (folder != null) {
356 if (folder.getItemsInReadingOrder().contains(item)) {
357 mDragSource = folder;
358 } else {
359 mLauncher.closeFolder();
360 }
361 }
362 if (mDragSource == null) {
363 mDragSource = workspace;
364 }
365 mDragSource.enableAccessibleDrag(true);
366 mDragSource.startDrag(cellInfo, true);
Adam Cohenc9735cf2015-01-23 16:11:55 -0800367
Sunny Goyal45478022015-06-08 16:52:41 -0700368 if (mLauncher.getDragController().isDragging()) {
369 mLauncher.getDragController().addDragListener(this);
Adam Cohenc9735cf2015-01-23 16:11:55 -0800370 }
Adam Cohenc9735cf2015-01-23 16:11:55 -0800371 }
372
Sunny Goyal45478022015-06-08 16:52:41 -0700373
374 @Override
Sunny Goyalaa8ef112015-06-12 20:04:41 -0700375 public void onDragStart(DragSource source, ItemInfo info, int dragAction) {
Sunny Goyal45478022015-06-08 16:52:41 -0700376 // No-op
Adam Cohenc9735cf2015-01-23 16:11:55 -0800377 }
378
Sunny Goyal45478022015-06-08 16:52:41 -0700379 @Override
380 public void onDragEnd() {
381 mLauncher.getDragController().removeDragListener(this);
Adam Cohenc9735cf2015-01-23 16:11:55 -0800382 mDragInfo = null;
Sunny Goyale9b651e2015-04-24 11:44:51 -0700383 if (mDragSource != null) {
384 mDragSource.enableAccessibleDrag(false);
385 mDragSource = null;
386 }
387 }
388
389 public static interface AccessibilityDragSource {
390 void startDrag(CellLayout.CellInfo cellInfo, boolean accessible);
391
392 void enableAccessibleDrag(boolean enable);
Adam Cohenc9735cf2015-01-23 16:11:55 -0800393 }
Sunny Goyala9116722015-04-29 13:55:58 -0700394
395 /**
396 * Find empty space on the workspace and returns the screenId.
397 */
398 private long findSpaceOnWorkspace(ItemInfo info, int[] outCoordinates) {
399 Workspace workspace = mLauncher.getWorkspace();
400 ArrayList<Long> workspaceScreens = workspace.getScreenOrder();
401 long screenId;
402
403 // First check if there is space on the current screen.
404 int screenIndex = workspace.getCurrentPage();
405 screenId = workspaceScreens.get(screenIndex);
406 CellLayout layout = (CellLayout) workspace.getPageAt(screenIndex);
407
408 boolean found = layout.findCellForSpan(outCoordinates, info.spanX, info.spanY);
409 screenIndex = workspace.hasCustomContent() ? 1 : 0;
410 while (!found && screenIndex < workspaceScreens.size()) {
411 screenId = workspaceScreens.get(screenIndex);
412 layout = (CellLayout) workspace.getPageAt(screenIndex);
413 found = layout.findCellForSpan(outCoordinates, info.spanX, info.spanY);
414 screenIndex++;
415 }
416
417 if (found) {
418 return screenId;
419 }
420
421 workspace.addExtraEmptyScreen();
422 screenId = workspace.commitExtraEmptyScreen();
423 layout = workspace.getScreenWithId(screenId);
424 found = layout.findCellForSpan(outCoordinates, info.spanX, info.spanY);
425
426 if (!found) {
427 Log.wtf(TAG, "Not enough space on an empty screen");
428 }
429 return screenId;
430 }
Sunny Goyal71b5c0b2015-01-08 16:59:04 -0800431}