feat : Initial implementation Caddy (#5166)

- Introduced "Caddy" functionality to organize apps within the app drawer.
- Allows grouping of applications for better accessibility and user experience.
- Serves as a foundational feature for enhancing app drawer usability.
This commit is contained in:
John Andrew Camu
2025-01-15 13:01:51 +08:00
committed by GitHub
parent f96ffc9cd4
commit 448d718e6a
16 changed files with 383 additions and 16 deletions
+8 -2
View File
@@ -403,6 +403,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
if (dragObject.dragSource != this) {
return;
}
if (isInAppDrawer()) close(true);
mContent.removeItem(mCurrentDragView);
mItemsInvalidated = true;
@@ -415,6 +417,10 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
mItemAddedBackToSelfViaIcon = false;
}
public boolean isInAppDrawer() {
return mInfo.container == ItemInfo.NO_ID;
}
@Override
public void onDragEnd() {
if (mIsExternalDrag && mIsDragInProgress) {
@@ -583,7 +589,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
}
// In case any children didn't come across during loading, clean up the folder accordingly
mFolderIcon.post(() -> {
if (getItemCount() <= 1) {
if (getItemCount() <= 1 && !isInAppDrawer()) {
replaceFolderWithFinalItem();
}
});
@@ -971,7 +977,7 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
mRearrangeOnClose = false;
}
if (getItemCount() <= 1) {
if (!mIsDragInProgress && !mSuppressFolderDeletion) {
if (!mIsDragInProgress && !mSuppressFolderDeletion && !isInAppDrawer()) {
replaceFolderWithFinalItem();
} else if (mIsDragInProgress) {
mDeleteFolderOnDropCompleted = true;