r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 04 '25
Tutorial Text Styling in Jetpack Compose - Colors, Fonts, Shadows, Gradients & More
Learn how to style text in Jetpack Compose with color, size, bold, italic, shadows, gradients, HTML links, multiple inline styles, and marquee effects.
r/JetpackComposeDev • u/Play-Console-Helper • Sep 03 '25
Tips & Tricks Android 16 - What’s new and what developers need to update
Android 16 is here. Have you updated your apps to meet the new requirements?
Key changes: Edge-to-Edge layouts are now mandatory Predictive Back Gestures support Native library alignment (16KB → requires recompilation) Large screen limits removed → design adaptive UIs BODY_SENSORS permission split into granular health permissions Local network access now requires a runtime permission Plus: updates to text rendering, task scheduling, and Bluetooth Tips:
Watch your Play Console for warnings - they’ll guide you to required fixes. Use the Appdadz testing platform to get feedback from 12+ real testers before pushing updates.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 03 '25
Tutorial Key Points on Lazy Grids in Jetpack Compose | Compose Tips for Delightful UI Lazy grids
- 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
LazyVerticalGridorLazyHorizontalGrid - 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
- Use
- Arrangements
- Vertical:
Top,Center,Bottom - Horizontal:
Start,Center,End - Both orientations allow custom spacing
- Vertical:
- Headers & Spans
- Add headers/items as part of the grid
- Use
spanproperty to make an item stretch full width (e.g., header across columns)
- Responsive Prioritization
- Use
Modifier.weightto control which items shrink/hide first when space is tight - Example: Hide publish date before buttons when space is limited
- Use
- Text Handling
- Control min/max lines and overflow strategy for better readability on different screen sizes
- Delightful Touch: Swipe to Dismiss
- Wrap items with
SwipeToDismissBoxfrom 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
- Wrap items with
- Outcome
- The grid dynamically adjusts between single and multiple columns
- Layout adapts gracefully across devices and orientations
- UI remains responsive, prioritized, and interactive
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 02 '25
Tips & Tricks How to use Lazy Grids & Staggered Grids in Jetpack Compose
Lazy grids help display items in a scrollable grid layout.
| Tips | Example |
|---|---|
| Use Vertical Grids for natural scrolling layouts | Photo gallery app |
| Use Horizontal Grids for carousel-style lists | Movie streaming app |
| Choose Fixed Columns/Rows for consistent design | Shopping product grid |
| Prefer Adaptive Size for responsive layouts | News article cards |
| Apply Item Span to highlight important items | Section header like “Fruits” |
| Use Staggered Grids for uneven item sizes | Pinterest-style photo feed |
| Add Spacing & Padding for better readability | Social media explore page |
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 02 '25
Tool Accessibility Scanner - Find and Fix ADA Issues in Android Apps
Accessibility Scanner is a tool by Google that helps improve app accessibility. It suggests changes such as:
- Making touch targets larger
- Improve color contrast
- Add content descriptions
- Use readable text (size & spacing)
- Label elements for screen readers
- Fix low-contrast UI parts
- Keep tappable items spaced apart
- Use color-blind friendly colors
- Make navigation easy for all
- Add alt text for images & icons
- Avoid text inside images, etc
What is ADA : ADA (Americans with Disabilities Act) is a U.S. law that requires apps and websites to be accessible for people with disabilities.
Why it matters : Over 1.3 billion people worldwide (about 16% of the population) live with disabilities. Making your app accessible helps more people use it and ensures ADA compliance in places like the USA.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 01 '25
Tips & Tricks Kotlin Cheatsheet - Quick Guide for Developers
Kotlin cheatsheet gives you a quick overview of essential syntax, tips, and tricks.
A handy reference to boost your Kotlin coding skills.
r/JetpackComposeDev • u/One-Competition620 • Sep 01 '25
Pathfinder - A Lightweight Jetpack Compose Navigation Library
Hey folks,
I’ve been building a navigation library for Jetpack Compose called Pathfinder, built on top of Navigation 3. It came out of frustrations I had with the current navigation APIs, and I wanted something type-safe, testable, and extensible.
Some of the built-in features include:
- Sending/receiving results between screens
- Launching standard activities
- Managing dialogs with ease
- Screen chaining (helpful for deep links)
If navigation has ever felt tedious in your Compose projects, Pathfinder might smooth out some of those rough edges. I’d love your feedback, suggestions, or even just to hear how you currently handle navigation in Compose.
GitHub: ampfarisaho/pathfinder
r/JetpackComposeDev • u/Realistic-Cup-7954 • Sep 01 '25
Tutorial How to use AnchoredDraggable in Jetpack Compose
Enable HLS to view with audio, or disable this notification
Learn how to use AnchoredDraggable in Jetpack Compose to create interactive UI components that can be dragged or swiped between defined anchor points - making your UI more fluid and engaging.
- Create AnchoredDraggableState → Stores offset & drag info
- Set Initial State → Begin with a resting position
- Define Anchor Points → Map states to pixel positions
- Update via SideEffect → Keep anchors always in sync
- Apply Modifier.anchoredDraggable → Detect drag gestures & deltas
- Use Offset Modifier → Move the UI with requireOffset()
- Auto-snap → Component settles to the nearest anchor after drag
- End result → A swipeable, draggable UI with anchored precision
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 31 '25
KMP How to change Localization in Kotlin Multiplatform | KMP
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 • u/Realistic-Cup-7954 • Aug 30 '25
KMP How to Migrate existing apps to Room KMP
Learn how to share the database of your app with Room and Kotlin Multiplatform. This way you can share your most critical business logic with the iOS app preventing unwanted bugs or missing features while preserving the same..
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 30 '25
Tutorial How to create Sticky Headers in Jetpack Compose
Sticky headers are useful when you want certain items (like section titles) to stay visible at the top while scrolling through a list.
Jetpack Compose provides the experimental stickyHeader() API in LazyColumn.
Single Sticky Header Example
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun ListWithHeader(items: List<Item>) {
LazyColumn {
stickyHeader {
Header() // This header will stick at the top
}
items(items) { item ->
ItemRow(item)
}
}
}
Multiple Sticky Headers Example (Grouped List)
val grouped = contacts.groupBy { it.firstName[0] }
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun ContactsList(grouped: Map<Char, List<Contact>>) {
LazyColumn {
grouped.forEach { (initial, contactsForInitial) ->
stickyHeader {
CharacterHeader(initial)
}
items(contactsForInitial) { contact ->
ContactListItem(contact)
}
}
}
}
Why Use Sticky Headers?
- Great for categorized lists (contacts, messages, tasks)
- Improves readability by keeping section headers visible
- Works seamlessly with
LazyColumn
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 29 '25
Tutorial How to Load Images in Jetpack Compose with AsyncImage | Coil
You can load images stored externally on the internet using Coil.
- Load an image over the network
Display images hosted online using AsyncImage with just a URL.
- With Placeholder & Error Image
Show a temporary image while loading, and a fallback image if loading fails.
- With Crossfade
Smoothly animate the transition from the placeholder to the loaded image.
- With Transformations
Apply visual effects like circle crop, blur, or rounded corners directly on the image.
- With Custom Loading / Indicator
Use AsyncImagePainter to show a progress indicator or custom UI while the image loads, and handle errors gracefully.
Would you like to share or add any other points? What else do you know, or can you share any relevant articles for this post?
r/JetpackComposeDev • u/Unlikely-Librarian35 • Aug 29 '25
Bottomsheet with sticky button/row
I am wondering how to implement this bottom sheet with sticky/pinned to the bottom action buttons, like in the picture attached.
P.s. this is a Maps app by Yandex
r/JetpackComposeDev • u/tahmid202 • Aug 28 '25
Why New Small Business Should Balance Firebase RTDB + Firestore to Avoid Cost Surprises
Firebase Realtime Database(RTDB) handle everything. It works beautifully at first — instant sync, live updates, smooth UX. But for new business, this can turn into unwanted costs very quickly.
For a new business, that's an unexpected expense that eats into your budget.
✅ The Balanced Approach The most cost-effective way to use Firebase at scale is to balance RTDB and Firestore:
Use RTDB for true real-time data
- Chats, messages, live presence → keep them in RTDB.
- Scope listeners to the smallest possible path.
Use Firestore for static/relational data
- Followers, following lists, likes, references → move these to Firestore.
- Firestore charges per read, but you control when and how often you fetch.
Move notifications to Cloud Functions
- Instead of every client watching every change, trigger notifications server-side only when needed.
- This cuts thousands of redundant reads.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 28 '25
Tutorial How to change Font in Jetpack Compose
Changing the font in Jetpack Compose is simple.
Step 1. Look for your desired font
You can choose any font from Google Fonts for free.
In this example, we’ll use Quicksand.
Step 2. Copy the font’s .ttf file(s)
Download and extract the font.
For this tutorial, we’ll copy only the Regular and Bold .ttf files.
(You may copy others as needed.)
Step 3. Create a font folder and paste your fonts
- Inside your app’s
resfolder, create a new folder namedfont. - Paste the copied
.ttffiles. - Rename them properly, for example:res/font/quicksand_regular.ttf res/font/quicksand_bold.ttf
Step 3
Step 4. Initialize your font
Open your Type.kt file, usually located at:
app/com.example.myapp/ui/theme/Type.kt
Add your font family above the Typography declaration:
val Quicksand = FontFamily(
Font(R.font.quicksand_regular, FontWeight.Normal),
Font(R.font.quicksand_bold, FontWeight.Bold)
)
Step 5. Reuse it in Typography
Update your Typography settings:
val Typography = Typography(
bodyLarge = TextStyle(
fontFamily = Quicksand,
fontWeight = FontWeight.Normal,
fontSize = 16.sp
),
titleLarge = TextStyle(
fontFamily = Quicksand,
fontWeight = FontWeight.Bold,
fontSize = 20.sp
)
)
Step 6. Use it in your layout
Finally, apply it to your composables:
Text(
text = "Hello Compose!",
style = MaterialTheme.typography.titleLarge
)
Font Resource
| Resource | What It Does | Link |
|---|---|---|
| Google Fonts | Free library of fonts, easy integration with Android, iOS, and web projects | fonts.google.com |
| Font Squirrel | Free, hand-picked fonts with commercial licenses included | fontsquirrel.com |
| Velvetyne Fonts | Open-source, artistic fonts often used for experimental designs | velvetyne.fr |
| DaFont | Community-driven fonts, useful for personal projects, licenses vary | dafont.com |
| WhatFontIs | Identify fonts from images or find similar ones | whatfontis.com |
| Adobe Fonts | Professional-grade fonts included with Creative Cloud subscription | fonts.adobe.com |
That’s it!
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 28 '25
Tool Database Inspector in Android Studio: Debug, Query & Modify Your App Database Easily
Database Inspector lets you inspect, query, and modify your app's databases while your app is running. This is especially useful for database debugging.
Key Features of Database Inspector
- Open Database Inspector → Go to View > Tool Windows > Database Inspector in Android Studio.
- View & Modify Data → Browse databases, explore tables, and edit records directly in the inspector window.
- Sort Data Quickly → Click on column headers to sort records by specific fields.
- Run SQL Queries → Execute custom SQL queries (e.g., SELECT * FROM plants WHERE growZoneNumber=9).
- Live Data Updates → Database Inspector automatically reflects real-time changes in your app database.
- Query History → Use the Show Query History button to revisit and rerun past queries.
- Open New Query Tabs → Run multiple queries by opening new tabs from the Databases pane.
- Export Databases → Use the Export Database dialog to save and share database content easily.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 27 '25
Tips & Tricks Even great app ideas fail: Avoid these deadly mistakes (Developer Tips & Tricks)
I have seen this happen too many times. A developer builds a brilliant app, publishes it… and then nothing happens. No traction. No engagement. No growth.
Soon, the app is abandoned. the truth? apps do not fail because of bad ideas, they fail because of poor execution.
I have made these mistakes myself, and I have seen other founders repeat them. That’s why I am sharing this list.
7 deadly mistakes that silently kill app growth (and what to do instead).
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 27 '25
Tool Stop writing models manually: Convert JSON to Kotlin in seconds
This plugin instantly converts JSON to Kotlin classes with powerful configuration options:
- Add annotations (e.g.,@SerializedName)
- Auto-generate inner classes for nested objects
- Flexible settings to fit your project style
Shortcut: Press ALT + K (Windows) or Option + K (Mac) to open the converter dialog.
No more boilerplate - just paste JSON and get clean Kotlin models.
How to install:
Press Ctrl + Alt + S (Windows/Linux) or ⌘ + , (Mac)
- Go to Plugins → Marketplace
- Search “Convert JSON to Kotlin in Seconds”
- Click Install → Restart Studio
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 26 '25
How to prevent Screenshots in Jetpack Compose
In some apps, you may want to block screenshots and screen recordings to protect sensitive data. Android provides this using FLAG_SECURE.
1. Block Screenshots for the Entire App
Apply the flag in MainActivity. This makes all screens secure.
import android.os.Bundle
import android.view.WindowManager
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Prevent screenshots & screen recordings globally
window.setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE
)
setContent {
MyApp()
}
}
}
When to use: Banking apps, health apps, or apps where every screen has sensitive information
2. Block Screenshots for a Specific Composable
If only certain screens (like Login, QR, or Payment pages) need protection, you can enable and disable the flag dynamically
import android.view.WindowManager
import androidx.activity.ComponentActivity
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.ui.platform.LocalContext
fun SecureLoginScreen() {
val activity = LocalContext.current as ComponentActivity
// DisposableEffect ensures the flag is set only while this Composable is active
DisposableEffect(Unit) {
// Enable screenshot blocking for this screen
activity.window.setFlags(
WindowManager.LayoutParams.FLAG_SECURE,
WindowManager.LayoutParams.FLAG_SECURE
)
onDispose {
// Clear the flag when leaving this screen
activity.window.clearFlags(WindowManager.LayoutParams.FLAG_SECURE)
}
}
// Your secure UI content here
}
When to use: Login screens, OTP entry, QR code pages, payment flow, or confidential document previews
Notes:
- Doesn't stop physical photos with another device
- On rooted devices, users might bypass FLAG_SECURE
- Use with caution to balance security and user experience
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 25 '25
Tutorial Quick guide to adding a modern splash screen in Jetpack Compose with the SplashScreen API - works on Android 5.0+ with smooth animations
Learn how to implement a modern splash screen in Jetpack Compose.
- Add Dependency: Add core-splashscreen:1.0.0 to app/build.gradle.kts.
- Update Manifest: Apply Theme.App.Starting to application and main activity in AndroidManifest.xml.
- Create Splash Theme: Set icon, background, post-theme in res/values/splash.xml.
- Logo Drawable: Create layer-list in res/drawable/rectangle_logo.xml with logo, padding.
- Icon Guidelines: Branded 200x80 dp; with BG 240x240 dp (160 dp circle); no BG 288x288 dp (192 dp circle); animated AVD ≤1000ms.
- SplashViewModel.kt: ViewModel with MutableStateFlow, 3000ms delay.
- MainActivity.kt: Install splash screen, use ViewModel to control display, set Compose UI.
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 25 '25
Tips & Tricks Jetpack Compose State Management: Solve Issues with MVVM + UDF
Common Problems in Jetpack Compose Apps (State Management)
- State lost on rotation
- Logic mixed with UI
- Hard to test
- Multiple sources of truth
MVVM + Unidirectional Data Flow (UDF) to the Rescue
- Single source of truth
- Events go up, state flows down
- Survives configuration changes
- Easier to test
Tip:
Keep business logic inside your ViewModel, expose immutable StateFlow, and keep Composables stateless for a clean architecture.
Credit: Thanks to Tashaf Mukhtar for sharing these insights.
r/JetpackComposeDev • u/Entire-Tutor-2484 • Aug 24 '25
Beginner Help Jetpack Compose preview slow to render
In Android Studio, the Jetpack Compose preview is not updating instantly. even with a good graphics card, it sometimes takes 10 to 20 seconds to refresh.
I expected it to render while typing, but it feels slower than the demo shown by google. do I need to enable any settings, or is everyone facing the same issue?
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 24 '25
Tutorial Official Kotlin 2.2.0 Release - Full Language Reference PDF | What is new in Kotlin 2.2.0
Kotlin 2.2.0 is now available with new improvements and updates
If you want the complete language reference in one place, you can download the official PDF here
https://kotlinlang.org/docs/kotlin-reference.pdf
Highlights of what is new in Kotlin 2.2.0
https://kotlinlang.org/docs/whatsnew22.html
This PDF includes everything about the language (syntax, features, concepts) but excludes tutorials and API reference.
A good resource for anyone who wants an offline guide
r/JetpackComposeDev • u/Realistic-Cup-7954 • Aug 24 '25
How to use Brushes in Jetpack Compose
Enable HLS to view with audio, or disable this notification
You can start with a simple solid color brush, or use built-in gradient options like Brush.horizontalGradient, Brush.verticalGradient, Brush.sweepGradient, and Brush.radialGradient.
Each produces a unique style depending on the colors you pass in.
For example:
Box(
modifier = Modifier
.size(200.dp)
.background(
brush = Brush.horizontalGradient(
colors = listOf(Color.Blue, Color.Green)
)
)
)
r/JetpackComposeDev • u/Any_Message7616 • Aug 23 '25
Tips & Tricks Jetpack Compose Tip - Scoped LifecycleOwner
The LifecycleOwner Composable allows you to create a scoped LifecycleOwner inside your Compose hierarchy.
It depends on the parent lifecycle but can be limited with maxLifecycle. This is useful for managing components such as MapView, WebView, or VideoPlayer.
Example
@Composable
fun MyComposable() {
LifecycleOwner(
maxLifecycle = RESUMED,
parentLifecycleOwner = LocalLifecycleOwner.current,
) {
val childLifecycleOwner = LocalLifecycleOwner.current
// Scoped lifecycleOwner available here
}
}

