diff options
author | Ajay Nadathur <ajayns@google.com> | 2016-05-31 14:08:05 -0700 |
---|---|---|
committer | Ajay Kumar Nadathur Sreenivasan <ajayns@google.com> | 2016-05-31 22:34:06 +0000 |
commit | 11e78276fbeb0014ac810966f3fbf3be3b848c21 (patch) | |
tree | 5d90594bd4430efa4a8ecde211b104fbc4cbb65f | |
parent | d9a2a2c2496a2116e390a3141209fa64dc13dc9a (diff) | |
download | setupwizard-11e78276fbeb0014ac810966f3fbf3be3b848c21.tar.gz |
[SetupWizard] Learn more link is not working in fingerprint screen
- TextView.setMovementMethod internally calls setText(CharSequence).
We were calling setMovementMethod before setting the text. 'mText' is
passed as the first parameter to setText(CharSequence) by
the caller: setMovementMethod. Since mText at
that point was null, hasLinks(CharSequence) returns false. As a
result, the movementMethod is set to 'null'. mMovement being
null, touch events was not handled by the TextView
- Fixed the problem by moving super.setText to the beginning of the
method.
Testing:
--------
- Verified on Angler
bug:29036596
Change-Id: I2df8c04289ff7d6c71a9636d04276b5034dc3f5c
-rw-r--r-- | library/eclair-mr1/src/com/android/setupwizardlib/view/RichTextView.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/eclair-mr1/src/com/android/setupwizardlib/view/RichTextView.java b/library/eclair-mr1/src/com/android/setupwizardlib/view/RichTextView.java index 9ec1c46..fc1014a 100644 --- a/library/eclair-mr1/src/com/android/setupwizardlib/view/RichTextView.java +++ b/library/eclair-mr1/src/com/android/setupwizardlib/view/RichTextView.java @@ -105,6 +105,10 @@ public class RichTextView extends TextView { @Override public void setText(CharSequence text, BufferType type) { text = getRichText(getContext(), text); + // Set text first before doing anything else because setMovementMethod internally calls + // setText. This in turn ends up calling this method with mText as the first parameter + super.setText(text, type); + if (hasLinks(text)) { // When a TextView has a movement method, it will set the view to clickable. This makes // View.onTouchEvent always return true and consumes the touch event, essentially @@ -115,7 +119,6 @@ public class RichTextView extends TextView { } else { setMovementMethod(null); } - super.setText(text, type); } private boolean hasLinks(CharSequence text) { |