diff options
author | Michael Jurka <mikejurka@google.com> | 2010-06-30 17:07:39 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2010-07-09 11:56:45 -0700 |
commit | 0e26059548e429e5d1c973bebe4c561bead2926f (patch) | |
tree | 8bc1651ad477ff860082fffd383e971b724ba649 /src/com/android/launcher2/FolderChooser.java | |
parent | 1bdb9d346779ff5fa7cb6b9bff512f3caa06a896 (diff) | |
download | android_packages_apps_Trebuchet-0e26059548e429e5d1c973bebe4c561bead2926f.tar.gz android_packages_apps_Trebuchet-0e26059548e429e5d1c973bebe4c561bead2926f.tar.bz2 android_packages_apps_Trebuchet-0e26059548e429e5d1c973bebe4c561bead2926f.zip |
Improving home screen customization
- Created a drawer with tabs for widgets, folders, shortcuts, wallpapers
(wallpapers are currently not implemented)
- Tapping outside the drawer dismisses it
- Moved the all apps icon to the upper right of the screen
- Adding a toast that says "No more space on screen" when dragging a widget to a full screen
- Fixed bug where you could stack two equal-sized widgets on top of each other on the homescreen (exposed by the new ability to drag widgets onto the home screen)
Change-Id: I03b65ce54a85d24328c94e0c06e249571de449ee
Diffstat (limited to 'src/com/android/launcher2/FolderChooser.java')
-rw-r--r-- | src/com/android/launcher2/FolderChooser.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/com/android/launcher2/FolderChooser.java b/src/com/android/launcher2/FolderChooser.java new file mode 100644 index 000000000..b152ad5f5 --- /dev/null +++ b/src/com/android/launcher2/FolderChooser.java @@ -0,0 +1,37 @@ +package com.android.launcher2; + +import com.android.launcher.R; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ResolveInfo; +import android.provider.LiveFolders; +import android.util.AttributeSet; +import android.view.View; +import android.widget.AdapterView; + +public class FolderChooser extends HomeCustomizationItemGallery { + + public FolderChooser(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { + // todo: this code sorta overlaps with other places + ResolveInfo info = (ResolveInfo)getAdapter().getItem(position); + mLauncher.prepareAddItemFromHomeCustomizationDrawer(); + + Intent createFolderIntent = new Intent(LiveFolders.ACTION_CREATE_LIVE_FOLDER); + if (info.labelRes == R.string.group_folder) { + // Create app shortcuts is a special built-in case of shortcuts + createFolderIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getContext().getString(R.string.group_folder)); + } else { + ComponentName name = new ComponentName(info.activityInfo.packageName, info.activityInfo.name); + createFolderIntent.setComponent(name); + } + mLauncher.addLiveFolder(createFolderIntent); + + return true; + } +} |