Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a83181b authored by Chet Haase's avatar Chet Haase
Browse files

TextChange transition now uses CharSequence instead of String

TextChange made a bad assumption that target text views contained
String objects as their text, which is not always the case. For example,
Gmail ActionBar text views may contain SpannableString objects, which
caused a crash due to a bad cast operation.

Fix is to simply use CharSequence instead of String as the value that
is being stored and set on the text view.

Issue #10651858 TextChange transition casts CharSequence to String when not necessarily safe

Change-Id: I3f67f5d5e39201dc0fd2edcd3e4243033cf9ae08
parent 9b40bdf6
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -143,8 +143,8 @@ public class TextChange extends Transition {
        final TextView view = (TextView) endValues.view;
        final TextView view = (TextView) endValues.view;
        Map<String, Object> startVals = startValues.values;
        Map<String, Object> startVals = startValues.values;
        Map<String, Object> endVals = endValues.values;
        Map<String, Object> endVals = endValues.values;
        final String startText = (String) startVals.get(PROPNAME_TEXT);
        final CharSequence startText = (CharSequence) startVals.get(PROPNAME_TEXT);
        final String endText = (String) endVals.get(PROPNAME_TEXT);
        final CharSequence endText = (CharSequence) endVals.get(PROPNAME_TEXT);
        if (!startText.equals(endText)) {
        if (!startText.equals(endText)) {
            view.setText(startText);
            view.setText(startText);
            Animator anim;
            Animator anim;