diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-02-18 22:09:23 +0000 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-02-23 02:02:54 +0000 |
commit | 261194387beebaa7927ec4e310274218b651494d (patch) | |
tree | 31ebc51a25f275e9aa28129aca1ab3ed4c0cb85d | |
parent | 7de283a5ecb39bf1f264b5d0d8019b6fabdd6ae3 (diff) | |
download | android_packages_apps_Trebuchet-261194387beebaa7927ec4e310274218b651494d.tar.gz android_packages_apps_Trebuchet-261194387beebaa7927ec4e310274218b651494d.tar.bz2 android_packages_apps_Trebuchet-261194387beebaa7927ec4e310274218b651494d.zip |
Revert "Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage"
This reverts commit fc956e5a2a818c06ed3424e15b0aa20a3f604658.
Change-Id: Ib3b5156b8fc3cad35c4634d61d5390c848ce1f93
20 files changed, 89 insertions, 37 deletions
diff --git a/res/layout/folder_icon.xml b/res/layout/folder_icon.xml index 237af6890..b8d5c608b 100644 --- a/res/layout/folder_icon.xml +++ b/res/layout/folder_icon.xml @@ -14,7 +14,7 @@ limitations under the License. --> -<com.android.launcher3.FolderIcon +<com.android.launcher3.folder.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.FolderIcon> +</com.android.launcher3.folder.FolderIcon> diff --git a/res/layout/user_folder.xml b/res/layout/user_folder.xml index 719c0c28f..87a42145d 100644 --- a/res/layout/user_folder.xml +++ b/res/layout/user_folder.xml @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<com.android.launcher3.Folder xmlns:android="http://schemas.android.com/apk/res/android" +<com.android.launcher3.folder.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>
\ No newline at end of file +</com.android.launcher3.folder.Folder>
\ No newline at end of file diff --git a/res/layout/user_folder_icon_normalized.xml b/res/layout/user_folder_icon_normalized.xml index 80793db20..d445a7ae3 100644 --- a/res/layout/user_folder_icon_normalized.xml +++ b/res/layout/user_folder_icon_normalized.xml @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -<com.android.launcher3.Folder xmlns:android="http://schemas.android.com/apk/res/android" +<com.android.launcher3.folder.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> +</com.android.launcher3.folder.Folder> diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index cc6df599a..dddd826c4 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -40,6 +40,7 @@ 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; diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 9370e57b5..5832b9f0d 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -32,6 +32,7 @@ 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; @@ -53,7 +54,8 @@ 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.FolderIcon.FolderRingAnimator; +import com.android.launcher3.folder.FolderIcon; +import com.android.launcher3.folder.FolderIcon.FolderRingAnimator; import com.android.launcher3.util.ParcelableSparseArray; import com.android.launcher3.util.Thunk; diff --git a/src/com/android/launcher3/DeleteDropTarget.java b/src/com/android/launcher3/DeleteDropTarget.java index 173e6ab65..997ded2d3 100644 --- a/src/com/android/launcher3/DeleteDropTarget.java +++ b/src/com/android/launcher3/DeleteDropTarget.java @@ -24,6 +24,7 @@ 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; diff --git a/src/com/android/launcher3/FocusHelper.java b/src/com/android/launcher3/FocusHelper.java index 95b562328..f99c08a59 100644 --- a/src/com/android/launcher3/FocusHelper.java +++ b/src/com/android/launcher3/FocusHelper.java @@ -23,6 +23,7 @@ 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; diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 7b53f9f8d..406a6f563 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -107,6 +107,8 @@ 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.userevent.Logger; import com.android.launcher3.util.ComponentKey; diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index dcfd65b82..f707ec501 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -57,6 +57,8 @@ 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; diff --git a/src/com/android/launcher3/ShortcutInfo.java b/src/com/android/launcher3/ShortcutInfo.java index 9c6d71b37..128d695eb 100644 --- a/src/com/android/launcher3/ShortcutInfo.java +++ b/src/com/android/launcher3/ShortcutInfo.java @@ -21,11 +21,15 @@ 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. diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 05f9d20c5..840f9f2fa 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -53,7 +53,9 @@ import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.widget.TextView; -import com.android.launcher3.FolderIcon.FolderRingAnimator; +import com.android.launcher3.folder.Folder; +import com.android.launcher3.folder.FolderIcon; +import com.android.launcher3.folder.FolderIcon.FolderRingAnimator; import com.android.launcher3.Launcher.CustomContentCallbacks; import com.android.launcher3.Launcher.LauncherOverlay; import com.android.launcher3.UninstallDropTarget.UninstallSource; diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java index 03731d175..8560b2167 100644 --- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java +++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java @@ -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; +import com.android.launcher3.folder.Folder; import com.android.launcher3.FolderInfo; import com.android.launcher3.InfoDropTarget; import com.android.launcher3.ItemInfo; diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 22af94c74..013bd8ccc 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -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; +import com.android.launcher3.folder.Folder; import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherTransitionable; diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 743ba3705..3128db21e 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -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; -import com.android.launcher3.FolderIcon; +import com.android.launcher3.folder.Folder; +import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.util.Thunk; import java.util.ArrayList; diff --git a/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java b/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java index b73c04f81..44d7ac6e9 100644 --- a/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java +++ b/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java @@ -1,12 +1,15 @@ package com.android.launcher3.folder; import android.graphics.Path; +import android.graphics.Point; -import com.android.launcher3.FolderIcon; +import com.android.launcher3.DeviceProfile; +import com.android.launcher3.LauncherAppState; +import com.android.launcher3.Utilities; public class ClippedFolderIconLayoutRule implements FolderIcon.PreviewLayoutRule { - public static final int MAX_NUM_ITEMS_IN_PREVIEW = 4; + 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; diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/folder/Folder.java index f84bee27b..a411c481c 100644 --- a/src/com/android/launcher3/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.launcher3; +package com.android.launcher3.folder; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -52,16 +52,34 @@ 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; @@ -121,15 +139,13 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList private final InputMethodManager mInputMethodManager; - public final Launcher mLauncher; + protected 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; diff --git a/src/com/android/launcher3/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index d61022f4d..5c084d949 100644 --- a/src/com/android/launcher3/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.launcher3; +package com.android.launcher3.folder; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -42,13 +42,33 @@ 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; @@ -519,18 +539,18 @@ public class FolderIcon extends FrameLayout implements FolderListener { computePreviewDrawingParams(d.getIntrinsicWidth(), getMeasuredWidth()); } - public static class PreviewItemDrawingParams { - public PreviewItemDrawingParams(float transX, float transY, float scale, float overlayAlpha) { + static class PreviewItemDrawingParams { + PreviewItemDrawingParams(float transX, float transY, float scale, float overlayAlpha) { this.transX = transX; this.transY = transY; this.scale = scale; this.overlayAlpha = overlayAlpha; } - public float transX; - public float transY; - public float scale; - public float overlayAlpha; - public Drawable drawable; + float transX; + float transY; + float scale; + float overlayAlpha; + Drawable drawable; } private float getLocalCenterForIndex(int index, int curNumItems, int[] center) { diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java index 7fc5d2b04..c25444e06 100644 --- a/src/com/android/launcher3/folder/FolderPagedView.java +++ b/src/com/android/launcher3/folder/FolderPagedView.java @@ -33,8 +33,6 @@ 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; diff --git a/src/com/android/launcher3/folder/StackFolderIconLayoutRule.java b/src/com/android/launcher3/folder/StackFolderIconLayoutRule.java index 01eeecd43..87f5f897b 100644 --- a/src/com/android/launcher3/folder/StackFolderIconLayoutRule.java +++ b/src/com/android/launcher3/folder/StackFolderIconLayoutRule.java @@ -18,12 +18,11 @@ package com.android.launcher3.folder; import android.graphics.Path; -import com.android.launcher3.FolderIcon; -import com.android.launcher3.FolderIcon.PreviewItemDrawingParams; +import com.android.launcher3.folder.FolderIcon.PreviewItemDrawingParams; public class StackFolderIconLayoutRule implements FolderIcon.PreviewLayoutRule { - public static final int MAX_NUM_ITEMS_IN_PREVIEW = 3; + 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) diff --git a/src/com/android/launcher3/widget/WidgetsContainerView.java b/src/com/android/launcher3/widget/WidgetsContainerView.java index a87c932bc..4c901c2be 100644 --- a/src/com/android/launcher3/widget/WidgetsContainerView.java +++ b/src/com/android/launcher3/widget/WidgetsContainerView.java @@ -20,6 +20,7 @@ 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; @@ -33,7 +34,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; +import com.android.launcher3.folder.Folder; import com.android.launcher3.IconCache; import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; |