Skip to content

Commit

Permalink
Fixes issue causing placeholders to sometimes take up full screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
rharter authored and saket committed Apr 24, 2024
1 parent da5325b commit f999d00
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class CoilImageSourceTest {
@get:Rule val serverRule = MockWebServerRule()
@get:Rule val testName = TestName()
@get:Rule val dropshots = Dropshots(
recordScreenshots = true,
filenameFunc = { it },
resultValidator = CiScreenshotValidator(
context = { rule.activity },
Expand Down Expand Up @@ -443,14 +442,15 @@ class CoilImageSourceTest {
}

rule.waitUntil(5.seconds) { placeholderLoaded }
rule.waitForIdle()
rule.runOnIdle {
dropshots.assertSnapshot(rule.activity, name = "placeholder_placeholder")
dropshots.assertSnapshot(rule.activity, name = "${testName.methodName}_placeholder")
}
displayImage = true
rule.waitForIdle()
rule.waitUntil(5.seconds) { state.isImageDisplayed }
rule.runOnIdle {
dropshots.assertSnapshot(rule.activity, name = "placeholder_image")
dropshots.assertSnapshot(rule.activity, name = "${testName.methodName}_full_image")
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import androidx.compose.ui.graphics.painter.Painter
@Stable
@Composable
internal fun Painter.scaledToMatch(size: Size): Painter {
return remember(this, size) {
return remember(this, intrinsicSize, size) {
FixedSizePainter(
painter = this,
overriddenSize = if (size.isSpecified && !size.isEmpty() && intrinsicSize.isSpecified) {
Expand Down

0 comments on commit f999d00

Please sign in to comment.