EDIT: Hi everyone! I turn on the compiler flag for...
# compose
d
EDIT: Hi everyone! I turn on the compiler flag for the compose metrics and I dont understand the following case- Why the VisibilityTrackerListener is unstable? is just an interface defines under module who run and compiled compose
Copy code
restartable scheme("[androidx.compose.ui.UiComposable]") fun ShoppingCarouselCardItem(
  stable card: ShoppingCarouselViewItem
  stable index: Int
  onClickListener: OnClickEvent? = @static null
  unstable carouselVisibilityTrackerListener: VisibilityTrackerListener<BaseEntry>? = @static null
  unstable onCarouselHidden: MutableLiveData<OnCarouselHidden>
e
https://medium.com/androiddevelopers/jetpack-compose-stability-explained-79c10db270c8
Classes from modules where the Compose compiler is not run are always determined to be unstable.
Guava isn't built with the Compose plugin (and isn't written in Kotlin), so it won't be recognized as immutable by Compose
l
See if this answers your question https://issuetracker.google.com/issues/199496149 and you can always annotate your view model item with @immutable
d
Thanks @liminal and @ephemient . Why the VisibilityTrackerListener is unstable? is just an interface defines under module who run compose
Copy code
restartable scheme("[androidx.compose.ui.UiComposable]") fun ShoppingCarouselCardItem(
  stable card: ShoppingCarouselViewItem
  stable index: Int
  onClickListener: OnClickEvent? = @static null
  unstable carouselVisibilityTrackerListener: VisibilityTrackerListener<BaseEntry>? = @static null
  unstable onCarouselHidden: MutableLiveData<OnCarouselHidden>
e
it needs to be annotated and compiled with compose compiler plugin
d
it is
e
(or inferred instead of annotated)
hmm, maybe it doesn't play with generics, not sure.
d
ya I think so too…
s
I believe interfaces are not considered stable by default, but you can always annotate it as such