summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/InfoDropTarget.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-06-12 15:15:29 -0700
committerWinson Chung <winsonc@google.com>2011-06-13 11:51:18 -0700
commit61fa4197c4316bb0f9b05fcefb676f86197a2273 (patch)
treef65b772ab5f47288734edab35fdb5d8f0fabf7b9 /src/com/android/launcher2/InfoDropTarget.java
parentf0ea4d3378be7b962c8e0bce2392df5e82491fb8 (diff)
downloadandroid_packages_apps_Trebuchet-61fa4197c4316bb0f9b05fcefb676f86197a2273.tar.gz
android_packages_apps_Trebuchet-61fa4197c4316bb0f9b05fcefb676f86197a2273.tar.bz2
android_packages_apps_Trebuchet-61fa4197c4316bb0f9b05fcefb676f86197a2273.zip
Fixing drop target area, and adding bg color indicators.
- Merging wallpaper fix and PagedViewIconCache key fix Change-Id: I2a65bc4b642f020dfc4d2223a36d3ebcf41de5f5
Diffstat (limited to 'src/com/android/launcher2/InfoDropTarget.java')
-rw-r--r--src/com/android/launcher2/InfoDropTarget.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/com/android/launcher2/InfoDropTarget.java b/src/com/android/launcher2/InfoDropTarget.java
index bbde2b846..7e6b700df 100644
--- a/src/com/android/launcher2/InfoDropTarget.java
+++ b/src/com/android/launcher2/InfoDropTarget.java
@@ -16,20 +16,20 @@
package com.android.launcher2;
+import android.animation.ObjectAnimator;
import android.content.ComponentName;
import android.content.Context;
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.view.ViewGroup;
import com.android.launcher.R;
-public class InfoDropTarget extends IconDropTarget {
+public class InfoDropTarget extends ButtonDropTarget {
- private int mDefaultTextColor;
private int mHoverColor = 0xFF0000FF;
public InfoDropTarget(Context context, AttributeSet attrs) {
@@ -46,10 +46,11 @@ public class InfoDropTarget extends IconDropTarget {
// Get the hover color
Resources r = getResources();
- mDefaultTextColor = getTextColors().getDefaultColor();
mHoverColor = r.getColor(R.color.info_target_hover_tint);
mHoverPaint.setColorFilter(new PorterDuffColorFilter(
mHoverColor, PorterDuff.Mode.SRC_ATOP));
+ setBackgroundColor(mHoverColor);
+ getBackground().setAlpha(0);
}
private boolean isApplication(Object info) {
@@ -85,7 +86,7 @@ public class InfoDropTarget extends IconDropTarget {
}
mActive = isVisible;
- ((ViewGroup) getParent()).setVisibility(isVisible ? View.VISIBLE : View.GONE);
+ setVisibility(isVisible ? View.VISIBLE : View.GONE);
}
@Override
@@ -97,12 +98,17 @@ public class InfoDropTarget extends IconDropTarget {
public void onDragEnter(DragObject d) {
super.onDragEnter(d);
- setTextColor(mHoverColor);
+ ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha",
+ Color.alpha(mHoverColor));
+ anim.setDuration(mTransitionDuration);
+ anim.start();
}
public void onDragExit(DragObject d) {
super.onDragExit(d);
- setTextColor(mDefaultTextColor);
+ ObjectAnimator anim = ObjectAnimator.ofInt(getBackground(), "alpha", 0);
+ anim.setDuration(mTransitionDuration);
+ anim.start();
}
}