diff options
author | Patrick Dubroy <dubroy@google.com> | 2010-08-17 15:11:18 -0700 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2010-08-18 17:57:59 -0700 |
commit | 4ed6278e518cc6894cb150b606382e8e6a012599 (patch) | |
tree | cc6c7fac56a0ac8bde4004c4f1dc868f170e5dbd /src/com/android/launcher2/Launcher.java | |
parent | f07e7a441c5de51d095f54d2735b7c028f217e8e (diff) | |
download | android_packages_apps_Trebuchet-4ed6278e518cc6894cb150b606382e8e6a012599.tar.gz android_packages_apps_Trebuchet-4ed6278e518cc6894cb150b606382e8e6a012599.tar.bz2 android_packages_apps_Trebuchet-4ed6278e518cc6894cb150b606382e8e6a012599.zip |
Implement button to get application info for an app shortcut.
For now, it's just a drag target like the delete zone. Once all apps
and the home screen support a selection mode, this (and delete) will
be implemented as buttons in the Contextual Action Bar.
Change-Id: I6bf43d03eefda672ea34c583a7021137da22b184
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index b5d0dbb5d..ebe9baada 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -16,6 +16,9 @@ package com.android.launcher2; +import com.android.common.Search; +import com.android.launcher.R; + import android.animation.Animatable; import android.animation.AnimatableListenerAdapter; import android.animation.Animator; @@ -58,6 +61,7 @@ import android.os.Parcelable; import android.os.SystemClock; import android.os.SystemProperties; import android.provider.LiveFolders; +import android.provider.Settings; import android.text.Selection; import android.text.SpannableStringBuilder; import android.text.TextUtils; @@ -89,8 +93,14 @@ import android.widget.TabHost.TabContentFactory; import android.widget.TabWidget; import android.widget.TextView; import android.widget.Toast; -import com.android.common.Search; -import com.android.launcher.R; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -875,20 +885,31 @@ public final class Launcher extends Activity deleteZone.setDragController(dragController); int deleteZoneHandleId; if (LauncherApplication.isScreenXLarge()) { - deleteZoneHandleId = R.id.configure_button; + deleteZoneHandleId = R.id.all_apps_button; } else { deleteZoneHandleId = R.id.all_apps_button_cluster; } deleteZone.setHandle(findViewById(deleteZoneHandleId)); + dragController.addDragListener(deleteZone); + + ApplicationInfoDropTarget infoButton = (ApplicationInfoDropTarget)findViewById(R.id.info_button); + if (infoButton != null) { + infoButton.setLauncher(this); + infoButton.setHandle(findViewById(R.id.configure_button)); + infoButton.setDragColor(getResources().getColor(R.color.app_info_filter)); + dragController.addDragListener(infoButton); + } dragController.setDragScoller(workspace); - dragController.setDragListener(deleteZone); dragController.setScrollView(dragLayer); dragController.setMoveTarget(workspace); // The order here is bottom to top. dragController.addDropTarget(workspace); dragController.addDropTarget(deleteZone); + if (infoButton != null) { + dragController.addDropTarget(infoButton); + } } @SuppressWarnings({"UnusedDeclaration"}) @@ -1686,6 +1707,12 @@ public final class Launcher extends Activity showAllApps(true); } + void startApplicationDetailsActivity(String packageName) { + Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, + Uri.fromParts("package", packageName, null)); + startActivity(intent); + } + void startActivitySafely(Intent intent, Object tag) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { |