-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Long press a link to copy it #320
base: master
Are you sure you want to change the base?
Conversation
|
||
private var isLongPressDetected = false | ||
private var startClickTime: Long = 0 | ||
private val longPressTime = 180L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should rely on ViewConfiguration.getLongPressTimeout()
I found two issues:
|
The message selection mode activation when long clicking on a link thing is because it was written in the issue so i thought that this was the expected behavior. I'll fix it |
holder.viewLongClicked() | ||
true | ||
} | ||
threadMessageBody.movementMethod = CustomLinkMovementMethod(activity, holder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't pass the holder
object here. Just use a kotlin lambda e.g. onLinkLongClicked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i passed it here because i thought i had to activate message selection mode when a link is long pressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but even then, callbacks are the proper way to do it.
What don't understand what do you mean about the link highlight color, do you want no highlight color while copying a link ? |
The part in bold is what I mean. |
What is it?
Description of the changes in your PR
Fixes the following issue(s)
Relies on the following changes
Acknowledgement
I subclassed LinkMovementMethod as asked.