File tree 1 file changed +2
-3
lines changed
ui/src/main/java/com/wireguard/android/activity
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -198,19 +198,18 @@ class LogViewerActivity : AppCompatActivity() {
198
198
recyclerView?.let {
199
199
val shouldScroll = haveScrolled && ! it.canScrollVertically(1 )
200
200
logLines.add(logLine)
201
- if (haveScrolled) logAdapter.notifyDataSetChanged( )
201
+ if (haveScrolled) logAdapter.notifyItemInserted(logLines.size - 1 )
202
202
if (shouldScroll)
203
203
it.scrollToPosition(logLines.size - 1 )
204
204
}
205
205
} else {
206
206
logLines.lastOrNull()?.msg + = " \n $line "
207
- if (haveScrolled) logAdapter.notifyDataSetChanged( )
207
+ if (haveScrolled) logAdapter.notifyItemChanged(logLines.size - 1 )
208
208
}
209
209
if (! haveScrolled) {
210
210
val end = System .nanoTime()
211
211
val scroll = (end - start) > 1000000000L * 2.5 || ! stdout.ready()
212
212
if (logLines.isNotEmpty() && (scroll || (end - startPeriod) > 1000000000L / 4 )) {
213
- logAdapter.notifyDataSetChanged()
214
213
recyclerView?.scrollToPosition(logLines.size - 1 )
215
214
startPeriod = end
216
215
}
You can’t perform that action at this time.
0 commit comments