⚡ Catalin Ghita Profile picture
🫂Gradle build failed ➡️ switched to #indiehacking 📙 Author @PacktPub 🧑‍🏫 Instructor @Udemy

Aug 25, 2021, 13 tweets

Curios about Compose but haven’t had the chance to look into it? 🤔

Here’s a collection of 12 core Composable functions used to build UI!

🧵Thread 👇

#indiedev #JetpackCompose #Android #AndroidDev #DEVCommunity #coding

1. Text Composable

You can use the Text composable to display text. You can use the style argument to define things like TextDecoration or FontFamily.

It's similar to the TextView in the classic Android View system.

2. Image Composable

Image is used to display images. It’s similar to an ImageView in the classic Android View system.

You can use painterResource to load an image from the resources.

3. Button composable

A Button Composable has an onClick callback function. You can add a Text Composable or any other Composables as child elements of the Button.

It's similar to the Button in the classic Android View system.

4. TextField Composable

TextField can be used to insert text. This is the equivalent to EditText from the Android View system.

5. Column Composable

A Column Composable will show each child below the previous children. It’s similar to a LinearLayout with vertical orientation.

6. Row Composable

A Row Composable will show each child next to the previous children. It’s similar to a LinearLayout with a horizontal orientation.

7. LazyColumn Composable

A LazyColumn is a vertically scrolling list that only composes and lays out the currently visible items.

It’s similar to a RecyclerView in the classic Android View system but with vertical orientation.

8. LazyRow Composable

A LazyRow is a horizontal scrolling list that only composes and lays out the currently visible items.

It’s similar to a horizontal RecyclerView in the classic Android View system.

9. Spacer Composable

Spacer is a Composable that can be used when you want to add an additional space between Composables.

10. Surface Composable

The Surface Composable represents a material surface. A surface allows you to setup things like background color, elevation or border.

11. Box Composable

The children of the Box Composable will be stacked over each other. In this case, a FAB will be placed on top of the blue background.

The order matters as they are drawn. You can use the align modifier to specify where the composable should be drawn.

12. Card Composable

Card Composableis the equivalent of a CardView in the old Android View System.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling