android: fix missing imports (#486)

android: make clipboard values clickable and focusable

also, use Column isntead of LazyColumn since the Tailnet lock view is a short list and doesn't require lazy rendering

Fixes tailscale/corp#21737

Signed-off-by: kari-ts <kari@tailscale.com>
Signed-off-by: kari-ts <135075563+kari-ts@users.noreply.github.com>
pull/487/head
kari-ts 3 months ago committed by GitHub
parent a9ff204ae4
commit 77eaadb360
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -3,10 +3,13 @@
package com.tailscale.ipn.ui.view
import androidx.compose.foundation.focusable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.ClickableText
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialTheme
@ -50,12 +53,11 @@ fun TailnetLockSetupView(
Scaffold(topBar = { Header(R.string.tailnet_lock, onBack = backToSettings) }) { innerPadding ->
LoadingIndicator.Wrap {
Column(
modifier = Modifier
.padding(innerPadding)
modifier =
Modifier.padding(innerPadding)
.focusable()
.verticalScroll(rememberScrollState())
.fillMaxSize()
) {
.fillMaxSize()) {
ExplainerView()
statusItems.forEach { statusItem ->
@ -66,28 +68,23 @@ fun TailnetLockSetupView(
Icon(
painter = painterResource(id = statusItem.icon),
contentDescription = null,
tint = MaterialTheme.colorScheme.onSurfaceVariant
)
tint = MaterialTheme.colorScheme.onSurfaceVariant)
},
headlineContent = { Text(stringResource(statusItem.title)) }
)
headlineContent = { Text(stringResource(statusItem.title)) })
}
// Node key
Lists.SectionDivider()
ClipboardValueView(
value = nodeKey,
title = stringResource(R.string.node_key),
subtitle = stringResource(R.string.node_key_explainer)
)
subtitle = stringResource(R.string.node_key_explainer))
// Tailnet lock key
Lists.SectionDivider()
ClipboardValueView(
value = tailnetLockTlPubKey,
title = stringResource(R.string.tailnet_lock_key),
subtitle = stringResource(R.string.tailnet_lock_key_explainer)
)
}
subtitle = stringResource(R.string.tailnet_lock_key_explainer))
}
}
}

Loading…
Cancel
Save