OSDN Git Service

Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage
authorSunny Goyal <sunnygoyal@google.com>
Wed, 17 Feb 2016 21:24:20 +0000 (13:24 -0800)
committerSunny Goyal <sunnygoyal@google.com>
Wed, 17 Feb 2016 21:27:13 +0000 (13:27 -0800)
Change-Id: Ifd0d717d70aff4c83c9eb5cba397d04500b2c869

20 files changed:
res/layout/folder_icon.xml
res/layout/user_folder.xml
res/layout/user_folder_icon_normalized.xml
src/com/android/launcher3/BubbleTextView.java
src/com/android/launcher3/CellLayout.java
src/com/android/launcher3/DeleteDropTarget.java
src/com/android/launcher3/FocusHelper.java
src/com/android/launcher3/Folder.java [moved from src/com/android/launcher3/folder/Folder.java with 98% similarity]
src/com/android/launcher3/FolderIcon.java [moved from src/com/android/launcher3/folder/FolderIcon.java with 95% similarity]
src/com/android/launcher3/Launcher.java
src/com/android/launcher3/LauncherModel.java
src/com/android/launcher3/ShortcutInfo.java
src/com/android/launcher3/Workspace.java
src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
src/com/android/launcher3/allapps/AllAppsContainerView.java
src/com/android/launcher3/dragndrop/DragLayer.java
src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java
src/com/android/launcher3/folder/FolderPagedView.java
src/com/android/launcher3/folder/StackFolderIconLayoutRule.java
src/com/android/launcher3/widget/WidgetsContainerView.java

index b8d5c60..237af68 100644 (file)
@@ -14,7 +14,7 @@
      limitations under the License.
 -->
 
-<com.android.launcher3.folder.FolderIcon
+<com.android.launcher3.FolderIcon
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
@@ -33,4 +33,4 @@
         android:layout_gravity="top"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />
-</com.android.launcher3.folder.FolderIcon>
+</com.android.launcher3.FolderIcon>
index 87a4214..719c0c2 100644 (file)
@@ -14,7 +14,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<com.android.launcher3.folder.Folder xmlns:android="http://schemas.android.com/apk/res/android"
+<com.android.launcher3.Folder xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:launcher="http://schemas.android.com/apk/res-auto"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
@@ -81,4 +81,4 @@
 
     </LinearLayout>
 
-</com.android.launcher3.folder.Folder>
\ No newline at end of file
+</com.android.launcher3.Folder>
\ No newline at end of file
index d445a7a..80793db 100644 (file)
@@ -14,7 +14,7 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<com.android.launcher3.folder.Folder xmlns:android="http://schemas.android.com/apk/res/android"
+<com.android.launcher3.Folder xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:launcher="http://schemas.android.com/apk/res-auto"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
@@ -82,4 +82,4 @@
 
     </LinearLayout>
 
-</com.android.launcher3.folder.Folder>
+</com.android.launcher3.Folder>
index dddd826..cc6df59 100644 (file)
@@ -40,7 +40,6 @@ import android.view.ViewParent;
 import android.widget.TextView;
 
 import com.android.launcher3.IconCache.IconLoadRequest;
-import com.android.launcher3.folder.FolderIcon;
 import com.android.launcher3.model.PackageItemInfo;
 
 import java.text.NumberFormat;
index 5832b9f..9370e57 100644 (file)
@@ -32,7 +32,6 @@ import android.graphics.Point;
 import android.graphics.Rect;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
-import android.graphics.drawable.GradientDrawable;
 import android.graphics.drawable.TransitionDrawable;
 import android.os.Build;
 import android.os.Parcelable;
@@ -54,8 +53,7 @@ import com.android.launcher3.accessibility.FolderAccessibilityHelper;
 import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.config.ProviderConfig;
-import com.android.launcher3.folder.FolderIcon;
-import com.android.launcher3.folder.FolderIcon.FolderRingAnimator;
+import com.android.launcher3.FolderIcon.FolderRingAnimator;
 import com.android.launcher3.util.ParcelableSparseArray;
 import com.android.launcher3.util.Thunk;
 
