Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion android/src/main/java/com/tailscale/ipn/ui/model/TailCfg.kt
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,15 @@ class Tailcfg {
data class Service(var Proto: String, var Port: Int, var Description: String? = null)

@Serializable
data class NetworkProfile(var MagicDNSName: String? = null, var DomainName: String? = null)
data class NetworkProfile(
var MagicDNSName: String? = null,
var DomainName: String? = null,
var DisplayName: String? = null
) {
fun tailnetNameForDisplay(): String? {
return DisplayName ?: DomainName
}
}

@Serializable
data class Location(
Expand Down
4 changes: 2 additions & 2 deletions android/src/main/java/com/tailscale/ipn/ui/view/MainView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fun MainView(
}
},
headlineContent = {
user?.NetworkProfile?.DomainName?.let { domain ->
user?.NetworkProfile?.tailnetNameForDisplay()?.let { domain ->
AutoResizingText(
text = domain,
style = MaterialTheme.typography.titleMedium.short,
Expand Down Expand Up @@ -500,7 +500,7 @@ fun ConnectView(
fontWeight = FontWeight.SemiBold,
textAlign = TextAlign.Center,
fontFamily = MaterialTheme.typography.titleMedium.fontFamily)
val tailnetName = user.NetworkProfile?.DomainName ?: ""
val tailnetName = user.NetworkProfile?.tailnetNameForDisplay() ?: ""
Text(
buildAnnotatedString {
append(stringResource(id = R.string.connect_to_tailnet_prefix))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fun UserView(
supportingContent = {
Column {
AutoResizingText(
text = profile.NetworkProfile?.DomainName ?: "",
text = profile.NetworkProfile?.tailnetNameForDisplay() ?: "",
style = MaterialTheme.typography.bodyMedium.short,
minFontSize = MaterialTheme.typography.minTextSize,
overflow = TextOverflow.Ellipsis)
Expand Down