Make Apps Simple

Working on ways to improve apps from planning, requirement gathering to end-user experience.

Follow publication

LazyList Padding in Jetpack Compose

Abhimanyu
Make Apps Simple
Published in
2 min readSep 26, 2022
Source of info

In Jetpack Compose, while using LazyLists like LazyColumn or LazyRow . We may need to specify padding for various designs.

Padding for each item in the layout

We use Modifier in each item composable to specify padding for each individual item (lines 11–13).

Padding for the whole layout

Padding for the layout is achieved using Modifier on the LazyRow / LazyColumn (line 6).

In this, we can see that the padding at top and bottom will not change when we scroll the list.
But, in some cases we may need the padding to be shown only when we scroll to the bottom or stay at the top. The padding when the list is scrolled might not be the expected UI.

Padding for content

Padding only for content can be achieved like this using contentPadding parameter.

Please comment with your valuable feedback. It would help me to improvise.

Kindly 👏👏👏 if this was useful.

Please follow if you would like to see more content related to Android Jetpack Compose.

LinkedIn: https://www.linkedin.com/in/abhimanyu-n/

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Make Apps Simple
Make Apps Simple

Published in Make Apps Simple

Working on ways to improve apps from planning, requirement gathering to end-user experience.

No responses yet

Write a response