index 997ded2..173e6ab 100644 (file)
@@ -24,7 +24,6 @@ import android.view.View;
 import android.view.animation.AnimationUtils;
 
 import com.android.launcher3.dragndrop.DragLayer;
-import com.android.launcher3.folder.Folder;
 import com.android.launcher3.util.FlingAnimation;
 import com.android.launcher3.util.Thunk;
 
index f99c08a..95b5623 100644 (file)
@@ -23,7 +23,6 @@ import android.view.View;
 import android.view.ViewGroup;
 
 import com.android.launcher3.config.ProviderConfig;
-import com.android.launcher3.folder.Folder;
 import com.android.launcher3.folder.FolderPagedView;
 import com.android.launcher3.util.FocusLogic;
 import com.android.launcher3.util.Thunk;
similarity index 98%
rename from src/com/android/launcher3/folder/Folder.java
rename to src/com/android/launcher3/Folder.java
index a411c48..f84bee2 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.launcher3.folder;
+package com.android.launcher3;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
@@ -52,34 +52,16 @@ import android.view.inputmethod.InputMethodManager;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
-import com.android.launcher3.Alarm;
-import com.android.launcher3.CellLayout;
 import com.android.launcher3.CellLayout.CellInfo;
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.DragSource;
-import com.android.launcher3.DropTarget;
-import com.android.launcher3.ExtendedEditText;
-import com.android.launcher3.FolderInfo;
 import com.android.launcher3.FolderInfo.FolderListener;
-import com.android.launcher3.ItemInfo;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherAnimUtils;
-import com.android.launcher3.LauncherModel;
-import com.android.launcher3.LauncherSettings;
-import com.android.launcher3.LogDecelerateInterpolator;
-import com.android.launcher3.OnAlarmListener;
-import com.android.launcher3.R;
-import com.android.launcher3.ShortcutInfo;
-import com.android.launcher3.Stats;
 import com.android.launcher3.UninstallDropTarget.UninstallSource;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.Workspace;
 import com.android.launcher3.Workspace.ItemOperator;
 import com.android.launcher3.accessibility.LauncherAccessibilityDelegate.AccessibilityDragSource;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.dragndrop.DragController;
 import com.android.launcher3.dragndrop.DragController.DragListener;
 import com.android.launcher3.dragndrop.DragLayer;
+import com.android.launcher3.folder.FolderPagedView;
 import com.android.launcher3.util.Thunk;
 import com.android.launcher3.util.UiThreadCircularReveal;
 
@@ -139,13 +121,15 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList
 
     private final InputMethodManager mInputMethodManager;
 
-    protected final Launcher mLauncher;
+    public final Launcher mLauncher;
     protected DragController mDragController;
     public FolderInfo mInfo;
 
-    @Thunk FolderIcon mFolderIcon;
+    @Thunk
+    FolderIcon mFolderIcon;
 
-    @Thunk FolderPagedView mContent;
+    @Thunk
+    FolderPagedView mContent;
     @Thunk View mContentWrapper;
     public ExtendedEditText mFolderName;
 
similarity index 95%
rename from src/com/android/launcher3/folder/FolderIcon.java
rename to src/com/android/launcher3/FolderIcon.java
index 5c084d9..d61022f 100644 (file)
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package com.android.launcher3.folder;
+package com.android.launcher3;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
@@ -42,33 +42,13 @@ import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.TextView;
 
-import com.android.launcher3.Alarm;
-import com.android.launcher3.AppInfo;
-import com.android.launcher3.BubbleTextView;
-import com.android.launcher3.CellLayout;
-import com.android.launcher3.CheckLongPressHelper;
-import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.DropTarget.DragObject;
-import com.android.launcher3.FastBitmapDrawable;
-import com.android.launcher3.FolderInfo;
 import com.android.launcher3.FolderInfo.FolderListener;
