r/JetpackComposeDev • • Dec 05 '25

I am writing a book about Jetpack Compose performance

20 Upvotes

There is not a lot of literature about this yet except the official Google docs and codelabs. I went through those and they are very welcome, but they seem to stay very shallow about all the topics. I think there is room for a full guide on how to measure and monitor Compose performance, how to identify pain points, how to fix them, tooling, etc. My plan for this book is the following:

- I really want the book to be useful for day to day work. Theory is nice and all but I really want people to find real applicable action points for their work.

- I want the book to be accurate, of course. When I wrote Jetpack Compose internals, I got many people from the Compose team at Google to review the content, since otherwise what is the point of writing it?

- I want to cover how to identify and detect performance regressions, and how to measure and monitor performance. I have observed that many devs and their teams often overlook perfromance. We focus a lot on adding new features, UI, architecture, testing, automation, tooling... and what not. And then we give performance attention only when something becomes drastically slow or users start to complain and post bad ratings. Many teams do not regularly measure or monitor performance, and some not even test their app on a wide range of devices either. The result of this is that issues often go unnoticed forever or until late in the process, when they are already really hard to fix. This is definitely risky. If anything, I'd like this book to become the guide to prevent this from happening.

- I want to shift people's attention to measuring the actual ultimate goal: performance. Monitoring things like number of recompositions can be a start but it is a bit risky, since devs can end up thinking they have an issue when they don't. Not every single unnecessary recomposition is a problem.

Since we all write Compose code now, I think it is the perfect time to write this book. Any feedback and ideas are more than welcome!

I'll likely be prelaunching this book via Leanpub, so if you want to get notified you can just register in https://leanpub.com/composeperformance


r/JetpackComposeDev • • Oct 09 '25

UI Showcase Glassmorphism Effect With Jetpack Compose

20 Upvotes
  • Animated rotating gradient border

  • Real glass blur effect using dev.chrisbanes.haze

  • Subtle spring scale animation on click

  • Smooth infinite gradient motion around the card

  • Perfect for modern login screens, profile cards, or AI dashboards

Source Code & Credit:
👉 GitHub - ardakazanci/Glassmorphism-Effect-With-JetpackCompose


r/JetpackComposeDev • • Sep 16 '25

Tips & Tricks Jetpack Compose LazyLayout Tips

20 Upvotes

With LazyLayoutCacheWindow, you can improve scrolling performance by pre-caching items that are currently off-screen in Lazy components such as LazyColumn, LazyRow, or LazyVerticalGrid.

androidx.compose.foundation.lazy.layout

NamePurpose
IntervalListRepresents a list of multiple intervals.
LazyLayoutCacheWindowDefines the out-of-viewport area where items should be cached.
LazyLayoutIntervalContent.IntervalCommon content definition of an interval in lazy layouts.
LazyLayoutItemProviderProvides all the info about items to be displayed in a lazy layout.
LazyLayoutMeasurePolicyDefines how a lazy layout should measure and place items.
LazyLayoutMeasureScopeReceiver scope inside the measure block of a lazy layout.
LazyLayoutPinnedItemList.PinnedItemRepresents a pinned item in a lazy layout.
LazyLayoutPrefetchState.PrefetchHandleHandle to control aspects of a prefetch request.
LazyLayoutPrefetchState.PrefetchResultScopeScope for scheduling precompositions & premeasures.
LazyLayoutScrollScopeProvides APIs to customize scroll sessions in lazy layouts.
NestedPrefetchScopeScope allowing nested prefetch requests in a lazy layout.

Video Credit : Arda K


r/JetpackComposeDev • • Aug 23 '25

Tutorial Jetpack Compose Pager Tutorial | Horizontal & Vertical Swipe

20 Upvotes

Learn how to use the Pager component in Jetpack Compose to add smooth horizontal and vertical swiping between pages


r/JetpackComposeDev • • Jan 05 '26

UI Showcase New Year’s Eve Fireworks Animation in Jetpack Compose

19 Upvotes

New Year’s Eve fireworks animation entirely in Jetpack Compose, inspired by the beautiful motion work of Amos Gyamfi.

  • Custom particle system (trail + explosion)

  • Canvas-based rendering with additive blending

  • Time-based physics (gravity, velocity, decay)

  • Smooth infinite animation loop

  • Festive layered animation with Compose graphics APIs

