Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Attribute android:textIsSelectable="true" is not working #59

Closed
MinimalMatt opened this issue Aug 24, 2016 · 5 comments · Fixed by #108
Closed

Attribute android:textIsSelectable="true" is not working #59

MinimalMatt opened this issue Aug 24, 2016 · 5 comments · Fixed by #108
Labels

Comments

@MinimalMatt
Copy link

MinimalMatt commented Aug 24, 2016

<org.sufficientlysecure.htmltextview.HtmlTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textIsSelectable="true"/>

@MinimalMatt MinimalMatt changed the title Attribute android:textIsSelectable="true" is not working Attribute android:textIsSelectable="true" is not working Aug 24, 2016
@MinimalMatt MinimalMatt changed the title Attribute android:textIsSelectable="true" is not working Attribute android:textIsSelectable="true" is not working Aug 24, 2016
@dschuermann
Copy link
Member

textIsSelectable seems to be extremely buggy for TextViews in general (https://www.google.de/search?hl=de&q=textIsSelectable).

@MinimalMatt
Copy link
Author

I never had a problem with the standard TextViews. Is there a workaround to make it works? I just need to be able to copy the selected text.
By the way thanks for the answer.

@ofalvai
Copy link
Contributor

ofalvai commented Oct 7, 2016

In my case the exact problem was that on Marshmallow and above, the text could be selected, but the text selection commands didn't appear above the textview.
I think the root cause is the overridden HtmlTextView.onTouchEvent() method, and that the mDontConsumeNonUrlClicks field set to true, because currently the method always returns false thanks to that boolean. If I set mDontConsumeNonUrlClicks to true, the text selection bubble appears above the text.

Currently there's no way to control that field outside the package (I modified the code of HtmlTextView to test my solution), but I would gladly make a pull request with a setter method. I'm just not sure what's the purpose of mDontConsumeNonUrlClicks currently, and whether it could be removed altogether or a setter would be better.

@dschuermann
Copy link
Member

@ofalvai If you still have some free time I would appreciate a pull request. I think mDontConsumeNonUrlClicks can be removed!

@dschuermann
Copy link
Member

Released in 3.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants