-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for render mode SHRINK for AccessibilityRenderExtension
- Loading branch information
1 parent
85696ae
commit 118bcf2
Showing
8 changed files
with
92 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
paparazzi-gradle-plugin/src/test/projects/verify-accessibility-render-extension/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'kotlin-android' | ||
id 'app.cash.paparazzi' | ||
} | ||
|
||
android { | ||
namespace 'app.cash.paparazzi.plugin.test' | ||
compileSdk libs.versions.compileSdk.get() as int | ||
defaultConfig { | ||
minSdk libs.versions.minSdk.get() as int | ||
} | ||
compileOptions { | ||
sourceCompatibility = libs.versions.javaTarget.get() | ||
targetCompatibility = libs.versions.javaTarget.get() | ||
} | ||
kotlinOptions { | ||
jvmTarget = libs.versions.javaTarget.get() | ||
} | ||
buildFeatures { | ||
compose true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion libs.versions.composeCompiler.get() | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation libs.androidx.appcompat | ||
} | ||
|
||
apply from: '../guava-fix.gradle' |
29 changes: 29 additions & 0 deletions
29
...on/src/test/java/app/cash/paparazzi/plugin/test/AccessibilityRenderExtensionShrinkTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package app.cash.paparazzi.plugin.test | ||
|
||
import android.widget.TextView | ||
import app.cash.paparazzi.DeviceConfig | ||
import app.cash.paparazzi.Paparazzi | ||
import app.cash.paparazzi.accessibility.AccessibilityRenderExtension | ||
import com.android.ide.common.rendering.api.SessionParams | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class AccessibilityRenderExtensionShrinkTest { | ||
|
||
@get:Rule | ||
val paparazzi = Paparazzi( | ||
deviceConfig = DeviceConfig.NEXUS_5, | ||
renderExtensions = setOf(AccessibilityRenderExtension()), | ||
renderingMode = SessionParams.RenderingMode.SHRINK | ||
) | ||
|
||
@Test | ||
fun `verify baseline`() { | ||
val view = TextView(paparazzi.context).apply { | ||
id = 1 | ||
text = "Text View Sample" | ||
setPadding(50, 50, 50, 50) | ||
} | ||
paparazzi.snapshot(view, name = "accessibility-shrink") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
Binary file added
BIN
+9.68 KB
...rify-accessibility-render-extension/src/test/resources/accessibility-shrink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters