Fix inventory recomposition

This commit is contained in:
Andres Gomez, Thomas (ITDV RL) 2025-02-12 13:16:01 +01:00
parent c11dc62a18
commit 8f45fe7a77
2 changed files with 1 additions and 7 deletions

View file

@ -170,7 +170,6 @@ fun InventoryPage(
} }
} }
@OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
private fun InventoryContent( private fun InventoryContent(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
@ -248,7 +247,6 @@ private fun InventoryContent(
when (item) { when (item) {
is String -> CategoryHeader( is String -> CategoryHeader(
modifier = Modifier modifier = Modifier
.animateItem()
.fillMaxWidth() .fillMaxWidth()
.padding( .padding(
start = 16.dp, start = 16.dp,

View file

@ -1,15 +1,12 @@
package com.pixelized.rplexicon.ui.screens.character.pages.inventory.composable.draggable package com.pixelized.rplexicon.ui.screens.character.pages.inventory.composable.draggable
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.lazy.grid.LazyGridItemScope
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.graphics.graphicsLayer
@OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
fun LazyGridItemScope.DraggableInventoryElement( fun DraggableInventoryElement(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
dragDropState: InventoryDragDropState, dragDropState: InventoryDragDropState,
index: Int, index: Int,
@ -18,7 +15,6 @@ fun LazyGridItemScope.DraggableInventoryElement(
) { ) {
Box( Box(
modifier = Modifier modifier = Modifier
.animateItem()
.graphicsLayer { .graphicsLayer {
dragDropState.draggedItemElement?.let { element -> dragDropState.draggedItemElement?.let { element ->
this.alpha = when { this.alpha = when {