Skip to content

Commit

Permalink
Fix alpha property changes not invalidating (#490)
Browse files Browse the repository at this point in the history
I forgot to include alpha changes in the invalidation trigger list 🤦 

Fixes #489
  • Loading branch information
chrisbanes authored Jan 25, 2025
1 parent 6cc34d2 commit 122222d
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ internal object DirtyFields {
Size or
BackgroundColor or
Progressive or // TODO: only on Android SDK 32-33
Areas
Areas or
Alpha

fun stringify(dirtyTracker: Bitmask): String {
val params = buildList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package dev.chrisbanes.haze
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.graphics.Brush
Expand Down Expand Up @@ -116,12 +117,23 @@ class HazeScreenshotTest : ScreenshotTest() {

@Test
fun creditCard_alpha() = runScreenshotTest {
var alpha by mutableFloatStateOf(0.5f)

setContent {
ScreenshotTheme {
CreditCardSample(tint = DefaultTint, alpha = 0.5f)
CreditCardSample(tint = DefaultTint, alpha = alpha)
}
}

captureRoot()

alpha = 0.2f
waitForIdle()
captureRoot("20")

alpha = 0.7f
waitForIdle()
captureRoot("70")
}

@Test
Expand Down

0 comments on commit 122222d

Please sign in to comment.