Mu'men Muhammad
Mu'men Muhammad

Reputation: 111

is there hot reload in Jetpack like flutter?

any idea to make android studio Jetpack compose auto refresh like Hot reload in Flutter it's annoying! Is there Auto-refresh in Jetpack Compose viewer?

Upvotes: 11

Views: 8862

Answers (5)

Ahmad Arif Faizin
Ahmad Arif Faizin

Reputation: 253

Now, you can use Compose Hot Reload that created by Jetbrains, but it still experimental https://github.com/JetBrains/compose-hot-reload

Upvotes: 1

Andy Dent
Andy Dent

Reputation: 17971

As of October 2024, as I'm working on a Compose MultiPlatform project, focused on iOS and Android:

  1. LiveEdit kinda works but is very flakey in that it almost always requires a refresh that restarts the app. It's faster than a rebuild/redeploy but not a viable Hot Reload replacement.
  2. Compose Preview for Desktop or Android targets works within the Fleet IDE and can be very fast to refresh, if you're doing basic layout stuff. It can fail in interesting ways if things are not available. The Android preview can't find resources if you're using cross-platform Res.drawable... and fails, telling you out of date but no number of rebuilds will fix it. As of version 1.7.0 of the Compose plugin it's fixed, Android being able to use Res paths. See detailed explanation

Upvotes: 1

MrArtyD
MrArtyD

Reputation: 300

Just wanted to expand on @jim-ovejera answer and let people know, that Live Edit, that acts as Hot Reload, is now stable and has it's own guide in documentation

Upvotes: 4

Jim Ovejera
Jim Ovejera

Reputation: 876

When Android Studio Electric Eel becomes stable, Live Edit is enabled by default that acts as Hot Reload. Right now its still on preview.

Upvotes: 3

Right now, compose does not support Hot reloads. But Literals values can be updated directly.

Some supported types.

Int

String

Color

Dp

Boolean

enter image description here

You can view constant literals that trigger real-time updates without the compilation step by enabling these highlighted values.

enter image description here

Reference

Upvotes: 6

Related Questions