RSSAmplifier

Blog

Saurabh Arora

A collection of my thoughts and tech learnings.

saurabharora.devRSS feed ↗5 posts

Latest posts

Beyond the Screen: Component-Level ViewModels in Compose

Until Lifecycle 2.11, ViewModelStore scoping was tied to navigation destinations, activities, or fragments. There was no clean way to scope a ViewModel to an arbitrary part of your UI. The Lifecycle 2.11 alphas close that gap with two new APIs that let you scope ViewModels to UI sections smaller than a screen: rememberViewModelStoreOwner() scopes a ViewModel to the call site of a composable...

Syncing Your AI Guidelines Across Workflows

The other day, I found myself in a bit of a loop. I was explaining my preference for avoiding mock tests to Android Studio Agent Mode, then repeating the same thing to the Gemini CLI, and finally watching a GitHub bot suggest a mock-heavy test that I’d specifically ruled out in my local config. As Android developers, we’re increasingly leaning on AI agents (whether it’s the integrated Android ...

Curious case of missing Bottom Sheet Previews

While working on a Jetpack Compose project, I noticed my modal bottom sheet wasn’t appearing in Android Studio previews. I could preview the sheet’s contents by extracting them into a separate composable, but the full bottom sheet, including its scrim and drag handle, was invisible. This was an issue because I needed to verify the entire UI for design and screenshot tests. Why Full Previews Ma...

Navigating Pitfalls - When to Use derivedStateOf with remember(key) in Jetpack Compose

Jetpack Compose has transformed Android UI development by providing a straightforward approach to building user interfaces. One of its core principles is minimising unnecessary updates, and one of the tools it offers is derivedStateOf. In this blog post, we will explore the effective utilisation of derivedStateOf through an example of hashtag validation, as well as highlighting some potential p...

Building a Speedometer with Compose Canvas API

The other day, while sitting in the back of a taxi, I noticed the speedometer and had the idea to build one using Jetpack Compose (because, why not? 😛). In this post, I will explain the process of building the speedometer and discuss the challenges I faced. This post assumes a basic knowledge of the Canvas API in Jetpack Compose. The speedometer we are building will look like the one above. T...