mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-21 21:57:19 +00:00
Scroll to message body
This commit is contained in:
parent
aea6c63db9
commit
157bfbdf5a
2 changed files with 17 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue