|
|
|
|
@ -26,9 +26,8 @@ import androidx.compose.ui.text.withStyle
|
|
|
|
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
|
|
|
|
import com.tailscale.ipn.R
|
|
|
|
|
import com.tailscale.ipn.ui.Links
|
|
|
|
|
import com.tailscale.ipn.ui.theme.ts_color_light_blue
|
|
|
|
|
import com.tailscale.ipn.ui.theme.link
|
|
|
|
|
import com.tailscale.ipn.ui.util.ClipboardValueView
|
|
|
|
|
import com.tailscale.ipn.ui.util.Lists
|
|
|
|
|
import com.tailscale.ipn.ui.viewModel.BugReportViewModel
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
|
@ -40,23 +39,15 @@ fun BugReportView(nav: BackNavigation, model: BugReportViewModel = viewModel())
|
|
|
|
|
Column(modifier = Modifier.padding(innerPadding).fillMaxWidth().fillMaxHeight()) {
|
|
|
|
|
ListItem(
|
|
|
|
|
headlineContent = {
|
|
|
|
|
ClickableText(
|
|
|
|
|
text = contactText(),
|
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
onClick = { handler.openUri(Links.SUPPORT_URL) })
|
|
|
|
|
ClickableText(text = contactText(), onClick = { handler.openUri(Links.SUPPORT_URL) })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
Lists.SectionDivider()
|
|
|
|
|
|
|
|
|
|
ClipboardValueView(bugReportID, title = stringResource(R.string.bug_report_id))
|
|
|
|
|
|
|
|
|
|
Lists.SectionDivider()
|
|
|
|
|
|
|
|
|
|
ListItem(
|
|
|
|
|
headlineContent = {
|
|
|
|
|
Text(
|
|
|
|
|
text = stringResource(id = R.string.bug_report_id_desc),
|
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
textAlign = TextAlign.Left,
|
|
|
|
|
style = MaterialTheme.typography.bodySmall)
|
|
|
|
|
})
|
|
|
|
|
@ -67,20 +58,19 @@ fun BugReportView(nav: BackNavigation, model: BugReportViewModel = viewModel())
|
|
|
|
|
@Composable
|
|
|
|
|
fun contactText(): AnnotatedString {
|
|
|
|
|
val annotatedString = buildAnnotatedString {
|
|
|
|
|
withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.primary)) {
|
|
|
|
|
append(stringResource(id = R.string.bug_report_instructions_prefix))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pushStringAnnotation(tag = "reportLink", annotation = Links.SUPPORT_URL)
|
|
|
|
|
withStyle(
|
|
|
|
|
style = SpanStyle(color = ts_color_light_blue, textDecoration = TextDecoration.Underline)) {
|
|
|
|
|
style =
|
|
|
|
|
SpanStyle(
|
|
|
|
|
color = MaterialTheme.colorScheme.link,
|
|
|
|
|
textDecoration = TextDecoration.Underline)) {
|
|
|
|
|
append(stringResource(id = R.string.bug_report_instructions_linktext))
|
|
|
|
|
}
|
|
|
|
|
pop()
|
|
|
|
|
|
|
|
|
|
withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.primary)) {
|
|
|
|
|
append(stringResource(id = R.string.bug_report_instructions_suffix))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return annotatedString
|
|
|
|
|
}
|
|
|
|
|
|