Skip to content
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

getHysteresisOffset 没必要 #15

Open
ParadiseHell opened this issue Feb 19, 2021 · 0 comments
Open

getHysteresisOffset 没必要 #15

ParadiseHell opened this issue Feb 19, 2021 · 0 comments

Comments

@ParadiseHell
Copy link

直接获取 RawX 和 RawY, 然后获取 TextView 在屏幕的位置,算出当前点击区域在 TextView 上的位置,最后用 getPreciseOffset 获取偏移量比较 OK, 这样也可以解决嵌套 TextView 宽度不和屏幕宽度相等,导致获取 x 坐标不准的问题。比如聊天的气泡,用 getHysteresisOffset 就无法实现划词的手势和背景 Span 重合。

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

No branches or pull requests

1 participant