Skip to content

Commit

Permalink
Fix recomposition of ThumbnailImage and remove extra background colour
Browse files Browse the repository at this point in the history
  • Loading branch information
theMr17 committed Jan 6, 2025
1 parent 0d0767a commit 45d6ff4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ fun ThumbnailImage(
setEntityId(entityId)
setEntityType(entityType)
}
},
update = { view ->
view.setLessonThumbnail(lessonThumbnail)
view.setEntityId(entityId)
view.setEntityType(entityType)
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,7 @@ fun ComingSoonTopicCard(
entityId = comingSoonTopicsViewModel.topicSummary.topicId,
entityType = comingSoonTopicsViewModel.entityType,
lessonThumbnail = comingSoonTopicsViewModel.topicSummary.lessonThumbnail,
modifier = Modifier
.aspectRatio(4f / 3f)
.background(
Color(
(
0xff000000L or
comingSoonTopicsViewModel
.topicSummary.lessonThumbnail.backgroundColorRgb.toLong()
).toInt()
)
)
modifier = Modifier.aspectRatio(4f / 3f)
)
ComingSoonTopicCardTextSection(comingSoonTopicsViewModel)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,7 @@ fun PromotedStoryCard(
entityId = promotedStoryViewModel.promotedStory.storyId,
entityType = promotedStoryViewModel.entityType,
lessonThumbnail = promotedStoryViewModel.promotedStory.lessonThumbnail,
modifier = Modifier
.aspectRatio(16f / 9f)
.background(
Color(
(
0xff000000L or
promotedStoryViewModel.promotedStory.lessonThumbnail.backgroundColorRgb.toLong()
).toInt()
)
)
modifier = Modifier.aspectRatio(16f / 9f)
)
Text(
text = promotedStoryViewModel.nextChapterTitle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,7 @@ fun TopicCard(topicSummaryViewModel: TopicSummaryViewModel) {
entityId = topicSummaryViewModel.topicSummary.topicId,
entityType = topicSummaryViewModel.entityType,
lessonThumbnail = topicSummaryViewModel.topicSummary.topicThumbnail,
modifier = Modifier
.aspectRatio(4f / 3f)
.background(
Color(
(
0xff000000L or
topicSummaryViewModel.topicSummary.topicThumbnail.backgroundColorRgb.toLong()
).toInt()
)
)
modifier = Modifier.aspectRatio(4f / 3f)
)
TopicCardTextSection(topicSummaryViewModel)
}
Expand Down

0 comments on commit 45d6ff4

Please sign in to comment.