peek original post before scrolling

This commit is contained in:
sk 2022-12-31 01:52:07 +01:00
parent 4956543eac
commit 579794d7e0
1 changed files with 4 additions and 3 deletions

View File

@ -573,9 +573,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
initiallyScrolled = true; initiallyScrolled = true;
scrollView.post(() -> { scrollView.post(() -> {
int bottom = scrollView.getChildAt(0).getBottom(); int bottom = scrollView.getChildAt(0).getBottom();
int sy = scrollView.getScrollY(); int delta = bottom - (scrollView.getScrollY() + scrollView.getHeight());
int sh = scrollView.getHeight(); int space = Math.min(V.dp(150), delta);
scrollView.scrollBy(0, bottom - (sy + sh)); scrollView.scrollBy(0, delta - space);
scrollView.postDelayed(() -> scrollView.smoothScrollBy(0, space), 150);
}); });
} }
} }