UserFolderpublic class UserFolder extends Folder implements DropTargetFolder which contains applications or shortcuts chosen by the user. |
Methods Summary |
---|
public boolean | acceptDrop(DragSource source, int x, int y, int xOffset, int yOffset, java.lang.Object dragInfo)
final ItemInfo item = (ItemInfo) dragInfo;
final int itemType = item.itemType;
return (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION ||
itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) && item.container != mInfo.id;
| void | bind(FolderInfo info)
super.bind(info);
setContentAdapter(new ApplicationsAdapter(mContext, ((UserFolderInfo) info).contents));
| static com.android.launcher.UserFolder | fromXml(android.content.Context context)Creates a new UserFolder, inflated from R.layout.user_folder.
return (UserFolder) LayoutInflater.from(context).inflate(R.layout.user_folder, null);
| public void | onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset, java.lang.Object dragInfo)
| public void | onDragExit(DragSource source, int x, int y, int xOffset, int yOffset, java.lang.Object dragInfo)
| public void | onDragOver(DragSource source, int x, int y, int xOffset, int yOffset, java.lang.Object dragInfo)
| public void | onDrop(DragSource source, int x, int y, int xOffset, int yOffset, java.lang.Object dragInfo)
final ApplicationInfo item = (ApplicationInfo) dragInfo;
//noinspection unchecked
((ArrayAdapter<ApplicationInfo>) mContent.getAdapter()).add((ApplicationInfo) dragInfo);
LauncherModel.addOrMoveItemInDatabase(mLauncher, item, mInfo.id, 0, 0, 0);
| public void | onDropCompleted(android.view.View target, boolean success)
if (success) {
//noinspection unchecked
ArrayAdapter<ApplicationInfo> adapter =
(ArrayAdapter<ApplicationInfo>) mContent.getAdapter();
adapter.remove(mDragItem);
}
| void | onOpen()
super.onOpen();
requestFocus();
|
|