-import com.android.launcher3.IconCache;
-import com.android.launcher3.ItemInfo;
-import com.android.launcher3.Launcher;
-import com.android.launcher3.LauncherAnimUtils;
-import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.LauncherSettings;
-import com.android.launcher3.OnAlarmListener;
-import com.android.launcher3.PreloadIconDrawable;
-import com.android.launcher3.R;
-import com.android.launcher3.ShortcutInfo;
-import com.android.launcher3.SimpleOnStylusPressListener;
-import com.android.launcher3.StylusEventHelper;
-import com.android.launcher3.Utilities;
-import com.android.launcher3.Workspace;
 import com.android.launcher3.config.FeatureFlags;
 import com.android.launcher3.dragndrop.DragLayer;
 import com.android.launcher3.dragndrop.DragView;
+import com.android.launcher3.folder.ClippedFolderIconLayoutRule;
+import com.android.launcher3.folder.StackFolderIconLayoutRule;
 import com.android.launcher3.util.Thunk;
 
 import java.util.ArrayList;
@@ -539,18 +519,18 @@ public class FolderIcon extends FrameLayout implements FolderListener {
         computePreviewDrawingParams(d.getIntrinsicWidth(), getMeasuredWidth());
     }
 
-    static class PreviewItemDrawingParams {
-        PreviewItemDrawingParams(float transX, float transY, float scale, float overlayAlpha) {
+    public static class PreviewItemDrawingParams {
+        public PreviewItemDrawingParams(float transX, float transY, float scale, float overlayAlpha) {
             this.transX = transX;
             this.transY = transY;
             this.scale = scale;
             this.overlayAlpha = overlayAlpha;
         }
-        float transX;
-        float transY;
-        float scale;
-        float overlayAlpha;
-        Drawable drawable;
+        public float transX;
+        public float transY;
+        public float scale;
+        public float overlayAlpha;
+        public Drawable drawable;
     }
 
     private float getLocalCenterForIndex(int index, int curNumItems, int[] center) {
index 545768f..bda0ad9 100644 (file)
@@ -107,8 +107,6 @@ import com.android.launcher3.config.ProviderConfig;
 import com.android.launcher3.dragndrop.DragController;
 import com.android.launcher3.dragndrop.DragLayer;
 import com.android.launcher3.dragndrop.DragView;
-import com.android.launcher3.folder.Folder;
-import com.android.launcher3.folder.FolderIcon;
 import com.android.launcher3.model.WidgetsModel;
 import com.android.launcher3.util.ComponentKey;
 import com.android.launcher3.util.LongArrayMap;
index f707ec5..dcfd65b 100644 (file)
@@ -57,8 +57,6 @@ import com.android.launcher3.compat.PackageInstallerCompat.PackageInstallInfo;
 import com.android.launcher3.compat.UserHandleCompat;
 import com.android.launcher3.compat.UserManagerCompat;
 import com.android.launcher3.config.ProviderConfig;
-import com.android.launcher3.folder.Folder;
-import com.android.launcher3.folder.FolderIcon;
 import com.android.launcher3.model.GridSizeMigrationTask;
 import com.android.launcher3.model.WidgetsModel;
 import com.android.launcher3.util.ComponentKey;
index 128d695..9c6d71b 100644 (file)
@@ -21,15 +21,11 @@ import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.Bitmap;
-import android.util.Log;
 
 import com.android.launcher3.LauncherSettings.Favorites;
 import com.android.launcher3.compat.LauncherActivityInfoCompat;
 import com.android.launcher3.compat.UserHandleCompat;
 import com.android.launcher3.compat.UserManagerCompat;
-import com.android.launcher3.folder.FolderIcon;
-
-import java.util.ArrayList;
 
 /**
  * Represents a launchable icon on the workspaces and in folders.
index 5d2f451..e6ab111 100644 (file)
@@ -53,9 +53,7 @@ import android.view.ViewGroup;
 import android.view.accessibility.AccessibilityManager;
 import android.widget.TextView;
 
-import com.android.launcher3.folder.Folder;
-import com.android.launcher3.folder.FolderIcon;
-import com.android.launcher3.folder.FolderIcon.FolderRingAnimator;
+import com.android.launcher3.FolderIcon.FolderRingAnimator;
 import com.android.launcher3.Launcher.CustomContentCallbacks;
 import com.android.launcher3.Launcher.LauncherOverlay;
 import com.android.launcher3.UninstallDropTarget.UninstallSource;
index 8560b21..03731d1 100644 (file)
@@ -21,7 +21,7 @@ import com.android.launcher3.AppWidgetResizeFrame;
 import com.android.launcher3.CellLayout;
 import com.android.launcher3.DeleteDropTarget;
 import com.android.launcher3.DragSource;
-import com.android.launcher3.folder.Folder;
+import com.android.launcher3.Folder;
 import com.android.launcher3.FolderInfo;
 import com.android.launcher3.InfoDropTarget;
 import com.android.launcher3.ItemInfo;
index 36acede..920e954 100644 (file)
@@ -40,7 +40,7 @@ import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.DragSource;
 import com.android.launcher3.DropTarget;
 import com.android.launcher3.ExtendedEditText;
-import com.android.launcher3.folder.Folder;
+import com.android.launcher3.Folder;
 import com.android.launcher3.ItemInfo;
 import com.android.launcher3.Launcher;
 import com.android.launcher3.LauncherTransitionable;
index 3128db2..743ba37 100644 (file)
@@ -53,8 +53,8 @@ import com.android.launcher3.ShortcutAndWidgetContainer;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.Workspace;
 import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
-import com.android.launcher3.folder.Folder;
-import com.android.launcher3.folder.FolderIcon;
+import com.android.launcher3.Folder;
+import com.android.launcher3.FolderIcon;
 import com.android.launcher3.util.Thunk;
 
 import java.util.ArrayList;
index 44d7ac6..b73c04f 100644 (file)
@@ -1,15 +1,12 @@
 package com.android.launcher3.folder;
 
 import android.graphics.Path;
-import android.graphics.Point;
 
-import com.android.launcher3.DeviceProfile;
-import com.android.launcher3.LauncherAppState;
-import com.android.launcher3.Utilities;
+import com.android.launcher3.FolderIcon;
 
 public class ClippedFolderIconLayoutRule implements FolderIcon.PreviewLayoutRule {
 
-    static final int MAX_NUM_ITEMS_IN_PREVIEW = 4;
+    public static final int MAX_NUM_ITEMS_IN_PREVIEW = 4;
     private static final int MIN_NUM_ITEMS_IN_PREVIEW = 2;
 
     final float MIN_SCALE = 0.48f;
index c25444e..7fc5d2b 100644 (file)
@@ -33,6 +33,8 @@ import com.android.launcher3.CellLayout;
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.FocusHelper.PagedFolderKeyEventListener;
 import com.android.launcher3.FocusIndicatorView;
+import com.android.launcher3.Folder;
+import com.android.launcher3.FolderIcon;
 import com.android.launcher3.IconCache;
 import com.android.launcher3.InvariantDeviceProfile;
 import com.android.launcher3.ItemInfo;
index 87f5f89..01eeecd 100644 (file)
@@ -18,11 +18,12 @@ package com.android.launcher3.folder;
 
 import android.graphics.Path;
 
-import com.android.launcher3.folder.FolderIcon.PreviewItemDrawingParams;
+import com.android.launcher3.FolderIcon;
+import com.android.launcher3.FolderIcon.PreviewItemDrawingParams;
 
 public class StackFolderIconLayoutRule implements FolderIcon.PreviewLayoutRule {
 
-    static final int MAX_NUM_ITEMS_IN_PREVIEW = 3;
+    public static final int MAX_NUM_ITEMS_IN_PREVIEW = 3;
 
     // The degree to which the item in the back of the stack is scaled [0...1]
     // (0 means it's not scaled at all, 1 means it's scaled to nothing)
index 7ad478e..9a0c50b 100644 (file)
@@ -20,7 +20,6 @@ import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
-import android.graphics.drawable.InsetDrawable;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView.State;
 import android.util.AttributeSet;
@@ -34,7 +33,7 @@ import com.android.launcher3.DeleteDropTarget;
 import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.DragSource;
 import com.android.launcher3.DropTarget.DragObject;
-import com.android.launcher3.folder.Folder;
+import com.android.launcher3.Folder;
 import com.android.launcher3.IconCache;
 import com.android.launcher3.ItemInfo;
 import com.android.launcher3.Launcher;