Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overflow & max lines for custom list name #6132

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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.lib.theme.AppTheme
Expand Down Expand Up @@ -99,7 +100,9 @@ internal fun NavigationTitleView(
text = title,
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onPrimary,
modifier = modifier
modifier = modifier,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import net.mullvad.mullvadvpn.R
Expand Down Expand Up @@ -296,7 +297,9 @@ private fun Name(modifier: Modifier = Modifier, relay: RelayItem) {
AlphaInactive
}
)
.padding(horizontal = Dimens.smallPadding, vertical = Dimens.mediumPadding)
.padding(horizontal = Dimens.smallPadding, vertical = Dimens.mediumPadding),
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import net.mullvad.mullvadvpn.lib.theme.AppTheme
import net.mullvad.mullvadvpn.lib.theme.Dimens
Expand All @@ -33,13 +34,17 @@ fun TwoRowCell(
modifier = Modifier.fillMaxWidth(),
text = titleText,
style = MaterialTheme.typography.labelLarge,
color = titleColor
color = titleColor,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Text(
modifier = Modifier.fillMaxWidth(),
text = subtitleText,
style = MaterialTheme.typography.labelLarge,
color = subtitleColor
color = subtitleColor,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
}
},
Expand Down
Loading