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

fix link's too large hitbox #916

Merged
merged 4 commits into from Nov 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/src/main/java/com/keylesspalace/tusky/util/LinkHelper.java
Expand Up @@ -113,6 +113,18 @@ public void onClick(View widget) {
}
builder.removeSpan(span);
builder.setSpan(customSpan, start, end, flags);

/* Add zero-width space after links in end of line to fix its too large hitbox.
* See also : https://github.com/tuskyapp/Tusky/issues/846
* https://github.com/tuskyapp/Tusky/pull/916 */
if(end >= builder.length()){
builder.insert(end, "\u200B");
} else {
if(builder.subSequence(end, end + 1).toString().equals("\n")){
builder.insert(end, "\u200B");
}
}

}
view.setText(builder);
view.setLinksClickable(true);
Expand Down