Code (GitHub Gist):
https://gist.github.com/skydoves/ade49203240be5a0fd781c0e9899a886


r/JetpackComposeDev • • Aug 08 '25

UI Showcase Jetsnack - Practice Jetpack Compose with an Official Sample App

Thumbnail
gallery
19 Upvotes

Jetsnack is a sample snack ordering app built with Jetpack Compose.

Use the latest stable version of Android Studio to try this sample.

Features

  • Custom design system

  • Custom layout

  • Animations

Notes

  • Still under development (some screens not yet implemented)

  • Great resource to learn Jetpack Compose concepts and patterns

Get Started

You can:

  1. Clone this repository, or

  2. Import the project in Android Studio (see official guide).


r/JetpackComposeDev • • Aug 05 '25

Tips & Tricks Speed Up Your App: 3 Image Optimization Tips

Thumbnail
gallery
19 Upvotes

Unoptimized images slow down your app and hurt your install rate.

Here are 3 tips to fix that

  • Compress images server-side

  • Switch to WebP format

  • Load images lazily in Jetpack Compose

These small changes can make your app feel faster without sacrificing quality.


r/JetpackComposeDev • • Mar 16 '26

Tips & Tricks Most Android devs have this bug in their ViewModel right now.

Thumbnail
gallery
18 Upvotes

They're using StateFlow for navigation events.

User rotates the phone → app navigates twice → nobody knows why.

StateFlow replays its last value to every new collector. That's a feature for UI state. It's a bug for one-time events.

This is the difference 👇

Part 11 — StateFlow vs SharedFlow

✦ Why StateFlow replays on rotation — and when that destroys you
✦ SharedFlow for navigation & snackbars — fires once, gone forever
✦ The stateIn() pattern every ViewModel should use
✦ WhileSubscribed(5000) — why this is the right default in production
3 questions inside. Score yourself.

Credit : Rohit Kumar


r/JetpackComposeDev • • Nov 13 '25

Tips & Tricks Top Android Interview Questions You’ll See Again and Again in 2025

Thumbnail
gallery
18 Upvotes

r/JetpackComposeDev • • Nov 10 '25

Tips & Tricks Most devs will scroll past this... but every app needs this - Android and iOS!

Thumbnail
gallery
18 Upvotes

Clipboard access? Apple can reject your app for it.
Biometrics? Google Play has strict compliance rules.
And with iOS 17+ & Android 14 showing “Detected Copying” alerts, the risk is real.

Here’s how to stay safe (and published):
* Secure Paste - Stop unauthorized clipboard reads.
* Biometric Auth - Meet Play Store & App Store policies.

Don’t wait for a rejection email - secure it before it’s flagged!


r/JetpackComposeDev • • Oct 13 '25

Tips & Tricks Built a peaceful ripple animation in Jetpack Compose

18 Upvotes

There’s peace in watching waves unfold - soft circles expanding into stillness.
A ripple born of motion, fading gently like time itself.

Source code: A Continues Ripple animation using Jetpack Compose · GitHub

Credit : prshntpnwr


r/JetpackComposeDev • • Sep 22 '25

Tutorial Shape Theming in Material Design 3 and Jetpack Compose

Thumbnail
gallery
18 Upvotes

Material Design 3 (M3) enables brand expression through customizable shapes, allowing visually distinct applications. This guide explores shape theming in M3 and its integration with Jetpack Compose.

https://developer.android.com/develop/ui/compose/graphics/draw/shapes

M3E adds a new set of 35 shapes to add decorative detail for elements like image crops and avatars.

A built-in shape-morph animation allows smooth transitions from one shape to another. This can be dynamic, or as simple as a square changing to a circle.

Code Demo:

https://github.com/chethaase/ShapesDemo


r/JetpackComposeDev • • Aug 31 '25

KMP How to change Localization in Kotlin Multiplatform | KMP

Thumbnail
gallery
18 Upvotes

Changing localization in Kotlin Multiplatform can be done with shared logic while keeping platform-specific implementations clean.

