Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the Toolbar shadow (elevation) #328

Open
ivannarino opened this issue Dec 30, 2022 · 1 comment
Open

Removing the Toolbar shadow (elevation) #328

ivannarino opened this issue Dec 30, 2022 · 1 comment

Comments

@ivannarino
Copy link

ivannarino commented Dec 30, 2022

Expected behaviour

When doing screenshots of composables, the screenshot should not have display the shadow of the Toolbar

Actual behaviour

When doing screenshots of composables there is gradient (shadow) at the top of the image.
image

Steps to reproduce

  • Create an compose snapshot test
@get:org.junit.Rule
val composeRule = androidx.compose.ui.test.junit4.createComposeRule()

@org.junit.Test
fun testContent() {
    composeRule.setContent { $PREVIEW_NAME$() }
    compareScreenshot(composeRule)
}
  • Record the screenshots

  • Open the screenshots

Version of the library

5.14.1

Using emulator with Android 32

@ivannarino
Copy link
Author

ivannarino commented Dec 30, 2022

The workaround I found is to remove the Toolbar setting a theme to the test application via the src/androidTest/AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <application android:theme="@android:style/Theme.Material.Light.NoActionBar" />
</manifest>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant