Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

82
Visualizações
Recomposition in jetpack compose vs recycle in old ui?

LazyColumn and LazyRow are replacing for RecyclerView in the old UI but when scrolling the item in RecyclerView and back to it disappear then recycle to optimization UI.

LazyColumn and LazyRow are doing the same thing?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I found it from Jetpack Compose basics Codelab

Note: LazyColumn doesn't recycle its children like RecyclerView. It emits new Composables as you scroll through it and is still performant, as emitting Composables is relatively cheap compared to instantiating Android Views

After testing, I see that LazyColumn just compose visible items. And, by scrolling the invisible items will recompose when it visible again.

over 4 years ago · Santiago Trujillo Relatório

0

LazyColumn uses LazyList which uses LazyLayout and it uses aSubComposeLayout to recompose children Composable when required unlike having a Column with Modifier.verticalScroll() which composes all of its children Composables.

Subcomposable has a subocompose function that can be called multiple times in the layout block. This is, for example, what happens in LazyRow. The slotId allows SubcomposeLayout to track and manage the compositions created by calling subcompose. For example, if you are generating the content from an array you might want use the index of the array as its slotId allowing SubcomposeLayout to determine which subcompose generated last time should be used to during recomposition. Also, if a slotid is not used any more, SubcomposeLayout will dispose its corresponding composition.

You can read full answer about SubcomposeLayout by Google developer here.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda