File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
ui/src/main/java/com/wireguard/android/activity Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -198,19 +198,18 @@ class LogViewerActivity : AppCompatActivity() {
198198 recyclerView?.let {
199199 val shouldScroll = haveScrolled && ! it.canScrollVertically(1 )
200200 logLines.add(logLine)
201- if (haveScrolled) logAdapter.notifyDataSetChanged( )
201+ if (haveScrolled) logAdapter.notifyItemInserted(logLines.size - 1 )
202202 if (shouldScroll)
203203 it.scrollToPosition(logLines.size - 1 )
204204 }
205205 } else {
206206 logLines.lastOrNull()?.msg + = " \n $line "
207- if (haveScrolled) logAdapter.notifyDataSetChanged( )
207+ if (haveScrolled) logAdapter.notifyItemChanged(logLines.size - 1 )
208208 }
209209 if (! haveScrolled) {
210210 val end = System .nanoTime()
211211 val scroll = (end - start) > 1000000000L * 2.5 || ! stdout.ready()
212212 if (logLines.isNotEmpty() && (scroll || (end - startPeriod) > 1000000000L / 4 )) {
213- logAdapter.notifyDataSetChanged()
214213 recyclerView?.scrollToPosition(logLines.size - 1 )
215214 startPeriod = end
216215 }
You can’t perform that action at this time.
0 commit comments