Fixed text search line offset

pull/178/head
M66B 5 years ago
parent ae7787c023
commit c77bfead55

@ -4088,11 +4088,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
public void run() { public void run() {
try { try {
int line = tvBody.getLayout().getLineForOffset(pos); int line = tvBody.getLayout().getLineForOffset(pos);
int y = Math.round(line * tvBody.getLineHeight()); int y = tvBody.getLayout().getLineTop(line);
Rect rect = new Rect(); Rect rect = new Rect();
tvBody.getDrawingRect(rect); tvBody.getDrawingRect(rect);
((ViewGroup) view).offsetDescendantRectToMyCoords(tvBody, rect); ((ViewGroup) itemView).offsetDescendantRectToMyCoords(tvBody, rect);
properties.scrollTo(apos, rect.top + y); properties.scrollTo(apos, rect.top + y);
} catch (Throwable ex) { } catch (Throwable ex) {

Loading…
Cancel
Save