File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
mobile/src/main/java/com/windscribe/mobile/ui/preferences/debug Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,11 @@ import androidx.compose.foundation.layout.Spacer
6
6
import androidx.compose.foundation.layout.height
7
7
import androidx.compose.foundation.layout.padding
8
8
import androidx.compose.foundation.lazy.LazyColumn
9
+ import androidx.compose.foundation.lazy.rememberLazyListState
9
10
import androidx.compose.material3.MaterialTheme
10
11
import androidx.compose.material3.Text
11
12
import androidx.compose.runtime.Composable
13
+ import androidx.compose.runtime.LaunchedEffect
12
14
import androidx.compose.runtime.collectAsState
13
15
import androidx.compose.runtime.getValue
14
16
import androidx.compose.runtime.mutableStateOf
@@ -40,7 +42,13 @@ fun DebugScreen(viewModel: DebugViewModel? = null) {
40
42
navController.popBackStack()
41
43
}
42
44
Spacer (modifier = Modifier .height(20 .dp))
43
- LazyColumn {
45
+ val listState = rememberLazyListState()
46
+ LaunchedEffect (debugLog.size) {
47
+ if (debugLog.isNotEmpty()) {
48
+ listState.scrollToItem(debugLog.size - 1 )
49
+ }
50
+ }
51
+ LazyColumn (state = listState) {
44
52
items(debugLog.size) {
45
53
Text (
46
54
debugLog[it],
You can’t perform that action at this time.
0 commit comments