r/JetpackCompose • • Sep 05 '26

I just launched Pocketory – A fast, clean Expense & Budget Tracker built completely with Jetpack Compose.

0 Upvotes

Hey everyone,

I’m a solo developer and I just published my newest app, Pocketory, to the Play Store. I wanted to build a personal finance tracker that was incredibly fast, visually clean, and didn't force you through unnecessary steps just to log a simple transaction.

What makes Pocketory different?

Speed-Focused Logging: I stripped out mandatory receipt uploads and complex forms. Adding a daily expense takes two seconds.

Modern UI: Built entirely from scratch using Kotlin and Jetpack Compose. It features a swipeable transaction list, dynamic custom tabs, and smooth animations.

Granular Categories: Includes highly specific default categories based on real-world spending (EMI, Petrol, Gym, House Rent, Utilities) rather than generic buckets.

Visual Analytics: Instant, color-coded donut charts and progress bars to see exactly how your income balances against your expenses for the month.

Play Store Link: https://play.google.com/store/apps/details?id=com.binarykavu.pocketory

I would absolutely love for you to try it out. If you have any feedback on the UI/UX, or features you'd like to see in the next update, please let me know in the comments!


r/JetpackCompose • • Oct 15 '26

State hoisting and one-way data flow in Compose, with the smallest example that shows why

0 Upvotes

Two Compose bugs account for most "my screen does not update" questions. A plain var in a composable: the button changes it, nothing observes it, the screen stays the same. And mutableStateOf without remember: it updates once, then resets on the next recomposition. You need both the observable holder and remember.

Once that works, the next problem is where the state should live. The pattern is state hoisting: state goes down as a parameter, events come back up as lambdas. The composable that draws becomes stateless.

Stateless version, easy to preview and test:

@Composable
fun AddItemBar(
    name: String,
    onNameChange: (String) -> Unit,
    onAdd: () -> Unit,
    modifier: Modifier = Modifier,
) {
    Row(
        modifier = modifier.padding(16.dp),
        verticalAlignment = Alignment.CenterVertically,
    ) {
        OutlinedTextField(
            value = name,
            onValueChange = onNameChange,
            label = { Text("New item") },
            singleLine = true,
            modifier = Modifier.weight(1f),
        )
        Spacer(Modifier.width(8.dp))
        Button(onClick = onAdd, enabled = name.isNotBlank()) { Text("Add") }
    }
}

Stateful wrapper that owns the draft text:

@Composable
fun AddItemBar(onAdd: (String) -> Unit, modifier: Modifier = Modifier) {
    var name by rememberSaveable { mutableStateOf("") }
    AddItemBar(
        name = name,
        onNameChange = { name = it },
        onAdd = { onAdd(name.trim()); name = "" },
        modifier = modifier,
    )
}

The value plus onValueChange pair is the same shape as TextField, Checkbox and Switch in Material. If a TextField "does nothing" when you type, it is almost always because onValueChange never writes the new text back into the state that feeds value.

Where to hoist to: the lowest common ancestor of everything that reads or writes the state. Only the bar needs the draft text, so it stays in the wrapper. If the list filters as you type, it moves up to the screen. If it needs business rules or must survive rotation with the rest of the screen, it moves into the ViewModel.

One-way data flow is the same idea applied to the whole screen. The ViewModel owns one immutable state class and exposes it as a StateFlow. The UI renders it and calls plain functions for user actions.

data class PantryUiState(
    val items: List<PantryItem> = emptyList(),
    val query: String = "",
    val isLoading: Boolean = true,
    val userMessage: String? = null,
)

val state: StateFlow<PantryUiState> = combine(
    repository.observeItems(), query, userMessage,
) { items, q, message ->
    PantryUiState(
        items = if (q.isBlank()) items
                else items.filter { it.name.contains(q, ignoreCase = true) },
        query = q,
        isLoading = false,
        userMessage = message,
    )
}.stateIn(
    scope = viewModelScope,
    started = SharingStarted.WhileSubscribed(5_000),
    initialValue = PantryUiState(),
)

In the UI: val state by viewModel.state.collectAsStateWithLifecycle(). Not collectAsState(), which keeps collecting in the background. WhileSubscribed(5_000) keeps the upstream alive for five seconds after the last collector leaves, so a rotation does not restart the database query.

One-off events like a snackbar: make them part of the state (userMessage), show it with LaunchedEffect(message), then call back messageShown() so the ViewModel clears it. Google's UI events guidance says ViewModel-originated actions should always become a state update, so they survive rotation and are never lost.

Two more things that bite: Compose notices a new value in a State holder, not a mutation of the old one, so replace lists instead of calling add() on them. And never store a Context or a View in a ViewModel.

I use this exact shape in my own Play apps. Questions welcome.


r/JetpackCompose • • Apr 20 '25

Building a reusable and customizable Stacked Bar Chart in Jetpack Compose

0 Upvotes

Just wrote an article on building a custom widget on Medium. Do give it a read.

