Closed BoD closed 9 years ago
Looks like it requires just a few edits to the TouchableMovementMethod.
I don't have your source code, but if you were to fork the library, you would need to return false at some times, when the link is not clicked.
So, in the onTouchEvent method, instead of returning true at the bottom:
if (mPressedSpan != null) {
return mPressedSpan.isTouched();
} else {
return false;
}
You will also have to add a getter method to the TouchableSpan class I believe.
This will make it so if the TouchableSpan is currently clicked, it will consume the touch event, if the touchable span is not clicked or is null, then the text view should not consume the touch event and it should be passed down to the list view
I don't currently have any projects set up to work like this or I would try it out for you. Don't know what your time table is on this issue, but if you can't get it to work that way or are unsure of how to connect everything, it may be a little while before I can test it out myself and find the fix.
I added a new LinkConsumableTextView to version 1.3.0. You will have to implement this, as I have done with the sample, into your TextView's.
Once you do, this should be working perfectly fine. Thanks for the help on this one. Let me know if you have any issues
Version 1.3.0 should be up on maven central before long
Thank you so much! :+1: :) I will try it ASAP.
Sorry for the long delay, but please know that is it works perfectly :) Thanks again.
This is more like a question or maybe a feature request.
I am trying to have clickable links in cells of a ListView, while keeping the rest of the View clickable - and by that I mean that the ListView's OnItemClickListener still get called when clicking outside of the TextView, and also inside of the TextView, but on non-link text.
I've seen people having this problem with
ClickableSpan
s, notably here: http://stackoverflow.com/questions/8558732/listview-textview-with-linkmovementmethod-makes-list-item-unclickable.I've tried to apply the accepted solution in conjunction with this library but I failed. I suppose this is due to the fact that this library installs its own
MovementMethod
and so installing another incompatible one would not work. I have to admit I am not very familiar with the wholeSpan
/MovementMethod
deal (which is why I use your library in the first place!) and so the reason or solution of the problem are not so clear to me.Well I hope this makes sense :) Thanks for the very useful library in any case!