-
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.
- Loading branch information
1 parent
6a3e921
commit 46ac4e2
Showing
10 changed files
with
244 additions
and
42 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
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
37 changes: 37 additions & 0 deletions
37
paparazzi-gradle-plugin/src/test/projects/preview-annotation-dsl-disable/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,37 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'kotlin-android' | ||
id 'app.cash.paparazzi' | ||
} | ||
|
||
paparazzi { | ||
generatePreviewTestClass = false | ||
} | ||
|
||
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.composeUi.material | ||
implementation libs.composeUi.uiTooling | ||
} | ||
|
||
apply from: '../guava-fix.gradle' |
10 changes: 10 additions & 0 deletions
10
...iew-annotation-dsl-disable/src/main/java/app/cash/paparazzi/plugin/test/HelloPaparazzi.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,10 @@ | ||
package app.cash.paparazzi.plugin.test | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import app.cash.paparazzi.annotations.Paparazzi | ||
|
||
@Paparazzi | ||
@Preview | ||
@Composable | ||
fun HelloPaparazzi() = Unit |
38 changes: 1 addition & 37 deletions
38
...nnotation-empty-test-suite/src/main/java/app/cash/paparazzi/plugin/test/HelloPaparazzi.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 |
---|---|---|
@@ -1,52 +1,16 @@ | ||
package app.cash.paparazzi.plugin.test | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.wrapContentSize | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.text.font.FontFamily | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.style.TextDecoration | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import app.cash.paparazzi.annotations.Paparazzi | ||
|
||
@Paparazzi | ||
@Preview | ||
@Composable | ||
fun HelloPaparazzi() { | ||
val text = "Hello, Paparazzi" | ||
Column( | ||
Modifier | ||
.background(Color.White) | ||
.fillMaxSize() | ||
.wrapContentSize() | ||
) { | ||
Text(text) | ||
Text(text, style = TextStyle(fontFamily = FontFamily.Cursive)) | ||
Text( | ||
text = text, | ||
style = TextStyle(textDecoration = TextDecoration.LineThrough) | ||
) | ||
Text( | ||
text = text, | ||
style = TextStyle(textDecoration = TextDecoration.Underline) | ||
) | ||
Text( | ||
text = text, | ||
style = TextStyle( | ||
textDecoration = TextDecoration.combine( | ||
listOf( | ||
TextDecoration.Underline, | ||
TextDecoration.LineThrough | ||
) | ||
), | ||
fontWeight = FontWeight.Bold | ||
) | ||
) | ||
} | ||
Text("Hello, Paparazzi", style = TextStyle(fontFamily = FontFamily.Cursive), color = Color.White) | ||
} |
Binary file added
BIN
+4.41 KB
...ects/preview-annotation-empty-test-suite/src/test/resources/hello_paparazzi.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions
37
paparazzi-gradle-plugin/src/test/projects/preview-annotation-preview-parameters/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,37 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'kotlin-android' | ||
id 'app.cash.paparazzi' | ||
} | ||
|
||
paparazzi { | ||
generatePreviewTestClass = true | ||
} | ||
|
||
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.composeUi.material | ||
implementation libs.composeUi.uiTooling | ||
} | ||
|
||
apply from: '../guava-fix.gradle' |
22 changes: 22 additions & 0 deletions
22
...otation-preview-parameters/src/main/java/app/cash/paparazzi/plugin/test/HelloPaparazzi.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,22 @@ | ||
package app.cash.paparazzi.plugin.test | ||
|
||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.tooling.preview.PreviewParameter | ||
import androidx.compose.ui.tooling.preview.PreviewParameterProvider | ||
import app.cash.paparazzi.annotations.Paparazzi | ||
|
||
@Paparazzi | ||
@Preview | ||
@Composable | ||
fun HelloPaparazzi( | ||
@PreviewParameter(NameProvider::class) name: String, | ||
) { | ||
Text(text = name) | ||
} | ||
|
||
class NameProvider: PreviewParameterProvider<String> { | ||
override val values: Sequence<String> | ||
get() = sequenceOf("Papa", "Razzi") | ||
} |
37 changes: 37 additions & 0 deletions
37
paparazzi-gradle-plugin/src/test/projects/preview-annotation-private-preview/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,37 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'kotlin-android' | ||
id 'app.cash.paparazzi' | ||
} | ||
|
||
paparazzi { | ||
generatePreviewTestClass = true | ||
} | ||
|
||
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.composeUi.material | ||
implementation libs.composeUi.uiTooling | ||
} | ||
|
||
apply from: '../guava-fix.gradle' |
21 changes: 21 additions & 0 deletions
21
...annotation-private-preview/src/main/java/app/cash/paparazzi/plugin/test/HelloPaparazzi.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,21 @@ | ||
package app.cash.paparazzi.plugin.test | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.wrapContentSize | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.text.font.FontFamily | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.text.style.TextDecoration | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import app.cash.paparazzi.annotations.Paparazzi | ||
|
||
@Paparazzi | ||
@Preview | ||
@Composable | ||
private fun HelloPaparazzi() = Unit |