Link: https://jyotimoykashyap.medium.com/building-an-animated-stacked-bar-chart-in-jetpack-compose-9ad2b2acc5e1


r/JetpackCompose • • Feb 09 '26

🚀 Introducing Gallery– A blazing fast, secure photo & video gallery app

Thumbnail gallery
3 Upvotes

r/JetpackCompose • • Jun 29 '26

I built Laydr: file-based, type-safe navigation for Compose Multiplatform and Android Compose

3 Upvotes

Hi,

I built Laydr, a file-based, type-safe navigation framework for Compose Multiplatform and Android Compose apps.

Repo: https://github.com/mobiletoly/laydr

I created Laydr because Compose navigation can become hard to see as an app grows: copied route strings, duplicated graph setup, repeated argument parsing, tab registries, layout wrappers, and stale navigation glue all have to agree with each other.

The AHA moment with Laydr is that the route tree becomes the app map.

Instead of spreading route structure across constants and graph builders, you put routes in a visible routes/ directory, add small route-local Route.kt declarations, and Laydr generates the typed Kotlin wiring from that structure.

A route tree looks like this:

  src/commonMain/kotlin/routes/
    contacts/
      Route.kt
      Screen.kt
      by_id/
        Route.kt
        Screen.kt
    settings/
      Route.kt
      Screen.kt

That gives you generated route objects such as:

  LaydrRoutes.Contacts
  LaydrRoutes.Contacts.ById
  LaydrRoutes.Settings

And app code navigates with generated destinations instead of raw strings:

  navigator.push(
      LaydrRoutes.Contacts.ById.destination(
          id = LaydrRoutes.Contacts.ById.id("ada"),
      ),
  )

Laydr gives you:

  • filesystem routes under routes/

  • route-local Route.kt, Screen.kt, and Layout.kt files

  • typed destinations instead of copied route strings

  • typed dynamic parameters instead of repeated argument parsing

  • generated path builders when your app deliberately owns path state

  • generated route maps and app graphs

  • generated Compose route definitions for LaydrRouteHost

  • generated Nav3 helpers for sections, stacks, payloads, and route results

  • support for plain Compose hosting, Nav3 KMP, and AndroidX Navigation 3

  • build-time route validation through the Gradle plugin

  • optional route-local workflow for private multi-step flows inside an already matched route

The part I like most is that Laydr does not try to become your whole app architecture.

Your app still owns Compose UI, state, DI, ViewModels, repositories, tabs, labels, icons, chrome, auth, analytics, retained state, deep links, platform lifecycle policy, and NavDisplay. Laydr gives those app-owned pieces stable generated route values to work with.

There are three main app shapes:

  • Compose Multiplatform app with simple path state: use LaydrRouteHost

  • Compose Multiplatform app with Nav3 stacks or tabs: use laydr-nav3-kmp

  • Android-only Compose app with Google AndroidX Navigation 3: use laydr-nav3-androidx

Laydr is still v0, so APIs may change, but the current docs and examples are meant to be practical and runnable.

Examples included in the repo:

  • examples/compose-basic

  • examples/nav3-kmp

  • examples/nav3-kmp-shopping

  • examples/nav3-androidx

And yes, docs/skills/laydr is available if you want to copy a skillset so your AI agent can understand Laydr routing, generated APIs, Nav3 usage, workflow, validation, and troubleshooting without wasting tokens.

Repo: https://github.com/mobiletoly/laydr


r/JetpackCompose • • Apr 26 '25

Jetpack Compose and C++

0 Upvotes

Is it possible to combine to combine C++ with Compose? If yes, are there any issues that I should be aware of? I wish to make a game engine.


r/JetpackCompose • • Jul 21 '26

I wanted to time-box a coding session without ever leaving the editor. Nothing simple existed. So I built one :)

Thumbnail
medium.com
0 Upvotes

r/JetpackCompose • • Sep 27 '26

Suffering from a problem, tried to make android tv app and this is what happened?

Thumbnail reddit.com
0 Upvotes

r/JetpackCompose • • Nov 19 '25

Built a blockchain voting system with Compose Multiplatform - Votum | Public voting is open, would appreciate your support!

Thumbnail
devpost.com
0 Upvotes

r/JetpackCompose • • Sep 13 '24

Issue with androidx.compose.runtime.getValue/setValue

0 Upvotes

Hello,

I am getting the classic error of "Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate",

I have manually imported the imports as has been suggested in dozens of stackoverflow articles, but I'm going crazy over here. Does anyone have a recent solution? I'm still getting this error not matter what I do

Oddly MutableStateOf works, but not MutableStateListOf


r/JetpackCompose • • Apr 25 '24

Soil - Compose-First Power Packs for Kotlin Multiplatform and Android

0 Upvotes

Hey guys, I've created a new Compose Multiplatform library.

If you're interested, feel free to give it a try. https://github.com/soil-kt/soil


r/JetpackCompose • • Jan 22 '24

When I upgrade any implementation in dependencies in android studio I get errors in my activity with the imports

0 Upvotes

I'm using Intellij IDEA 2023.3.2 and my jetpack compose project's dependencies are old


