Cleaning up some drop-target issues.

- Setting text color during drag over transitions
- Fixing regression in drop target padding
= Using old drop-down animation where possible

Change-Id: Ia1c5ec9e58fc734d28133349d9920d123ed71ae6
This commit is contained in:
Winson Chung
2011-07-11 15:20:48 -07:00
parent fe63476a2d
commit a62e9fd95a
11 changed files with 77 additions and 14 deletions

View File

@@ -17,6 +17,7 @@
package com.android.launcher2;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.PorterDuff;
@@ -31,6 +32,7 @@ import com.android.launcher.R;
public class DeleteDropTarget extends ButtonDropTarget {
private TextView mText;
private ColorStateList mOriginalTextColor;
private TransitionDrawable mDrawable;
private int mHoverColor = 0xFFFF0000;
@@ -48,6 +50,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
// Get the drawable
mText = (TextView) findViewById(R.id.delete_target_text);
mOriginalTextColor = mText.getTextColors();
// Get the hover color
Resources r = getResources();
@@ -114,6 +117,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
mActive = isVisible;
mDrawable.resetTransition();
mText.setTextColor(mOriginalTextColor);
setVisibility(isVisible ? View.VISIBLE : View.GONE);
if (mText.getText().length() > 0) {
mText.setText(isUninstall ? R.string.delete_target_uninstall_label
@@ -131,6 +135,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
super.onDragEnter(d);
mDrawable.startTransition(mTransitionDuration);
mText.setTextColor(mHoverColor);
}
public void onDragExit(DragObject d) {
@@ -138,6 +143,7 @@ public class DeleteDropTarget extends ButtonDropTarget {
if (!d.dragComplete) {
mDrawable.resetTransition();
mText.setTextColor(mOriginalTextColor);
}
}