1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-22 14:11:00 +00:00

Scroll to message body

This commit is contained in:
M66B 2018-12-22 09:06:33 +01:00
parent aea6c63db9
commit 157bfbdf5a
2 changed files with 17 additions and 0 deletions

View file

@ -694,7 +694,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
properties.setValue("quotes", message.id, false);
properties.setValue("images", message.id, false);
}
notifyItemChanged(pos);
if (expanded)
properties.scrollTo(pos, Math.round(tvBody.getY()));
}
}
@ -1762,6 +1766,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
Spanned getBody(long id);
void scrollTo(int pos, int dy);
void move(long id, String target, boolean type);
}
}

View file

@ -334,6 +334,17 @@ public class FragmentMessages extends FragmentEx {
return bodies.get(id);
}
@Override
public void scrollTo(final int pos, final int dy) {
new Handler().post(new Runnable() {
@Override
public void run() {
rvMessage.scrollToPosition(pos);
rvMessage.scrollBy(0, dy);
}
});
}
@Override
public void move(long id, String name, boolean type) {
Bundle args = new Bundle();