Skip to content

Commit

Permalink
Fix overflow & max lines for custom list name
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Apr 16, 2024
1 parent 486fd32 commit 9b9a6a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
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

0 comments on commit 9b9a6a1

Please sign in to comment.