-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add boolean Flag to decide if image should be original size or not (#…
- Loading branch information
Showing
12 changed files
with
123 additions
and
6 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
26 changes: 26 additions & 0 deletions
26
paparazzi-gradle-plugin/src/test/projects/device-resolution/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,26 @@ | ||
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() | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation libs.androidx.appcompat | ||
|
||
testImplementation libs.testParameterInjector | ||
} |
Binary file added
BIN
+15 KB
...dle-plugin/src/test/projects/device-resolution/src/main/res/drawable/camera.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
paparazzi-gradle-plugin/src/test/projects/device-resolution/src/main/res/layout/launch.xml
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,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:gravity="center" | ||
android:background="@color/launchBackground" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
> | ||
|
||
<ImageView | ||
android:layout_width="200dp" | ||
android:layout_height="200dp" | ||
android:src="@drawable/camera" | ||
/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:textColor="@color/cameraBody" | ||
android:text="paparazzi" | ||
android:textSize="70dp" | ||
android:textFontWeight="100" | ||
/> | ||
|
||
</LinearLayout> |
5 changes: 5 additions & 0 deletions
5
paparazzi-gradle-plugin/src/test/projects/device-resolution/src/main/res/values/colors.xml
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="launchBackground">#dcdccc</color> | ||
<color name="cameraBody">#332F21</color> | ||
</resources> |
5 changes: 5 additions & 0 deletions
5
paparazzi-gradle-plugin/src/test/projects/device-resolution/src/main/res/values/strings.xml
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="color">Color</string> | ||
<string name="sample_image">sample_image</string> | ||
</resources> |
26 changes: 26 additions & 0 deletions
26
...ts/device-resolution/src/test/java/app/cash/paparazzi/plugin/test/DeviceResolutionTest.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,26 @@ | ||
package app.cash.paparazzi.plugin.test | ||
|
||
import app.cash.paparazzi.DeviceConfig | ||
import app.cash.paparazzi.Paparazzi | ||
import com.google.testing.junit.testparameterinjector.TestParameter | ||
import com.google.testing.junit.testparameterinjector.TestParameterInjector | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(TestParameterInjector::class) | ||
class DeviceResolutionTest( | ||
@TestParameter useDeviceResolutionFlag: Boolean | ||
) { | ||
|
||
@get:Rule | ||
val paparazzi = Paparazzi( | ||
deviceConfig = DeviceConfig.NEXUS_5, | ||
useDeviceResolution = useDeviceResolutionFlag | ||
) | ||
|
||
@Test | ||
fun deviceResolution() { | ||
paparazzi.snapshot(paparazzi.inflate(R.layout.launch)) | ||
} | ||
} |
Binary file added
BIN
+18.5 KB
...n/src/test/projects/device-resolution/src/test/resources/default_resolution.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.4 KB
...ugin/src/test/projects/device-resolution/src/test/resources/full_resolution.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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