google-developer-training / basic-android-kotlin-compose-training-practice-problems

Apache License 2.0
96 stars 115 forks source link

text align=justify #5

Open Playercool02 opened 1 year ago

Playercool02 commented 1 year ago

its working on the preview but not on the emulator

frakka92 commented 1 year ago

I have the same issue for Compose Article. I tried other alignments and they work

johnshea commented 1 year ago

Hi @Playercool02 @frakka92

Please provide additional information/code/screenshots/ etc. so others can see what you tried and the results so guidance can be provided.

Regards.

wannabetolkien commented 1 year ago

Try textAlign = TextAlign.Justify in the Text Composable Box

wannabetolkien commented 1 year ago

@johnshea I have issue with the quadrant project. I am doing everything as per the instructions but randomly , out of the four composables that I have created for the quadrants , one of them is displayed instead of all the four together.

frakka92 commented 1 year ago

Hi @Playercool02 @frakka92

Please provide additional information/code/screenshots/ etc. so others can see what you tried and the results so guidance can be provided.

Regards.

Hello @johnshea, here is the screenshot and code.

Thanks

Screenshot_2023-06-20-10-55-13-72_c965430f3ac946ecbe369b621cf5e174

@Composable fun Article(modifier: Modifier = Modifier) { Column(modifier = modifier) { Image(painterResource(id = R.drawable.bg_compose_background), contentDescription = null) Text( text = stringResource(id = R.string.title), modifier = Modifier.padding(16.dp), fontSize = 24.sp ) Text( text = stringResource(id = R.string.body1), modifier = Modifier.padding(start = 16.dp, end = 16.dp), textAlign = TextAlign.Justify ) Text( text = stringResource(id = R.string.body2), modifier = Modifier.padding(16.dp), textAlign = TextAlign.Justify ) } }