This makes it easy to support multiple languages like English, Hindi, or Spanish without duplicating code.

  • Step 1: Organize Localization Files

  • Step 2: Generate & Use Localized Strings in UI

  • Step 3: Add Expect/Actual Language Change Logic

  • Step 4: Switch Language at Runtime


r/JetpackComposeDev • • Jul 27 '25

Beginner Help I made an app and made one dollar per day via ads.. then what if I made 100 apps and made 100 dollar per day? Is it possible

18 Upvotes

r/JetpackComposeDev • • Feb 16 '26

News The first Beta of Android 17 is now live!

Post image
17 Upvotes

From new profiles and APIs for companion device apps to a unified dialog for companion device setup, Android 17 Beta 1 is packed with updates to help you build high-quality apps more efficiently.

What feature are you most excited to test? Let us know below!
Android Developers Blog: The First Beta of Android 17


r/JetpackComposeDev • • Nov 12 '25

UI Showcase [Open Source] JellyFab – a physics-driven Floating Action Menu for Jetpack Compose

17 Upvotes

Hey folks 👋

I recently open-sourced JellyFab, a physics-based floating action menu for Jetpack Compose.
It’s a composable-first, dependency-free library designed to make motion feel natural — with spring-based dynamics, smooth elastic deformation, and a touch of personality.

⚙️ Key Highlights

  • Jelly-like blob expansion (actual shape deformation, not just scale)

  • Bouncy soft shadow that reacts to the motion

  • Arc-based mini FAB layout + optional secondary radial expansion

  • State-hoisted, predictable, and fully customizable API

💡 Built With

  • Pure Jetpack Compose

  • Animatable & Spring physics

  • Optional scrim overlay with tap-to-collapse

🧠 Why

Most FAB menus in Compose are either too static or rely on rigid scaling. I wanted something more expressive — a UI that feels alive, playful, and responsive to touch.

This led to a deep dive into motion curves, damping ratios, and “squishiness”.
The result: a floating menu that reacts like jelly 🪼

👉 Repo: github.com/iprashantpanwar/JellyFab
📦 Available via JitPack

Would love your thoughts, feedback, or contributions.
What’s your take on adding physics-based motion to Compose UIs?

Follow me:
LinkedIn: https://www.linkedin.com/in/iprashantpanwar/
Medium: https://medium.com/@prashant.panwar777


r/JetpackComposeDev • • Oct 25 '25

Tips & Tricks Don’t Pass MutableState Directly in Jetpack Compose

Thumbnail
gallery
17 Upvotes

Most Compose bugs aren’t logic issues - they’re state management traps. A common mistake: passing MutableState<T> directly between composables.

Why it’s bad:

  • It breaks unidirectional data flow

  • Makes recomposition tracking unpredictable

  • Leads to UI not updating or updating too often

✅ Better Practice:
Pass the value and update lambda instead - e.g.

MyComponent(
    text = name.value,
    onTextChange = { name.value = it }
)

Credit : Naimish Trivedi


r/JetpackComposeDev • • Oct 16 '25

KMP PeopleInSpace - Kotlin Multiplatform project

Thumbnail
gallery
17 Upvotes

Kotlin Multiplatform sample with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, and Compose for Web clients along with Ktor backend.

Source code : https://github.com/joreilly/PeopleInSpace


r/JetpackComposeDev • • Sep 16 '25

Tips & Tricks Why does your app crash on rotation? It’s almost always this… 💀

Thumbnail
gallery
17 Upvotes

Your app looks perfect… until you rotate the screen and it crashes. 💀 Happens all the time when you don’t fully understand the Android Activity Lifecycle.

  • onCreate → onStart → onResume explained

  • ViewModel to survive rotation

  • Leak-safe lifecycle snippet for Compose

  • A solid interview-ready answer

  • onPause, onStop, onDestroy demystified

  • Lifecycle handling in Compose (DisposableEffect)

  • Using rememberSaveable properly

  • Another interview-winning answer

Credit :Prince Lohia


r/JetpackComposeDev • • Sep 07 '25

Tutorial Material 3 Carousel Effect in Jetpack Compose

Thumbnail
gallery
17 Upvotes

