Reduce recomposition of MangaHeader (#9985)
* Reduce recomposition of MangaHeader * Reuse `Modifier` for `Tags` Reference: https://developer.android.com/jetpack/compose/modifiers#reusing-modifiers * Don't recalculate Read State on recomposition * Fix Linting issue * Optimize chapter state calculations
This commit is contained in:
@@ -286,7 +286,7 @@ fun ExpandableMangaDescription(
|
||||
) {
|
||||
tags.forEach {
|
||||
TagsChip(
|
||||
modifier = Modifier.padding(vertical = 4.dp),
|
||||
modifier = DefaultTagChipModifier,
|
||||
text = it,
|
||||
onClick = {
|
||||
tagSelected = it
|
||||
@@ -302,7 +302,7 @@ fun ExpandableMangaDescription(
|
||||
) {
|
||||
items(items = tags) {
|
||||
TagsChip(
|
||||
modifier = Modifier.padding(vertical = 4.dp),
|
||||
modifier = DefaultTagChipModifier,
|
||||
text = it,
|
||||
onClick = {
|
||||
tagSelected = it
|
||||
@@ -654,6 +654,8 @@ private fun MangaSummary(
|
||||
}
|
||||
}
|
||||
|
||||
private val DefaultTagChipModifier = Modifier.padding(vertical = 4.dp)
|
||||
|
||||
@Composable
|
||||
private fun TagsChip(
|
||||
text: String,
|
||||
|
||||
Reference in New Issue
Block a user