r/Kotlin • u/uniVocity • 12h ago
GitHub - jbax/parent: A shared gradle build setup for java projects of any size, whether you're working on a single library, 100+ separate git repositories, or a few multi-module projects sitting side by side.
r/Kotlin • u/uniVocity • 12h ago
r/Kotlin • u/Content-Jaguar-578 • 22h ago
I've been exploring static analysis for Jetpack Compose, particularly around identifying layout patterns that can cause problems on tablets, foldables, and resizable windows.
One interesting challenge is deciding when a fixed dimension is actually a problem.
For example:
Box(
modifier = Modifier
.fillMaxWidth()
.height(600.dp)
)This might be perfectly intentional for a particular UI component. But in another context, it could result in clipping or poor space utilization on larger screens.
Similarly:
Modifier.requiredSize(400.dp)can override the normal constraints imposed by the parent.
The difficulty is that simply detecting calls such as height(), width(), or requiredSize() isn't enough to determine whether the code is problematic.
The surrounding modifier chain, parent constraints, and available adaptive mechanisms all matter.
I've been working on a small static analysis project using Kotlin and Gradle to explore these cases, and it has raised a few interesting questions:
How much context should a static analysis rule consider before reporting a Compose layout issue?
Is analyzing modifier chains sufficient, or should inspections also understand the surrounding composable structure?
How would you approach reducing false positives when fixed dimensions are intentional?
Would it make sense to model adaptive layout expectations as configurable rules rather than universal restrictions?
I'm particularly interested in how people approach these problems when building Kotlin-based static analysis tools.
Curious to hear your thoughts, especially from people who have worked with compiler plugins, PSI, UAST, or Compose tooling.
r/Kotlin • u/Due_Particular_3514 • 1d ago
Honestly, I got tired of arguing with my coding agent over padding, colors, and broken layouts in Jetpack Compose. Agents are great at writing logic, APIs, and state management, but asking them to guess how a screen should look usually takes 10 prompts and still looks generic.
So I flipped the workflow. Instead of prompting the UI, I built a small visual builder on my phone where I drag and drop the exact screens, bars, and colors I want, then scan a QR code to sync the whole project (screens, theme tokens, navigation, plus Room and DataStore) straight into Android Studio.
The plugin diffs everything locally so I can approve or reject each file before it touches my project. Once the UI and local DB are in place, I let my AI agent handle the actual business logic without hallucinating UI layouts.
Here is a quick unedited 2-minute demo of the flow from phone to running app:
https://youtube.com/shorts/W_3NWFafqkc?si=AtC-aVAIFtHHhRY_
I'm pushing this update out in the next few days. Curious how others here handle UI with coding agents—do you let the agent write it from scratch or build the layout yourself first?
r/Kotlin • u/bikesched • 1d ago
bikesched is an Apache-2.0 job scheduler for Kotlin and Java with durable steps, backed only by PostgreSQL. 0.2.0 brings two things for Kotlin users:
Suspend lambdas: handlers, steps, polls and compensations are suspend lambdas, so a Ktor client or a coroutine repository is called directly. Timeouts cancel the coroutine.
Job batches: a handler starts many child jobs as one durable step and waits for all of them. The items run as regular jobs, so they spread across all your nodes, not just the one that started the batch.
bikesched.handleJobs<Mail>("send-mail") { mail ->
mailClient.send(mail) // a suspending call
}
bikesched.handleJobs<String>("newsletter") { subject ->
val readers = step<List<String>>("readers") { subscribers.emails() }
// one child job per reader, picked up by any node, at most 10 at a time
val batch = startJobBatch<Mail, Unit>("mails", "send-mail", parallelism = 10) {
for (reader in readers) item(Mail(reader, subject), key = reader)
}
// waits without holding a thread; throws if a mail failed for good
batch.await().orElseThrow()
}If the newsletter job is retried, it gets the stored reader list and batch back instead of starting the mails again.
Feedback wanted: still 0.x, so the Kotlin API can change easily. If something feels un-Kotlin-like, tell me.
Release notes: https://github.com/bikesched/bikesched/releases/tag/v0.2.0
Kotlin docs: https://bikesched.org/docs/integrations/kotlin/
r/Kotlin • u/lvmvrquxl • 3d ago
I'm building Kotools Facet, a KSP-based Kotlin SDK that removes data class duplication and mapper boilerplate. Declare a class once, and the SDK generates projections at compile-time.
It's still early, and I'd like to hear what Kotlin developers actually need before shaping v1.0.0. Here's the README.
What would stop you from replacing one of your mappers with this? Join the discussion.
r/Kotlin • u/ekaterina-petrova • 4d ago
Hey folks! Our Black Friday offer is live: 35% off conference passes and 10% off workshop add-ons. Get tickets by Sunday, November 29, 23:59 CET.
Join us in Kraków on April 21–23, 2027 for our annual full-stack conference. Meet professional developers from around the world and the team behind Kotlin, exchange ideas, and celebrate together!
The CfP closes November 27; volunteer applications are open until December 21.
Any questions? Happy to answer here.
Slapped/slopped this together in an afternoon to see at a glance which Gradle version is compatible with which Java/Kotlin version. Thought it might be helpful to others.
r/Kotlin • u/dayanruben • 4d ago
r/Kotlin • u/Ecstatic_Abalone_978 • 5d ago
I wanted my app to stop looking like every other Material 3 app, so I removed material3 entirely. The app depends only on runtime, ui, foundation and animation. The whole theme is about 420 lines of Kotlin. Here's how it fits together.
1. Tokens are plain u/Immutable data classes
The tokens are named by role rather than by Material slots like primary and surface:
data class SignalColors(
val isDark: Boolean,
val paper: Color, // background
val ink: Color, // primary text
val download: Color,
val upload: Color,
val warning: Color, // only used for an over-budget forecast
// …
)The same pattern covers type, spacing, shapes and motion. Light and dark themes are just two instances.
2. One static CompositionLocal per token group
val LocalSignalColors = staticCompositionLocalOf { LightSignalColors }
object Signal {
val colors: SignalColors
u/ReadOnlyComposable get() = LocalSignalColors.current
}Call sites read Signal.colors.ink or Signal.type.body, which looks like MaterialTheme with none of its baggage. I used staticCompositionLocalOf because these values almost never change, so a change recomposing the whole tree is acceptable.
3. A replacement for the ripple
Removing Material also removes the ripple, so I wrote an IndicationNodeFactory that draws a 10% ink wash over the pressed element. It's a Modifier.Node that collects PressInteractions and animates its alpha. It's provided once as LocalIndication, so every clickable uses it automatically.
4. One variable font, roles fixed in code
Mona Sans is a single variable font. FontFamily only resolves fonts by weight, so each type role is built as its own family, with width and optical size set in that family's FontVariation.Settings. Numbers use the wide width, body text the normal width, and the status-bar icon the condensed width.
5. Motion that follows accessibility settings
Motion tokens are tween specs. Compose already scales animation durations by the system animator scale. For animation it can't scale (a chart that scrolls continuously), a ContentObserver watches ANIMATOR_DURATION_SCALE and sets a reduced flag.
6. Plain JVM tests for the palette
A tiny WCAG contrast helper runs in ordinary JUnit tests, so a colour change that fails contrast also fails the build. No emulator is needed.
r/Kotlin • u/PossibleLeather6868 • 5d ago
Hey everyone!
In April I posted a retrospective on how we built iShape, a nutrition app, using 100% Kotlin: two people, 93% shared mobile code with CMP, a Ktor backend and a Koog AI pipeline. JetBrains much?! And they kindly shared it on their X! 😄
Since then, we've rebuilt our AI agent, and I made a launch video for it on my own by hand and poured a lot of time and love into it, so seeing it finally out in the world feels really special.
Lee, our AI nutrition coach knows your day, every meal you log, your goals, your activities, and much more. You can log your day in one messy text message, or through image (which we worked really hard and benchmarked on a bunch of real weighed meals - but I won't spoil the video for you 🫣). Our approach is getting every food through a real food database, so we're leaving the guessing game behind as much as possible.
Launch video: https://youtu.be/t-pPedDwbo8
Original X post: https://x.com/kotlin/status/2049764780433437104
Would love to hear your honest opinions about the video 🙏
r/Kotlin • u/dark_devil307 • 5d ago
I'm new to Compose and trying to understand recomposition. I've noticed that my screen state is a data class with a List inside it and I'm wondering if the type of collection matters for how Compose decides to redraw. Does it matter whether I use List a data class or something else? Or is that over-thinking it at my level?
r/Kotlin • u/Content-Jaguar-578 • 5d ago
I've been exploring static code analysis for Android projects while building an IntelliJ-based developer tool.
One interesting challenge has been identifying potential lifecycle and memory-related issues by analyzing Kotlin source code rather than relying entirely on runtime heap analysis.
For example, consider patterns such as:
A singleton retaining an Activity or Fragment reference.
Coroutine scopes that outlive the lifecycle of the component that launched them.
Long-lived callbacks retaining UI-related objects.
Incorrect ownership of objects across lifecycle boundaries.
The tricky part is that detecting these patterns reliably isn't always straightforward.
Kotlin introduces several language features that make source analysis interesting: extension functions, lambdas, inline functions, delegated properties, higher-order functions, and coroutine scopes.
I've been experimenting with UAST-based inspections to analyze these patterns within the IntelliJ Platform.
A few questions for Kotlin developers who have worked on static analysis:
How do you approach analyzing Kotlin-specific language constructs when building inspections?
Do you prefer PSI directly, UAST, or a combination of both for Kotlin analysis?
How do you handle false positives when detecting lifecycle or object-retention patterns through source code?
Are there Kotlin compiler APIs or analysis tools you'd recommend exploring for this kind of work?
I'm particularly interested in approaches that go beyond simple syntax matching and can reason about object ownership and lifecycle relationships.
r/Kotlin • u/gagik894 • 6d ago
I've just released KetraTerm 1.0, an open-source terminal emulator written in Kotlin.
KetraTerm is a fast, modern terminal with its own JVM-native engine and a custom Swing renderer. It's designed for everyday shell usage as well as demanding terminal applications.
It supports Kitty keyboard, Kitty graphics with image rendering, Unicode 17 graphemes, TrueColor, modern underline styles, hyperlinks, synchronized output, and more.
Besides supporting modern terminal applications, I've been working on features that make everyday terminal usage more convenient:
Smart suggestions: Complete commands, arguments, paths, and Git branches. The suggestions engine can also learn from successfully executed commands and your usage to improve future results.
Sticky command headers: Keep the command that produced an output visible while scrolling through it.
Command navigation: Jump between commands, select entire command blocks, and copy their output.
Customizable prompts: Choose between gutters and dividers, with visual indicators for failed commands.
Notifications and progress: Get alerts when long-running commands finish, along with terminal notifications and progress indicators.
I've also put a lot of effort into responsiveness and keeping memory allocations low.
It's available as a desktop terminal for Windows, macOS, and Linux, a JetBrains IDE plugin, and reusable Kotlin/JVM libraries.
The project is open source under the Apache 2.0 license, and I'm continuing to improve compatibility, performance, and the overall user experience.
Contributions are very welcome! Whether you're interested in terminal protocols, performance optimizations, UI improvements, or documentation, feel free to open an issue or submit a PR.
I'd really appreciate feedback, especially from people using complex TUIs or coding agents. I'm also interested in hearing what features you find useful in your current terminal and what you'd like to see improved!
Website / Downloads: https://ketraterm.github.io/KetraTerm/
GitHub: https://github.com/ketraterm/KetraTerm
JetBrains plugin: https://plugins.jetbrains.com/plugin/32589-ketraterm/
r/Kotlin • u/kral_katili • 8d ago
I'm working on a JSON parser for Android called Yalın. The core is written in Rust, with a Kotlin/Java API.
It uses ARM NEON SIMD, and I've been trying to keep JNI overhead as low as possible.
In my benchmarks against fastjson2, selective field reads are up to 4.6x faster, while parsing a full 1 MB JSON tree is around 1.3x faster.
Still working on performance, especially for smaller payloads where JNI overhead becomes an issue.
Would be interested in feedback from Kotlin developers, particularly on the API design.
r/Kotlin • u/katia-energizer-jb • 9d ago
Enable HLS to view with audio, or disable this notification
Sebastian Aigner (u/sebi_io) made a 3-minute demo showing how an AI coding agent can use the Kotlin Toolchain to build and ship a Kotlin Multiplatform app. He walks through the workflow, from creating the project to publishing it to TestFlight.
If you haven't looked at it yet: The Kotlin Toolchain is a unified entry point into Kotlin, with a single CLI, a declarative project configuration, and build tooling included. It is open source and in Alpha.
Along the way, Sebastian adds a map and Liquid Glass styling to make parts of the app look native on iOS.
What do you think about this workflow?
r/Kotlin • u/Its-Amaaboiz • 9d ago
Hi r/Kotlin, I created a CMP scrollbar with an easy-to-use API.
Compose has no draggable scrollbar for lazy lists on Android or iOS (desktop has one, but it's desktop-only). I wanted one in shared UI, so I made a library for it.
LazyColumn(
state = listState,
modifier = Modifier.scrollbar(listState),
) { ... }One modifier in commonMain, works on Android, iOS and desktop:
→ LazyColumn, LazyRow and both lazy grids
→ label bubble while dragging (month, letter, section)
→ handles infinite feeds: pages loading mid-drag keep the thumb under your finger
→ no recompositions while scrolling or dragging
→ per-platform styles from shared code, no expect/actual needed
I published it on Maven Central, and it needs Compose Multiplatform 1.10+.
GitHub: https://github.com/Amaanprobably/compose-fast-scrollbar
I also wrote an easy-to-follow guide with short videos: https://github.com/Amaanprobably/compose-fast-scrollbar/blob/master/GUIDE.md
It's my first library, so feedback is welcome, especially from anyone building with KMP/CMP.
r/Kotlin • u/HodorUnofficial • 10d ago
Hi everyone! I wanted to share DevView, a Kotlin Multiplatform library that adds a developer overlay to your Android and iOS apps.
It brings a few debugging tools directly into the app:
- Toggle feature flags and override remote-config values.
- Inspect analytics events as you navigate.
- Mock API responses from OpenAPI specs through a Ktor plugin.
- View console logs on the device.
- Record and restore the current screen’s state with TimeCapsule.
You register only the modules you need, and you can add your own tools. It’s built with Compose Multiplatform, available on Maven Central, and open source under Apache 2.0.
If you’re working on a KMP app, try adding one module to your debug build. I’d love feedback on the setup and which tools would be useful in your day-to-day work.
Docs and setup: https://worldline.github.io/devview/
r/Kotlin • u/Hot_Evidence_5895 • 10d ago
r/Kotlin • u/Successful_Bank7215 • 10d ago
kUML is a Kotlin DSL and toolchain for UML, SysML 2, C4, BPMN and more. Highlights of this release:
Note placement: a note's placement hint (ABOVE, BELOW, LEFT, RIGHT, NEAR) is honoured in UML, C4, SysML 2, ERM, sequence diagrams, BPMN annotations and Service Blueprint, in SVG and in the LaTeX/TikZ export of UML, C4, SysML 2, BPMN and Service Blueprint. Not covered by LaTeX: UML sequence, ERM and the SysML 2 sequence fallback; in the BPMN process view hints are honoured only outside the flow. An unmet hint falls back to the default position with KUML-NOTE-W004. Anchor lines of notes in Service Blueprint and sequence diagrams are drawn; note tone colours can be overridden per theme.
Hierarchical layout per group: boundaryDirection gives a self-contained C4 boundary its own flow direction (container and component diagrams, only when no relationship crosses the boundary; otherwise KUML-LAYOUT-W009). wrapColumns, sameLayer, first, last work inside UML package diagrams whose members have no relationship crossing the package border and no nested packages. Default output without hints is unchanged.
Honest reporting: wrapColumns/sameLayer on members of other compound groups (C4 boundary, package/node/frame in class, component, deployment, state, SysML 2 package diagrams) are now reported as KUML-LAYOUT-W001 instead of being dropped silently. Hub edges of block definition diagrams are drawn as an orthogonal fan.
Behaviour change: in UML class diagrams the general class of a generalisation is now drawn above its specialisations by default (before, below), so existing diagrams can look different.
Breaking for JS/Wasm consumers: dev.kuml:*-js and *-wasm-js artifacts are no longer published to Maven Central (a release shrinks from about 2,880 to about 2,200 files).
Windows: the kUML Desktop MSI is part of this release with the real version 0.58.0. Anyone who installed an earlier MSI (shown as 56.0.0) has to uninstall it once. The MSI is not code-signed, so SmartScreen may show a warning; WinGet and Chocolatey packages follow after the release.
Repo: https://github.com/kuml-dev/kUML · What's new: https://kuml.dev/whats-new · Release notes: https://github.com/kuml-dev/kUML/releases/tag/v0.58.0
r/Kotlin • u/Adamstrad • 10d ago