Skip to content

Commit

Permalink
Use activityTheme() instead of theme()
Browse files Browse the repository at this point in the history
  • Loading branch information
takahirom committed Dec 22, 2024
1 parent a0eaa5b commit c9604d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ data class RoborazziComposeInspectionModeOption(private val inspectionMode: Bool
}

@ExperimentalRoborazziApi
fun RoborazziComposeOptions.Builder.theme(themeResId: Int): RoborazziComposeOptions.Builder {
fun RoborazziComposeOptions.Builder.activityTheme(themeResId: Int): RoborazziComposeOptions.Builder {
return addOption(RoborazziComposeActivityThemeOption(themeResId))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import com.github.takahirom.roborazzi.RobolectricDeviceQualifiers
import com.github.takahirom.roborazzi.RoborazziComposeActivityScenarioOption
import com.github.takahirom.roborazzi.RoborazziComposeComposableOption
import com.github.takahirom.roborazzi.RoborazziComposeOptions
import com.github.takahirom.roborazzi.activityTheme
import com.github.takahirom.roborazzi.captureRoboImage
import com.github.takahirom.roborazzi.fontScale
import com.github.takahirom.roborazzi.roborazziSystemPropertyOutputDirectory
import com.github.takahirom.roborazzi.theme
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.annotation.Config
Expand All @@ -45,7 +45,7 @@ class ComposeLambdaTest {
fun whenNonTransparentThemeItShouldHaveNonTransparentBackground() {
captureRoboImage(
roborazziComposeOptions = RoborazziComposeOptions {
theme(android.R.style.Theme_Material_Light)
activityTheme(android.R.style.Theme_Material_Light)
}
) {
Text("This composable function should NOT have transparent background!")
Expand Down

0 comments on commit c9604d8

Please sign in to comment.