diff options
author | Mike Cleron <mcleron@google.com> | 2009-11-06 14:14:14 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-11-06 14:14:14 -0800 |
commit | b98eb1d07b9c8eeaa7f57408dd2448af47778a6a (patch) | |
tree | d947b8de953533787eaeb35398cebb5a3631b62e | |
parent | 922c888055098f9b8e478e146d98a49a29bb5656 (diff) | |
parent | 487de5d1b283bf1009e77e8223503bfbd180713b (diff) | |
download | android_packages_apps_Trebuchet-b98eb1d07b9c8eeaa7f57408dd2448af47778a6a.tar.gz android_packages_apps_Trebuchet-b98eb1d07b9c8eeaa7f57408dd2448af47778a6a.tar.bz2 android_packages_apps_Trebuchet-b98eb1d07b9c8eeaa7f57408dd2448af47778a6a.zip |
am 487de5d1: Merge change I74688835 into eclair
Merge commit '487de5d1b283bf1009e77e8223503bfbd180713b' into eclair-mr2
* commit '487de5d1b283bf1009e77e8223503bfbd180713b':
Account for the gap at the top of the search widget when animating
-rw-r--r-- | src/com/android/launcher2/Search.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/launcher2/Search.java b/src/com/android/launcher2/Search.java index 09646bd59..ca21997a8 100644 --- a/src/com/android/launcher2/Search.java +++ b/src/com/android/launcher2/Search.java @@ -47,6 +47,10 @@ public class Search extends LinearLayout // Speed at which the widget slides up/down, in pixels/ms. private static final float ANIMATION_VELOCITY = 1.0f; + /** The distance in dips between the optical top of the widget and the top if its bounds */ + private static final float WIDGET_TOP_OFFSET = 9; + + private final String TAG = "SearchWidget"; private Launcher mLauncher; @@ -70,6 +74,8 @@ public class Search extends LinearLayout // For voice searching private Intent mVoiceSearchIntent; + + private int mWidgetTopOffset; /** * Used to inflate the Workspace from XML. @@ -80,6 +86,9 @@ public class Search extends LinearLayout public Search(Context context, AttributeSet attrs) { super(context, attrs); + final float scale = context.getResources().getDisplayMetrics().density; + mWidgetTopOffset = Math.round(WIDGET_TOP_OFFSET * scale); + Interpolator interpolator = new AccelerateDecelerateInterpolator(); mMorphAnimation = new ToParentOriginAnimation(); @@ -365,6 +374,6 @@ public class Search extends LinearLayout * actual widget rather than it's container. This method return the top of the actual widget. */ private int getWidgetTop() { - return getTop() + getChildAt(0).getTop(); + return getTop() + getChildAt(0).getTop() + mWidgetTopOffset; } } |