Carousels show a collection of items that can be scrolled on and off the screen

  • Multi-browse : Different sized items. Great for browsing lots of content at once (like photos).

  • Uncontained : Same-size items that flow past screen edges. Good when you want extra text or UI above/below.

Tip: Use clipmask() to smoothly clip items to shapes. It accounts for the cross-axis size and applies a mask in the main axis, this is what gives carousels that clean fade/edge effect.

Article link (with code): Material 3 Carousels in Jetpack Compose

There are also two more carousel styles in Material 3: Hero & Full-screen I will be posting Part 2 on those soon!


r/JetpackComposeDev • • Sep 05 '25

Tutorial How to creating a responsive Table View in Jetpack Compose

Post image
17 Upvotes

Creating a Responsive Table View in Jetpack Compose

This tutorial shows how to build a scrollable, dynamic, and reusable table view in Jetpack Compose.
We’ll support custom headers, dynamic rows, styled cells, and status badges (Paid/Unpaid).

🔹 Step 1: Define a TableCell Composable

@Composable
fun TableCell(
    text: String,
    weight: Float,
    isHeader: Boolean = false
) {
    Text(
        text = text,
        modifier = Modifier
            .weight(weight)
            .padding(8.dp),
        style = if (isHeader) {
            MaterialTheme.typography.titleSmall.copy(fontWeight = FontWeight.Bold)
        } else {
            MaterialTheme.typography.bodySmall
        }
    )
}

🔹 Step 2: Create a StatusBadge for Reusability

@Composable
fun StatusBadge(status: String) {
    val color = when (status) {
        "Paid" -> Color(0xFF4CAF50) // Green
        "Unpaid" -> Color(0xFFF44336) // Red
        else -> Color.Gray
    }

    Box(
        modifier = Modifier
            .clip(RoundedCornerShape(12.dp))
            .background(color.copy(alpha = 0.1f))
            .padding(horizontal = 8.dp, vertical = 4.dp)
    ) {
        Text(
            text = status,
            color = color,
            style = MaterialTheme.typography.bodySmall
        )
    }
}

🔹 Step 3: TableView with Dynamic Headers + Rows

@Composable
fun TableView(
    headers: List<String>,
    rows: List<List<String>>
) {
    val horizontalScroll = rememberScrollState()
    val verticalScroll = rememberLazyListState()

    Row(modifier = Modifier.horizontalScroll(horizontalScroll)) {
        Column {
            // Header Row
            Row(
                modifier = Modifier
                    .background(Color(0xFFEEEEEE))
                    .fillMaxWidth()
            ) {
                headers.forEach { header ->
                    TableCell(text = header, weight = 1f, isHeader = true)
                }
            }

            // Data Rows
            LazyColumn(state = verticalScroll) {
                items(rows, key = { row -> row.hashCode() }) { row ->
                    Row(modifier = Modifier.fillMaxWidth()) {
                        row.forEachIndexed { index, cell ->
                            if (headers[index] == "Status") {
                                Box(modifier = Modifier.weight(1f)) {
                                    StatusBadge(status = cell)
                                }
                            } else {
                                TableCell(text = cell, weight = 1f)
                            }
                        }
                    }
                }
            }
        }
    }
}

🔹 Step 4: Using It in Your Screen

@Composable
fun TableScreen() {
    val headers = listOf("Invoice", "Customer", "Amount", "Status")
    val data = listOf(
        listOf("#001", "Alice", "$120", "Paid"),
        listOf("#002", "Bob", "$250", "Unpaid"),
        listOf("#003", "Charlie", "$180", "Paid"),
        listOf("#004", "David", "$90", "Unpaid"),
    )

    Scaffold(
        topBar = {
            TopAppBar(title = { Text("Invoice Table") })
        }
    ) { padding ->
        Column(
            modifier = Modifier
                .padding(padding)
                .fillMaxSize()
        ) {
            TableView(headers = headers, rows = data)
        }
    }
}

Notes

  • Use weight for flexible column sizes.

  • Add horizontal + vertical scroll for Excel-like behavior.

  • Extract UI parts like StatusBadge for clarity.

  • Pass dynamic headers & rows for reusability.

  • Use key in LazyColumn for stable performance.

