Protect your code from Gemini in Android Studio

The Studio Bot is great, but be sure you are not sharing proprietary code unintentionally

How to use an `.aiexclude` file to protect your code and keep your intellectual property safe.

May 1, 2024 · ProAndroidDev

Only Show the Tip of the Iceberg

Using LocalInspectionMode to hide code from your Jetpack Compose Previews

Sometimes you need or want to show different content or exclude code from your Jetpack Compose Previews. It is easy to use LocalInspectionMode.current to check if the composable is in a Preview.

April 29, 2024 · ProAndroidDev

Dot. Dash. Design

Mastering Lines in Jetpack Compose with PathEffect

How to style your lines, shapes and paths with dots, dashes and stamped shapes in Jetpack Compose Canvas using PathEffect.

March 19, 2024 · ProAndroidDev

Graceful Exits: Implementing Close Confirmation for Jetpack Compose ModalBottomSheet

Ensure users don’t lose their input accidentally — add a simple confirmation dialog.

When a user accidentally taps out of a ModalBottomSheet or closes it they may lose any input they have added or changes they have made, it is easy to add a close confirmation dialog before closing the sheet!

January 30, 2024 · ProAndroidDev

Camouflage the Status Bar with Edge-to-Edge Jetpack Compose Screens and Dialogs

From Foreground to Fading Background

Ditch the jarring contrast of dark system bars against your vibrant app visuals. Edge-to-edge drawing in Jetpack Compose lets you transform those bars into chameleons, adapting to your UI’s colors and textures. Watch as they melt into the background, creating a unified canvas that captivates users.

January 9, 2024 · ProAndroidDev

Seeing your composable in shades of grey

Creating a greyscale modifier in Jetpack Compose and how to make complex composables look disabled.

What to do when you really need to keep text from resizing and how to check how your composables look with different font scales using previews.

August 28, 2023 · ProAndroidDev

Jetpack Compose Tricks: Conditionally Applying Modifiers for Dynamic UIs

Streamline your UI code

Modifiers in Jetpack Compose can quickly get out of hand when conditions get complex. You can create a Modifier extension function to only apply the modifier if a condition is met.

August 14, 2023 · ProAndroidDev

Preventing Font Scaling in Jetpack Compose

What to do when you really need to keep text from resizing and how to check how your composables look with different font scales using previews.

July 14, 2023 · ProAndroidDev

Using PreviewParameters and providing Composables to Jetpack Compose Previews

How to generate Jetpack Compose Previews from @Composable annotated data.

May 11, 2023 · ProAndroidDev

Typing on a Tiny Screen

How to implement user input for Android Wear OS

How to request user input using Jetpack Compose on Android Wear OS and how to chain several input requests to provide a great user experience - even on a tiny watch screen!

March 19, 2023 · ProAndroidDev