Skip to content

Commit 12abbe7

Browse files
committed
make sure repl history view gets scrolled to the end when more items is added
1 parent 98ac737 commit 12abbe7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/replete/HistoryAdapter.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ class HistoryAdapter(context: Context, id: Int, val parent: ListView) :
3030

3131
fun update(item: Item) {
3232
this.add(item)
33-
parent.smoothScrollToPosition(this.count - 1)
33+
parent.post {
34+
parent.smoothScrollToPosition(this.count - 1)
35+
}
3436
}
3537

3638
class ViewHolder(val item: TextView)

0 commit comments

Comments
 (0)