Member-only story

5 Jetpack Compose Secrets No one Talks about (But You Should Know!)

Jayant Kumar🇮🇳

--

Photo by Alexander Krivitskiy on Unsplash

Link For Non-Members

Jetpack Compose has revolutionised Android development with its modern, declarative approach to building user interfaces. In this article , i am not sure this is a secret or not but definitely it will make your code better and cleaner.

1). Padding Between the Items (Column & Row)

Suppose we have some items in the Column composable function and wants to provide padding between the items , with this simple verticalArrangement = Arrangement.spacedBy(16.dp) trick we can provide the padding between the contents.

@Composable
fun ContentPadding(
modifier: Modifier = Modifier
)
{
Column(
modifier = modifier
.padding(horizontal = 16.dp)
.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(16.dp) // vertical padding b/w the contents…

--

--

Jayant Kumar🇮🇳
Jayant Kumar🇮🇳

Written by Jayant Kumar🇮🇳

Hello My name is Jayant Kumar, I am a software Engineer , specialist in Mobile Development (Android , IOS , Flutter , React Native) from India 🇮🇳

No responses yet

Write a response