With this setup, your table is clean, reusable, and scalable


r/JetpackComposeDev • • Aug 13 '25

UI Showcase Glance code samples | Code samples demonstrating how to build widgets with Jetpack Glance using Canonical Widget Layouts

Thumbnail
gallery
17 Upvotes

Jetpack Glance is a new Android library that lets you build app widgets using a Compose-like way - simpler and more modern than the old RemoteViews approach.

You can use it to create homescreen widgets that update based on your app data, with easy-to-write declarative UI code.

Google’s official samples show how to build widgets with Glance using Canonical Widget Layouts here:
https://github.com/android/platform-samples/tree/main/samples/user-interface/appwidgets

If you want to try making widgets in a Compose style, this is a great place to start!

Anyone tried Glance yet?


r/JetpackComposeDev • • Mar 17 '26

Tips & Tricks Navigation 3 is here for the modern era of Jetpack Compose!

Thumbnail
gallery
16 Upvotes

While Navigation 2 has served us well for over 7 years, Navigation 3 brings a major upgrade with more flexibility through decoupled APIs - giving developers greater control and cleaner architecture.

Even better: You can now experiment with Gemini in Android Studio’s Agent Mode to help automate your migration process!

If you're building with Compose, this is something you shouldn't miss 👇

Migration guide: https://developer.android.com/guide/navigation/navigation-3/migration-guide

#AndroidDev #JetpackCompose #AndroidDevelopment #MobileDevelopment #Compose #DevTools #AI


r/JetpackComposeDev • • Sep 08 '25

How I Usually Test Apps Using Logcat (and Disable Logs in Release)

Post image
16 Upvotes

During development, I rely heavily on Logcat to catch issues before writing formal test cases.

My quick workflow:

  • Run the app and move through different screens

  • Watch for errors or abnormal logs

  • Check if logs are repeating (common sign of loop issues)

  • Verify listeners and values are cleared when leaving a page

  • Toggle network off/on and observe logs

Finally, I make sure logs are disabled in release mode so they don't leak sensitive data or clutter output.

1. Enable BuildConfig in Gradle

android {
    buildFeatures {
        buildConfig = true
    }
}

2. Simple Log Util

package com.appdadz.playstore

import android.util.Log
import com.example.BuildConfig

object LogUtil {
    fun d(tag: String, msg: String) {
        if (BuildConfig.DEBUG) Log.d(tag, msg)
    }
}

3. Usage

LogUtil.d("MainActivity", "This will only show in debug builds")

With this setup:

  • Logs are visible in debug builds

  • Logs are skipped in release builds


r/JetpackComposeDev • • Sep 03 '25

Tutorial Key Points on Lazy Grids in Jetpack Compose | Compose Tips for Delightful UI Lazy grids

Thumbnail
gallery
16 Upvotes
  • Why Grids?

    • Lists (rows/columns) are common, but grids make layouts more dynamic and adaptive, especially on larger screens or rotated devices

  • Lazy Grid Basics

    • Use LazyVerticalGrid or LazyHorizontalGrid

    • Define columns with GridCells →

      • Fixed → specific number of columns

      • Fixed Size → as many columns as possible, each with exact size

      • Adaptive → as many columns as possible, each at least a minimum size → best for responsive UIs

  • Arrangements

    • Vertical: Top, Center, Bottom

    • Horizontal: Start, Center, End

    • Both orientations allow custom spacing

  • Headers & Spans

    • Add headers/items as part of the grid

    • Use span property to make an item stretch full width (e.g., header across columns)

  • Responsive Prioritization

    • Use Modifier.weight to control which items shrink/hide first when space is tight

    • Example: Hide publish date before buttons when space is limited

  • Text Handling

    • Control min/max lines and overflow strategy for better readability on different screen sizes

  • Delightful Touch: Swipe to Dismiss

    • Wrap items with SwipeToDismissBox from Material

    • Support only desired swipe direction (e.g., right → left)

    • Add background content like a Delete icon

    • Trigger a removal action (e.g., update repository) when dismissed

  • Outcome

    • The grid dynamically adjusts between single and multiple columns

    • Layout adapts gracefully across devices and orientations

    • UI remains responsive, prioritized, and interactive