kopia lustrzana https://github.com/vitorpamplona/amethyst
Seeing if the performance improves when the factory becomes just another lambda
rodzic
d83acab84b
commit
f5a1007f88
|
@ -669,9 +669,20 @@ private fun RenderVideoPlayer(
|
|||
}
|
||||
}
|
||||
|
||||
val factory =
|
||||
remember(controller) {
|
||||
{ context: Context ->
|
||||
val ratio = remember { aspectRatio(dimensions) }
|
||||
|
||||
if (ratio != null) {
|
||||
DisplayBlurHash(
|
||||
blurhash,
|
||||
null,
|
||||
ContentScale.Crop,
|
||||
myModifier.aspectRatio(ratio),
|
||||
)
|
||||
}
|
||||
|
||||
AndroidView(
|
||||
modifier = myModifier,
|
||||
factory = { context: Context ->
|
||||
PlayerView(context).apply {
|
||||
player = controller
|
||||
layoutParams =
|
||||
|
@ -703,23 +714,7 @@ private fun RenderVideoPlayer(
|
|||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val ratio = remember { aspectRatio(dimensions) }
|
||||
|
||||
if (ratio != null) {
|
||||
DisplayBlurHash(
|
||||
blurhash,
|
||||
null,
|
||||
ContentScale.Crop,
|
||||
myModifier.aspectRatio(ratio),
|
||||
)
|
||||
}
|
||||
|
||||
AndroidView(
|
||||
modifier = myModifier,
|
||||
factory = factory,
|
||||
},
|
||||
)
|
||||
|
||||
waveform?.let { Waveform(it, controller, remember { Modifier.align(Alignment.Center) }) }
|
||||
|
|
|
@ -36,7 +36,6 @@ import androidx.compose.foundation.lazy.itemsIndexed
|
|||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
|
@ -290,7 +289,6 @@ private fun SearchBar(
|
|||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
private fun SearchTextField(
|
||||
searchBarViewModel: SearchBarViewModel,
|
||||
|
|
Ładowanie…
Reference in New Issue