diff options
author | Winson Chung <winsonc@google.com> | 2011-06-02 10:53:07 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-06-02 11:00:52 -0700 |
commit | d2e87b32dc8c09590dd1ae186e97d3260955a568 (patch) | |
tree | 4b2480ba8ccdbe2620e1daae440c89202889958e /src | |
parent | e934f87c6adc29c84ea96c608db4e4e5dd6b4046 (diff) | |
download | android_packages_apps_Trebuchet-d2e87b32dc8c09590dd1ae186e97d3260955a568.tar.gz android_packages_apps_Trebuchet-d2e87b32dc8c09590dd1ae186e97d3260955a568.tar.bz2 android_packages_apps_Trebuchet-d2e87b32dc8c09590dd1ae186e97d3260955a568.zip |
Fixing regression in shop icon and widget pane.
Change-Id: I79a17581df2ba17c309626dde33c946855b2d55e
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizePagedView.java | 47 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 5 |
2 files changed, 16 insertions, 36 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java index 401e8addf..eb8b2f820 100644 --- a/src/com/android/launcher2/AppsCustomizePagedView.java +++ b/src/com/android/launcher2/AppsCustomizePagedView.java @@ -21,13 +21,12 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import org.xmlpull.v1.XmlPullParser; - import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; +import android.animation.ValueAnimator; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProviderInfo; import android.content.ComponentName; @@ -38,7 +37,6 @@ import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.Resources; import android.content.res.TypedArray; -import android.content.res.XmlResourceParser; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Canvas; @@ -47,9 +45,6 @@ import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.Log; import android.util.LruCache; -import android.util.Slog; -import android.util.TypedValue; -import android.util.Xml; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -299,31 +294,21 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen } }); } else if (v instanceof PagedViewWidget) { - // Add the widget to the current workspace screen - Workspace w = mLauncher.getWorkspace(); - int currentWorkspaceScreen = mLauncher.getCurrentWorkspaceScreen(); - final CellLayout cl = (CellLayout) w.getChildAt(currentWorkspaceScreen); - final View dragView = v.findViewById(R.id.widget_preview); - final ItemInfo itemInfo = (ItemInfo) v.getTag(); - animateClickFeedback(v, new Runnable() { - @Override - public void run() { - cl.calculateSpans(itemInfo); - if (cl.findCellForSpan(null, itemInfo.spanX, itemInfo.spanY)) { - if (LauncherApplication.isScreenLarge()) { - animateItemOntoScreen(dragView, cl, itemInfo); - } else { - mLauncher.addExternalItemToScreen(itemInfo, cl); - itemInfo.dropPos = null; - } - - // Hide the pane so we can see the workspace we dropped on - mLauncher.showWorkspace(true); - } else { - mLauncher.showOutOfSpaceMessage(); - } - } - }); + // Let the user know that they have to long press to add a widget + Toast.makeText(getContext(), R.string.long_press_widget_to_add, + Toast.LENGTH_SHORT).show(); + + // Create a little animation to show that the widget can move + float offsetY = getResources().getDimensionPixelSize(R.dimen.dragViewOffsetY); + final ImageView p = (ImageView) v.findViewById(R.id.widget_preview); + AnimatorSet bounce = new AnimatorSet(); + ValueAnimator tyuAnim = ObjectAnimator.ofFloat(p, "translationY", offsetY); + tyuAnim.setDuration(125); + ValueAnimator tydAnim = ObjectAnimator.ofFloat(p, "translationY", 0f); + tydAnim.setDuration(100); + bounce.play(tyuAnim).before(tydAnim); + bounce.setInterpolator(new AccelerateInterpolator()); + bounce.start(); } } diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 48869d3ce..eb533fe60 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -950,11 +950,6 @@ public final class Launcher extends Activity // Setup the AllApps Market toolbar button View marketButton = findViewById(R.id.market_button); allAppsInfoTarget.setOverlappingView(marketButton); - marketButton.setOnClickListener(new OnClickListener() { - public void onClick(View v) { - onClickAppMarketButton(v); - } - }); } else { // Get the search/delete bar mSearchDeleteBar = (SearchDropTargetBar) mDragLayer.findViewById(R.id.qsb_bar); |