We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3064983 commit 339a07fCopy full SHA for 339a07f
app/src/main/java/org/thoughtcrime/securesms/util/adapter/RecyclerViewUtils.kt
@@ -20,9 +20,10 @@ fun RecyclerView.applyImeBottomPadding() {
20
}
21
22
// Handle scroll logic
23
-fun RecyclerView.handleScrollToBottom(){
+fun RecyclerView.handleScrollToBottom() {
24
val layoutManager = this.layoutManager as LinearLayoutManager
25
- val last = this.adapter?.itemCount?.minus(1) ?: return
+ val last = this.adapter?.itemCount?.minus(1)?.coerceAtLeast(0) ?: return
26
+
27
val bottomOffset = this.paddingBottom
28
29
if (layoutManager.isSmoothScrolling) {
0 commit comments