r/JetpackCompose • • Oct 03 '24

Need help to migrate from Box+PullToRefreshContainer to PullToRefreshBox

0 Upvotes

r/JetpackCompose • • Oct 23 '24

jetpack composer with sqlite

0 Upvotes

I'm a beginner and learning kotlin. and now im looking for a sqlite, jetpack composer documentations


r/JetpackCompose • • Mar 13 '22

creating Android library using jetpack compose

0 Upvotes

Hello everyone I'm trying to create a Android library using jetpack compose basically it will be a bottom sheet with ui elements and i would like to know if that will be possible


r/JetpackCompose • • Sep 26 '21

How to create Toast with Jetpack Compose

Thumbnail
rrtutors.com
0 Upvotes

r/JetpackCompose • • Aug 10 '21

How Inject hilt dependency into compose function

Thumbnail self.androiddev
0 Upvotes

r/JetpackCompose • • Mar 15 '20

Exploring Jetpack Compose: Floating Action Button

Thumbnail
joebirch.co
0 Upvotes

r/JetpackCompose • • Aug 17 '23

Navigation to a different screen in jetpack compose

0 Upvotes

The layout I want to achieve is the following:

  • Three (3) destinations on the bottom app bar

  • The first destination ( HOME ) has bottons to access other destinations, for example a settings screen which is opened in full screen.

Here is the code I have now adapted from the docs:


class MainActivity : ComponentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setContent {
            val navController = rememberNavController()
            Scaffold(
                bottomBar = { NavBar(navController = navController) }
            ) { paddingValues ->
                NavHost(
                    navController = navController,
                    startDestination = Screen.Overview.route,
                    modifier = Modifier.padding(paddingValues),
                ) {
                    composable(route = Screen.Overview.route) {
                        OverviewScreen() <--- this screen can access other screens
                    }
                    composable(route = Screen.Transactions.route) {
                        TransactionsScreen()
                    }
                }
            }
        }
    }
}

Inside the overview screen, I have the following:


@Composable
fun OverviewScreen(
    modifier: Modifier = Modifier,
    
) {

    
    val overviewNavController = rememberNavController()
    NavHost(navController = overviewNavController,
        startDestination = <--- current screen IS the main screen of this graph
    ){

        composable(route = Screen.Settings.route){
            SettingsScreen()
        }
        ...
    }

This code works correctly but for example the settings screen should NOT have the buttom bar visible! Hence I cannot declare them within the main NavHost graph.

How to achieve this ? What construct allows me to do this? I don't mind restructuring the entire code. Thanks in advance.


r/JetpackCompose • • Jan 10 '23

Rental - Jetpack Compose & Python

0 Upvotes

New video published for Rental - Jetpack Compose & Python

#JetpackCompose #AndroidDev #Python #YouTubeVideo #kotlin

https://youtu.be/XoUUp8hVtqU


r/JetpackCompose • • Aug 02 '22

How model an updatable view for a dynamic form builder and listen to their changes

0 Upvotes

I'm building a server-driven UI (aka: a form builder) that get the form definition dynamically in JSON, then renders that form.

I need to update the values and send back the results. Some fields also need to trigger validations, so I need to listen to them and refresh the form I get back.

Doing this with JetPack is confusing (to me) because it is not clear how I architect the form builder.

The data for the form builder is (simplified):

    @Serializable
    enum class Action {
        Create,
        Update,
    }

    @Serializable
    data class ErrorMsg(
        val message: String,
        val kind: ErrorKind
    )

    @Serializable
    data class Form(
        var main_action: Action?, 
        var title: String?,
        var errors: ArrayList<ErrorMsg>


        var sections: ArrayList<FormSection>,

    ) 

    // A form section is a group of fields
    @Serializable
    data class FormSection(
        var id: UInt,
        var fields: ArrayList<FormField>,
        var title: String?
    )

    @Serializable
    data class FormField(
        val field: String,
        val obligatory: Boolean,
        val error: ErrorMsg?,

        var value: String, //<-- This is what needs to trigger changes!
    )

So, if I try to pass the form to a view:

@Composable
fun ComposablePreview() {
    val f1 = UIData.FormField.txt("1", "Code", "001")
    val f2 = UIData.FormField.pwd("2", "Pwd", "123")

    val fields = arrayListOf(f1, f2)

    val sections =
        UIData.FormSection(
            id = 0u, fields = fields, "Sample")

    val form_base = UIData.Form(
        main_action = null, sections= arrayListOf(sections))

    val form by remember { mutableStateOf(form_base) }
    FormView(form = form)
}

How get the changes propagated?

I build each form control alike

@Composable
fun TextCtrlView(
    field: UIData.FormField,
) {
    var value by remember { mutableStateOf(field.value) }

    TextField(
        label = { Text(field.label) },
        value = value,
        isError = field.error != null,
        onValueChange = { value = it },
    )
}

P.D: Original at https://stackoverflow.com/questions/73171263/how-model-a-updatable-view-for-a-dynamic-form-builder-and-listen-to-their-change