diff options
| author | 2013-09-12 19:41:16 +0000 | |
|---|---|---|
| committer | 2013-09-12 19:41:16 +0000 | |
| commit | 90b10f89d7c1dd217f07f4b51ed8e5c93deccc52 (patch) | |
| tree | 4502c32266672777dc368637540d7aa00f13a060 | |
| parent | 2d861e87ae556b73d8bab5a6db20207a5653560f (diff) | |
| parent | 8529b30b91a3af235cda52ea0889ae9af7590129 (diff) | |
Merge "Fix TechChange's assumption about TextView targets" into klp-dev
| -rw-r--r-- | core/java/android/transition/TextChange.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/transition/TextChange.java b/core/java/android/transition/TextChange.java index 4f14d462675d..0b1e4e1373e8 100644 --- a/core/java/android/transition/TextChange.java +++ b/core/java/android/transition/TextChange.java @@ -137,14 +137,17 @@ public class TextChange extends Transition { @Override public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) { - if (startValues == null || endValues == null || !(endValues.view instanceof TextView)) { + if (startValues == null || endValues == null || + !(startValues.view instanceof TextView) || !(endValues.view instanceof TextView)) { return null; } final TextView view = (TextView) endValues.view; Map<String, Object> startVals = startValues.values; Map<String, Object> endVals = endValues.values; - final CharSequence startText = (CharSequence) startVals.get(PROPNAME_TEXT); - final CharSequence endText = (CharSequence) endVals.get(PROPNAME_TEXT); + final CharSequence startText = startVals.get(PROPNAME_TEXT) != null ? + (CharSequence) startVals.get(PROPNAME_TEXT) : ""; + final CharSequence endText = endVals.get(PROPNAME_TEXT) != null ? + (CharSequence) endVals.get(PROPNAME_TEXT) : ""; if (!startText.equals(endText)) { view.setText(startText); Animator anim; |