Loading res/values/config.xml +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ <!-- Various classes overriden by projects/build flavors. --> <string name="app_filter_class" translatable="false"></string> <string name="user_event_dispatcher_class" translatable="false"></string> <string name="folder_name_provider_class" translatable="false"></string> <string name="stats_log_manager_class" translatable="false"></string> <string name="app_transition_manager_class" translatable="false"></string> <string name="instant_app_resolver_class" translatable="false"></string> Loading src/com/android/launcher3/DropTarget.java +9 −1 Original line number Diff line number Diff line Loading @@ -16,11 +16,14 @@ package com.android.launcher3; import android.content.Context; import android.graphics.Rect; import com.android.launcher3.accessibility.DragViewStateAnnouncer; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dragndrop.DragOptions; import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.folder.FolderNameProvider; /** * Interface defining an object that can receive a drag. Loading Loading @@ -67,7 +70,12 @@ public interface DropTarget { public DragViewStateAnnouncer stateAnnouncer; public DragObject() { public FolderNameProvider folderNameProvider; public DragObject(Context context) { if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) { folderNameProvider = FolderNameProvider.newInstance(context); } } /** Loading src/com/android/launcher3/FolderInfo.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3; import android.content.Intent; import android.os.Process; import com.android.launcher3.model.ModelWriter; Loading Loading @@ -49,6 +50,8 @@ public class FolderInfo extends ItemInfo { public int options; public Intent suggestedFolderNames; /** * The apps and shortcuts */ Loading src/com/android/launcher3/Launcher.java +3 −8 Original line number Diff line number Diff line Loading @@ -103,7 +103,6 @@ import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.folder.FolderGridOrganizer; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.folder.FolderNameProvider; import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.icons.IconCache; import com.android.launcher3.keyboard.CustomActionsPopup; Loading Loading @@ -616,10 +615,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, return mStateManager; } public FolderNameProvider getFolderNameProvider() { return new FolderNameProvider(); } @Override public <T extends View> T findViewById(int id) { return mLauncherView.findViewById(id); Loading Loading @@ -1259,13 +1254,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, cellXY[1] = cellY; foundCellSpan = true; DragObject dragObject = new DragObject(getApplicationContext()); dragObject.dragInfo = info; // If appropriate, either create a folder or add to an existing folder if (mWorkspace.createUserFolderIfNecessary(view, container, layout, cellXY, 0, true, null)) { true, dragObject)) { return; } DragObject dragObject = new DragObject(); dragObject.dragInfo = info; if (mWorkspace.addToExistingFolderIfNecessary(view, layout, cellXY, 0, dragObject, true)) { return; Loading src/com/android/launcher3/Workspace.java +6 −7 Original line number Diff line number Diff line Loading @@ -1673,7 +1673,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> } boolean createUserFolderIfNecessary(View newView, int container, CellLayout target, int[] targetCell, float distance, boolean external, DragView dragView) { int[] targetCell, float distance, boolean external, DragObject d) { if (distance > mMaxDistanceForFolderCreation) return false; View v = target.getChildAt(targetCell[0], targetCell[1]); Loading Loading @@ -1711,14 +1711,13 @@ public class Workspace extends PagedView<WorkspacePageIndicator> sourceInfo.cellY = -1; // If the dragView is null, we can't animate boolean animate = dragView != null; boolean animate = d != null; if (animate) { // In order to keep everything continuous, we hand off the currently rendered // folder background to the newly created icon. This preserves animation state. fi.setFolderBackground(mFolderCreateBg); mFolderCreateBg = new PreviewBackground(); fi.performCreateAnimation(destInfo, v, sourceInfo, dragView, folderLocation, scale ); fi.performCreateAnimation(destInfo, v, sourceInfo, d, folderLocation, scale); } else { fi.prepareCreateAnimation(v); fi.addItem(destInfo); Loading Loading @@ -1799,8 +1798,8 @@ public class Workspace extends PagedView<WorkspacePageIndicator> // If the item being dropped is a shortcut and the nearest drop // cell also contains a shortcut, then create a folder with the two shortcuts. if (createUserFolderIfNecessary(cell, container, dropTargetLayout, mTargetCell, distance, false, d.dragView) || addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell, dropTargetLayout, mTargetCell, distance, false, d) || addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell, distance, d, false)) { mLauncher.getStateManager().goToState(NORMAL, SPRING_LOADED_EXIT_DELAY); return; Loading Loading @@ -2561,7 +2560,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> float distance = cellLayout.getDistanceFromCell(mDragViewVisualCenter[0], mDragViewVisualCenter[1], mTargetCell); if (createUserFolderIfNecessary(view, container, cellLayout, mTargetCell, distance, true, d.dragView)) { true, d)) { return; } if (addToExistingFolderIfNecessary(view, cellLayout, mTargetCell, distance, d, Loading Loading
res/values/config.xml +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ <!-- Various classes overriden by projects/build flavors. --> <string name="app_filter_class" translatable="false"></string> <string name="user_event_dispatcher_class" translatable="false"></string> <string name="folder_name_provider_class" translatable="false"></string> <string name="stats_log_manager_class" translatable="false"></string> <string name="app_transition_manager_class" translatable="false"></string> <string name="instant_app_resolver_class" translatable="false"></string> Loading
src/com/android/launcher3/DropTarget.java +9 −1 Original line number Diff line number Diff line Loading @@ -16,11 +16,14 @@ package com.android.launcher3; import android.content.Context; import android.graphics.Rect; import com.android.launcher3.accessibility.DragViewStateAnnouncer; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.dragndrop.DragOptions; import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.folder.FolderNameProvider; /** * Interface defining an object that can receive a drag. Loading Loading @@ -67,7 +70,12 @@ public interface DropTarget { public DragViewStateAnnouncer stateAnnouncer; public DragObject() { public FolderNameProvider folderNameProvider; public DragObject(Context context) { if (FeatureFlags.FOLDER_NAME_SUGGEST.get()) { folderNameProvider = FolderNameProvider.newInstance(context); } } /** Loading
src/com/android/launcher3/FolderInfo.java +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.launcher3; import android.content.Intent; import android.os.Process; import com.android.launcher3.model.ModelWriter; Loading Loading @@ -49,6 +50,8 @@ public class FolderInfo extends ItemInfo { public int options; public Intent suggestedFolderNames; /** * The apps and shortcuts */ Loading
src/com/android/launcher3/Launcher.java +3 −8 Original line number Diff line number Diff line Loading @@ -103,7 +103,6 @@ import com.android.launcher3.dragndrop.DragLayer; import com.android.launcher3.dragndrop.DragView; import com.android.launcher3.folder.FolderGridOrganizer; import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.folder.FolderNameProvider; import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.icons.IconCache; import com.android.launcher3.keyboard.CustomActionsPopup; Loading Loading @@ -616,10 +615,6 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, return mStateManager; } public FolderNameProvider getFolderNameProvider() { return new FolderNameProvider(); } @Override public <T extends View> T findViewById(int id) { return mLauncherView.findViewById(id); Loading Loading @@ -1259,13 +1254,13 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, cellXY[1] = cellY; foundCellSpan = true; DragObject dragObject = new DragObject(getApplicationContext()); dragObject.dragInfo = info; // If appropriate, either create a folder or add to an existing folder if (mWorkspace.createUserFolderIfNecessary(view, container, layout, cellXY, 0, true, null)) { true, dragObject)) { return; } DragObject dragObject = new DragObject(); dragObject.dragInfo = info; if (mWorkspace.addToExistingFolderIfNecessary(view, layout, cellXY, 0, dragObject, true)) { return; Loading
src/com/android/launcher3/Workspace.java +6 −7 Original line number Diff line number Diff line Loading @@ -1673,7 +1673,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> } boolean createUserFolderIfNecessary(View newView, int container, CellLayout target, int[] targetCell, float distance, boolean external, DragView dragView) { int[] targetCell, float distance, boolean external, DragObject d) { if (distance > mMaxDistanceForFolderCreation) return false; View v = target.getChildAt(targetCell[0], targetCell[1]); Loading Loading @@ -1711,14 +1711,13 @@ public class Workspace extends PagedView<WorkspacePageIndicator> sourceInfo.cellY = -1; // If the dragView is null, we can't animate boolean animate = dragView != null; boolean animate = d != null; if (animate) { // In order to keep everything continuous, we hand off the currently rendered // folder background to the newly created icon. This preserves animation state. fi.setFolderBackground(mFolderCreateBg); mFolderCreateBg = new PreviewBackground(); fi.performCreateAnimation(destInfo, v, sourceInfo, dragView, folderLocation, scale ); fi.performCreateAnimation(destInfo, v, sourceInfo, d, folderLocation, scale); } else { fi.prepareCreateAnimation(v); fi.addItem(destInfo); Loading Loading @@ -1799,8 +1798,8 @@ public class Workspace extends PagedView<WorkspacePageIndicator> // If the item being dropped is a shortcut and the nearest drop // cell also contains a shortcut, then create a folder with the two shortcuts. if (createUserFolderIfNecessary(cell, container, dropTargetLayout, mTargetCell, distance, false, d.dragView) || addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell, dropTargetLayout, mTargetCell, distance, false, d) || addToExistingFolderIfNecessary(cell, dropTargetLayout, mTargetCell, distance, d, false)) { mLauncher.getStateManager().goToState(NORMAL, SPRING_LOADED_EXIT_DELAY); return; Loading Loading @@ -2561,7 +2560,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator> float distance = cellLayout.getDistanceFromCell(mDragViewVisualCenter[0], mDragViewVisualCenter[1], mTargetCell); if (createUserFolderIfNecessary(view, container, cellLayout, mTargetCell, distance, true, d.dragView)) { true, d)) { return; } if (addToExistingFolderIfNecessary(view, cellLayout, mTargetCell, distance, d, Loading