|
3 | 3 |
|
4 | 4 | package com.tailscale.ipn.ui.view
|
5 | 5 |
|
| 6 | +import androidx.compose.foundation.focusable |
| 7 | +import androidx.compose.foundation.layout.Column |
| 8 | +import androidx.compose.foundation.layout.fillMaxSize |
6 | 9 | import androidx.compose.foundation.layout.padding
|
7 |
| -import androidx.compose.foundation.lazy.LazyColumn |
8 |
| -import androidx.compose.foundation.lazy.items |
| 10 | +import androidx.compose.foundation.rememberScrollState |
9 | 11 | import androidx.compose.foundation.text.ClickableText
|
| 12 | +import androidx.compose.foundation.verticalScroll |
10 | 13 | import androidx.compose.material3.Icon
|
11 | 14 | import androidx.compose.material3.ListItem
|
12 | 15 | import androidx.compose.material3.MaterialTheme
|
@@ -42,53 +45,47 @@ fun TailnetLockSetupView(
|
42 | 45 | backToSettings: BackNavigation,
|
43 | 46 | model: TailnetLockSetupViewModel = viewModel(factory = TailnetLockSetupViewModelFactory())
|
44 | 47 | ) {
|
45 |
| - val statusItems by model.statusItems.collectAsState() |
46 |
| - val nodeKey by model.nodeKey.collectAsState() |
47 |
| - val tailnetLockKey by model.tailnetLockKey.collectAsState() |
48 |
| - val tailnetLockTlPubKey = tailnetLockKey.replace("nlpub", "tlpub") |
| 48 | + val statusItems by model.statusItems.collectAsState() |
| 49 | + val nodeKey by model.nodeKey.collectAsState() |
| 50 | + val tailnetLockKey by model.tailnetLockKey.collectAsState() |
| 51 | + val tailnetLockTlPubKey = tailnetLockKey.replace("nlpub", "tlpub") |
49 | 52 |
|
50 |
| - Scaffold(topBar = { Header(R.string.tailnet_lock, onBack = backToSettings) }) { innerPadding -> |
51 |
| - LoadingIndicator.Wrap { |
52 |
| - Column( |
53 |
| - modifier = Modifier |
54 |
| - .padding(innerPadding) |
55 |
| - .focusable() |
56 |
| - .verticalScroll(rememberScrollState()) |
57 |
| - .fillMaxSize() |
58 |
| - ) { |
59 |
| - ExplainerView() |
| 53 | + Scaffold(topBar = { Header(R.string.tailnet_lock, onBack = backToSettings) }) { innerPadding -> |
| 54 | + LoadingIndicator.Wrap { |
| 55 | + Column( |
| 56 | + modifier = |
| 57 | + Modifier.padding(innerPadding) |
| 58 | + .focusable() |
| 59 | + .verticalScroll(rememberScrollState()) |
| 60 | + .fillMaxSize()) { |
| 61 | + ExplainerView() |
60 | 62 |
|
61 |
| - statusItems.forEach { statusItem -> |
62 |
| - Lists.ItemDivider() |
| 63 | + statusItems.forEach { statusItem -> |
| 64 | + Lists.ItemDivider() |
63 | 65 |
|
64 |
| - ListItem( |
65 |
| - leadingContent = { |
66 |
| - Icon( |
67 |
| - painter = painterResource(id = statusItem.icon), |
68 |
| - contentDescription = null, |
69 |
| - tint = MaterialTheme.colorScheme.onSurfaceVariant |
70 |
| - ) |
71 |
| - }, |
72 |
| - headlineContent = { Text(stringResource(statusItem.title)) } |
73 |
| - ) |
74 |
| - } |
75 |
| - //Node key |
76 |
| - Lists.SectionDivider() |
77 |
| - ClipboardValueView( |
78 |
| - value = nodeKey, |
79 |
| - title = stringResource(R.string.node_key), |
80 |
| - subtitle = stringResource(R.string.node_key_explainer) |
81 |
| - ) |
82 |
| - |
83 |
| - // Tailnet lock key |
84 |
| - Lists.SectionDivider() |
85 |
| - ClipboardValueView( |
86 |
| - value = tailnetLockTlPubKey, |
87 |
| - title = stringResource(R.string.tailnet_lock_key), |
88 |
| - subtitle = stringResource(R.string.tailnet_lock_key_explainer) |
89 |
| - ) |
| 66 | + ListItem( |
| 67 | + leadingContent = { |
| 68 | + Icon( |
| 69 | + painter = painterResource(id = statusItem.icon), |
| 70 | + contentDescription = null, |
| 71 | + tint = MaterialTheme.colorScheme.onSurfaceVariant) |
| 72 | + }, |
| 73 | + headlineContent = { Text(stringResource(statusItem.title)) }) |
90 | 74 | }
|
91 |
| - } |
| 75 | + // Node key |
| 76 | + Lists.SectionDivider() |
| 77 | + ClipboardValueView( |
| 78 | + value = nodeKey, |
| 79 | + title = stringResource(R.string.node_key), |
| 80 | + subtitle = stringResource(R.string.node_key_explainer)) |
| 81 | + |
| 82 | + // Tailnet lock key |
| 83 | + Lists.SectionDivider() |
| 84 | + ClipboardValueView( |
| 85 | + value = tailnetLockTlPubKey, |
| 86 | + title = stringResource(R.string.tailnet_lock_key), |
| 87 | + subtitle = stringResource(R.string.tailnet_lock_key_explainer)) |
| 88 | + } |
92 | 89 | }
|
93 | 90 | }
|
94 | 91 |
|
|
0 commit comments