summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2014-06-03 18:03:29 -0700
committerAdam Cohen <adamcohen@google.com>2014-06-03 18:11:15 -0700
commited11c14003ca4ae5f702b6eb3f6b5dd8f4e7d4a4 (patch)
treef0a7829bbaf47a76ebd466f8ce245ad91d6ca76b
parent3489f5c1bf0a3b036479b440b917123016568fc7 (diff)
downloadandroid_packages_apps_Trebuchet-ed11c14003ca4ae5f702b6eb3f6b5dd8f4e7d4a4.tar.gz
android_packages_apps_Trebuchet-ed11c14003ca4ae5f702b6eb3f6b5dd8f4e7d4a4.tar.bz2
android_packages_apps_Trebuchet-ed11c14003ca4ae5f702b6eb3f6b5dd8f4e7d4a4.zip
Adding debugging and naive fix for issue 15334203
-> To be reverted, just need signed build. Change-Id: I6a83e55067d8d2564bb3c4f0c314befbb2793f09
-rw-r--r--src/com/android/launcher3/ButtonDropTarget.java1
-rw-r--r--src/com/android/launcher3/InfoDropTarget.java26
2 files changed, 25 insertions, 2 deletions
diff --git a/src/com/android/launcher3/ButtonDropTarget.java b/src/com/android/launcher3/ButtonDropTarget.java
index 019f86c21..e466e10de 100644
--- a/src/com/android/launcher3/ButtonDropTarget.java
+++ b/src/com/android/launcher3/ButtonDropTarget.java
@@ -75,6 +75,7 @@ public class ButtonDropTarget extends TextView implements DropTarget, DragContro
return drawables[i];
}
}
+ System.out.println("No drawable, returning null " + this);
return null;
}
diff --git a/src/com/android/launcher3/InfoDropTarget.java b/src/com/android/launcher3/InfoDropTarget.java
index 374238c49..254d9bfe8 100644
--- a/src/com/android/launcher3/InfoDropTarget.java
+++ b/src/com/android/launcher3/InfoDropTarget.java
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.util.AttributeSet;
import android.view.View;
@@ -49,6 +50,19 @@ public class InfoDropTarget extends ButtonDropTarget {
Resources r = getResources();
mHoverColor = r.getColor(R.color.info_target_hover_tint);
mDrawable = (TransitionDrawable) getCurrentDrawable();
+
+ if (mDrawable == null) {
+ System.out.println("onFinishInflate -- drawable null");
+ }
+
+ // DEBUG CODE:
+ Drawable normal = r.getDrawable(R.drawable.ic_launcher_info_normal_holo);
+ Drawable active = r.getDrawable(R.drawable.ic_launcher_info_active_holo);
+ Drawable selector = r.getDrawable(R.drawable.info_target_selector);
+ System.out.println("Normal: " + normal);
+ System.out.println("Active: " + active);
+ System.out.println("Selector: " + selector);
+
if (null != mDrawable) {
mDrawable.setCrossFadeEnabled(true);
}
@@ -93,8 +107,14 @@ public class InfoDropTarget extends ButtonDropTarget {
isVisible = false;
}
+ if (mDrawable == null) {
+ System.out.println("onDragStart -- drawable null");
+ }
+
mActive = isVisible;
- mDrawable.resetTransition();
+ if (mDrawable != null) {
+ mDrawable.resetTransition();
+ }
setTextColor(mOriginalTextColor);
((ViewGroup) getParent()).setVisibility(isVisible ? View.VISIBLE : View.GONE);
}
@@ -108,7 +128,9 @@ public class InfoDropTarget extends ButtonDropTarget {
public void onDragEnter(DragObject d) {
super.onDragEnter(d);
- mDrawable.startTransition(mTransitionDuration);
+ if (mDrawable != null) {
+ mDrawable.startTransition(mTransitionDuration);
+ }
setTextColor(mHoverColor);
}