OSDN Git Service

Moving LauncherAccessibilityDelegate to accessibility package
authorSunny Goyal <sunnygoyal@google.com>
Tue, 19 May 2015 19:52:12 +0000 (12:52 -0700)
committerSunny Goyal <sunnygoyal@google.com>
Tue, 19 May 2015 19:52:30 +0000 (12:52 -0700)
Change-Id: I510204a5a12abf2da2757f3e3f8b0e8869a6b04a

12 files changed:
src/com/android/launcher3/CellLayout.java
src/com/android/launcher3/DragLayer.java
src/com/android/launcher3/Folder.java
src/com/android/launcher3/Launcher.java
src/com/android/launcher3/LauncherAppState.java
src/com/android/launcher3/LauncherModel.java
src/com/android/launcher3/PagedView.java
src/com/android/launcher3/SmoothPagedView.java
src/com/android/launcher3/Workspace.java
src/com/android/launcher3/accessibility/DragAndDropAccessibilityDelegate.java
src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java [moved from src/com/android/launcher3/LauncherAccessibilityDelegate.java with 95% similarity]
src/com/android/launcher3/accessibility/WorkspaceAccessibilityHelper.java

index a348008..a6e11b6 100644 (file)
@@ -3010,7 +3010,7 @@ public class CellLayout extends ViewGroup {
     // 2. When long clicking on an empty cell in a CellLayout, we save information about the
     //    cellX and cellY coordinates and which page was clicked. We then set this as a tag on
     //    the CellLayout that was long clicked
-    static final class CellInfo {
+    public static final class CellInfo {
         View cell;
         int cellX = -1;
         int cellY = -1;
@@ -3019,7 +3019,7 @@ public class CellLayout extends ViewGroup {
         long screenId;
         long container;
 
-        CellInfo(View v, ItemInfo info) {
+        public CellInfo(View v, ItemInfo info) {
             cell = v;
             cellX = info.cellX;
             cellY = info.cellY;
index e25e615..e8661e3 100644 (file)
@@ -39,6 +39,7 @@ import android.view.animation.Interpolator;
 import android.widget.FrameLayout;
 import android.widget.TextView;
 
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
 import com.android.launcher3.util.Thunk;
 
 import java.util.ArrayList;
index 69b1837..d0a7ba3 100644 (file)
@@ -49,13 +49,15 @@ import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.LinearLayout;
 import android.widget.TextView;
+
 import com.android.launcher3.CellLayout.CellInfo;
 import com.android.launcher3.DragController.DragListener;
 import com.android.launcher3.FolderInfo.FolderListener;
-import com.android.launcher3.LauncherAccessibilityDelegate.AccessibilityDragSource;
 import com.android.launcher3.UninstallDropTarget.UninstallSource;
 import com.android.launcher3.Workspace.ItemOperator;
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate.AccessibilityDragSource;
 import com.android.launcher3.util.Thunk;
+
 import java.util.ArrayList;
 import java.util.Collections;
 
@@ -352,7 +354,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
     /**
      * @return the FolderInfo object associated with this folder
      */
-    FolderInfo getInfo() {
+    public FolderInfo getInfo() {
         return mInfo;
     }
 
index 51ba2df..7b7b617 100644 (file)
@@ -96,6 +96,7 @@ import android.widget.Toast;
 
 import com.android.launcher3.DropTarget.DragObject;
 import com.android.launcher3.PagedView.PageSwitchListener;
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
 import com.android.launcher3.compat.AppWidgetManagerCompat;
 import com.android.launcher3.compat.LauncherActivityInfoCompat;
 import com.android.launcher3.compat.LauncherAppsCompat;
@@ -3184,7 +3185,7 @@ public class Launcher extends Activity
         }
     }
 
-    void closeFolder(Folder folder) {
+    public void closeFolder(Folder folder) {
         folder.getInfo().opened = false;
 
         ViewGroup parent = (ViewGroup) folder.getParent().getParent();
@@ -3337,7 +3338,7 @@ public class Launcher extends Activity
                 true);
     }
 
-    protected void showWorkspace(boolean animated, Runnable onCompleteRunnable) {
+    public void showWorkspace(boolean animated, Runnable onCompleteRunnable) {
         showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated,
                 onCompleteRunnable, true);
     }
index bde54c3..f540eb4 100644 (file)
@@ -31,6 +31,7 @@ import android.util.Log;
 import android.view.Display;
 import android.view.WindowManager;
 
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
 import com.android.launcher3.compat.LauncherAppsCompat;
 import com.android.launcher3.compat.PackageInstallerCompat;
 import com.android.launcher3.util.Thunk;
index 0b3049c..635c863 100644 (file)
@@ -793,7 +793,7 @@ public class LauncherModel extends BroadcastReceiver
     /**
      * Move an item in the DB to a new <container, screen, cellX, cellY>
      */
-    static void moveItemInDatabase(Context context, final ItemInfo item, final long container,
+    public static void moveItemInDatabase(Context context, final ItemInfo item, final long container,
             final long screenId, final int cellX, final int cellY) {
         item.container = container;
         item.cellX = cellX;
@@ -889,7 +889,7 @@ public class LauncherModel extends BroadcastReceiver
     /**
      * Update an item to the database in a specified container.
      */
-    static void updateItemInDatabase(Context context, final ItemInfo item) {
+    public static void updateItemInDatabase(Context context, final ItemInfo item) {
         final ContentValues values = new ContentValues();
         item.onAddToDatabase(context, values);
         updateItemInDatabaseHelper(context, values, item, "updateItemInDatabase");
index 554a975..62f1bc9 100644 (file)
@@ -407,7 +407,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
     /**
      * Returns the index of the currently displayed page.
      */
-    int getCurrentPage() {
+    public int getCurrentPage() {
         return mCurrentPage;
     }
 
@@ -422,7 +422,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
         return getChildCount();
     }
 
-    View getPageAt(int index) {
+    public View getPageAt(int index) {
         return getChildAt(index);
     }
 
index 4e331aa..0f9b23c 100644 (file)
@@ -152,7 +152,7 @@ public abstract class SmoothPagedView extends PagedView {
     }
 
     @Override
-    protected void snapToPage(int whichPage) {
+    public void snapToPage(int whichPage) {
        if (mScrollMode == X_LARGE_MODE) {
            super.snapToPage(whichPage);
        } else {
index 58e5877..8c1c7d6 100644 (file)
@@ -57,19 +57,22 @@ import android.view.accessibility.AccessibilityManager;
 import android.view.animation.DecelerateInterpolator;
 import android.view.animation.Interpolator;
 import android.widget.TextView;
+
 import com.android.launcher3.FolderIcon.FolderRingAnimator;
 import com.android.launcher3.Launcher.CustomContentCallbacks;
 import com.android.launcher3.Launcher.LauncherOverlay;
-import com.android.launcher3.LauncherAccessibilityDelegate.AccessibilityDragSource;
 import com.android.launcher3.LauncherSettings.Favorites;
 import com.android.launcher3.UninstallDropTarget.UninstallSource;
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
 import com.android.launcher3.accessibility.OverviewScreenAccessibilityDelegate;
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate.AccessibilityDragSource;
 import com.android.launcher3.compat.UserHandleCompat;
 import com.android.launcher3.util.LongArrayMap;
 import com.android.launcher3.util.Thunk;
 import com.android.launcher3.util.WallpaperUtils;
 import com.android.launcher3.widget.PendingAddShortcutInfo;
 import com.android.launcher3.widget.PendingAddWidgetInfo;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -494,7 +497,7 @@ public class Workspace extends SmoothPagedView
     /**
      * @return The open folder on the current screen, or null if there is none
      */
-    Folder getOpenFolder() {
+    public Folder getOpenFolder() {
         DragLayer dragLayer = mLauncher.getDragLayer();
         int count = dragLayer.getChildCount();
         for (int i = 0; i < count; i++) {
@@ -857,7 +860,7 @@ public class Workspace extends SmoothPagedView
         return -1;
     }
 
-    ArrayList<Long> getScreenOrder() {
+    public ArrayList<Long> getScreenOrder() {
         return mScreenOrder;
     }
 
index 0f17241..78accf7 100644 (file)
@@ -26,7 +26,6 @@ import android.view.View.OnClickListener;
 import android.view.accessibility.AccessibilityEvent;
 
 import com.android.launcher3.CellLayout;
-import com.android.launcher3.LauncherAccessibilityDelegate;
 import com.android.launcher3.LauncherAppState;
 import com.android.launcher3.R;
 
@@ -1,4 +1,4 @@
-package com.android.launcher3;
+package com.android.launcher3.accessibility;
 
 import android.annotation.TargetApi;
 import android.app.AlertDialog;
@@ -16,6 +16,24 @@ import android.view.View.AccessibilityDelegate;
 import android.view.accessibility.AccessibilityNodeInfo;
 import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
 
+import com.android.launcher3.AppInfo;
+import com.android.launcher3.AppWidgetResizeFrame;
+import com.android.launcher3.CellLayout;
+import com.android.launcher3.DeleteDropTarget;
+import com.android.launcher3.Folder;
+import com.android.launcher3.FolderInfo;
+import com.android.launcher3.InfoDropTarget;
+import com.android.launcher3.ItemInfo;
+import com.android.launcher3.Launcher;
+import com.android.launcher3.LauncherAppWidgetHostView;
+import com.android.launcher3.LauncherAppWidgetInfo;
+import com.android.launcher3.LauncherModel;
+import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.PendingAddItemInfo;
+import com.android.launcher3.R;
+import com.android.launcher3.ShortcutInfo;
+import com.android.launcher3.UninstallDropTarget;
+import com.android.launcher3.Workspace;
 import com.android.launcher3.util.Thunk;
 
 import java.util.ArrayList;
index 6f89d0e..80ddc13 100644 (file)
@@ -23,8 +23,7 @@ import com.android.launcher3.AppInfo;
 import com.android.launcher3.CellLayout;
 import com.android.launcher3.FolderInfo;
 import com.android.launcher3.ItemInfo;
-import com.android.launcher3.LauncherAccessibilityDelegate;
-import com.android.launcher3.LauncherAccessibilityDelegate.DragType;
+import com.android.launcher3.accessibility.LauncherAccessibilityDelegate.DragType;
 import com.android.launcher3.R;
 import com.android.launcher3.ShortcutInfo;