Skip to content

[ListItem] No top alignment as per specs #4666

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

Open
mobilekosmos opened this issue Mar 14, 2025 · 0 comments
Open

[ListItem] No top alignment as per specs #4666

mobilekosmos opened this issue Mar 14, 2025 · 0 comments

Comments

@mobilekosmos
Copy link

Description: Full description of issue here
"Alignment: Elements in a list item are middle-aligned unless it is at or above 88dp (such as when a list item contains three lines of text) at which point everything is top aligned"
Using the ListItem composable only aligns the icon to the center, never to the top ignoring the list item's height as per your won specs.

Expected behavior: Screenshots and/or description of expected behavior

Source code: The code snippet which is causing this issue
ListItem( modifier = Modifier.clickable { onClick.invoke() }, leadingContent = { Icon( painter = painterResource(id = iconRes), contentDescription = null ) }, headlineContent = { Text(text = stringResource(id = stringRes)) } )

Minimal sample app repro: Please consider attaching a minimal sample app that reproduces the issue. This will help narrow down the conditions required for reproducing the issue, and it will speed up the bug fix process. You may attach a zip file of the sample app or link to a GitHub repo that contains the sample app.

Android API version: 15

Material Library version: Material Android Library version you are using here (e.g., 1.1.0-alpha07)
"com.google.android.material:material:1.11.0"
const val COMPOSE = "1.7.3"
const val COMPOSE_MATERIAL_3 = "1.3.0"

Device: Pixel 6a and Compose Preview

To help us triage faster, please check to make sure you are using the latest version of the library.

We also happily accept pull requests.

@mobilekosmos mobilekosmos changed the title [ListItem] Short description of issue [ListItem] No top alignment as per specs Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants