diff options
author | Winson Chung <winsonc@google.com> | 2011-06-20 15:41:53 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-06-20 17:14:37 -0700 |
commit | 201bc828d5a0078f505e8e37152156a0cb43c10a (patch) | |
tree | 698628a43eec7783c1d885b12aa771fd82579f93 /src/com/android/launcher2/InfoDropTarget.java | |
parent | 30faf5197983383e15728c66ee7e9a39d5b717b2 (diff) | |
download | android_packages_apps_Trebuchet-201bc828d5a0078f505e8e37152156a0cb43c10a.tar.gz android_packages_apps_Trebuchet-201bc828d5a0078f505e8e37152156a0cb43c10a.tar.bz2 android_packages_apps_Trebuchet-201bc828d5a0078f505e8e37152156a0cb43c10a.zip |
Need to remove views and not just hide them after animations.
- Removing Manage Apps button from workspace and renaming it in AppsCustomize
- Fixing foolish string play in resources from initial change for search bar
- Using proper way to get full screen dims for wallpaper fix
Change-Id: I1319d225135436468f1feb3057cd9f28eda7c89c
Diffstat (limited to 'src/com/android/launcher2/InfoDropTarget.java')
-rw-r--r-- | src/com/android/launcher2/InfoDropTarget.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/com/android/launcher2/InfoDropTarget.java b/src/com/android/launcher2/InfoDropTarget.java index 7e6b700df..76a6bf926 100644 --- a/src/com/android/launcher2/InfoDropTarget.java +++ b/src/com/android/launcher2/InfoDropTarget.java @@ -19,17 +19,20 @@ package com.android.launcher2; import android.animation.ObjectAnimator; import android.content.ComponentName; import android.content.Context; +import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Color; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.util.AttributeSet; import android.view.View; +import android.widget.TextView; import com.android.launcher.R; public class InfoDropTarget extends ButtonDropTarget { + private TextView mText; private int mHoverColor = 0xFF0000FF; public InfoDropTarget(Context context, AttributeSet attrs) { @@ -44,6 +47,8 @@ public class InfoDropTarget extends ButtonDropTarget { protected void onFinishInflate() { super.onFinishInflate(); + mText = (TextView) findViewById(R.id.info_target_text); + // Get the hover color Resources r = getResources(); mHoverColor = r.getColor(R.color.info_target_hover_tint); @@ -51,11 +56,18 @@ public class InfoDropTarget extends ButtonDropTarget { mHoverColor, PorterDuff.Mode.SRC_ATOP)); setBackgroundColor(mHoverColor); getBackground().setAlpha(0); + + // Remove the text in the Phone UI in landscape + int orientation = getResources().getConfiguration().orientation; + if (orientation == Configuration.ORIENTATION_LANDSCAPE) { + if (!LauncherApplication.isScreenLarge()) { + mText.setText(""); + } + } } - private boolean isApplication(Object info) { - if (info instanceof ApplicationInfo) return true; - return (((ItemInfo) info).itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION); + private boolean isAllAppsApplication(DragSource source, Object info) { + return (source instanceof AppsCustomizePagedView) && (info instanceof ApplicationInfo); } @Override @@ -77,11 +89,10 @@ public class InfoDropTarget extends ButtonDropTarget { @Override public void onDragStart(DragSource source, Object info, int dragAction) { - ItemInfo item = (ItemInfo) info; boolean isVisible = true; // If we are dragging a widget or shortcut, hide the info target - if (!isApplication(info)) { + if (!isAllAppsApplication(source, info)) { isVisible = false; } |