1

I'm using Android Compose to develop a wearOS app. On my pixel watch, which have a rounded screen, I don't succeed in displaying the text correctly without it to be cropped.

My code is the following :

Scaffold {
        Column(
            modifier = modifier
                .fillMaxSize()
                .padding(vertical = Dimensions.xsPadding),
            horizontalAlignment = Alignment.CenterHorizontally,
            verticalArrangement = Arrangement.SpaceBetween
        ) {
                Text(
                    game.game_name,
                    style = MaterialTheme.typography.body1.copy(
                        fontWeight = FontWeight.Bold,
                    ),
                    textAlign = TextAlign.Center,
                    maxLines = 2,
                    overflow = TextOverflow.Ellipsis,
                    modifier = Modifier.padding(horizontal = Dimensions.xsPadding),
                )
                .......
       }
}

And here is the result of what I have with a long text :

cropped text example

1 Answer 1

1

You could apply the fillMaxRectangle modifier from Horologist to your Column:

        Column(
            modifier = modifier
                .fillMaxRectangle()
            ...
        ) {
                ...
       }
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, that work :) But it loses too much space for me. I wanted more something adapting the rounded screen rather then using square in a circle

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.