-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compose view in test to simulate compose stack trace.
- Loading branch information
1 parent
43ee3fa
commit 97af19d
Showing
5 changed files
with
51 additions
and
2 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
...ulti-module/fonts-view-module/src/main/java/app/cash/paparazzi/plugin/test/ComposeView.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,37 @@ | ||
package app.cash.paparazzi.plugin.test | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.platform.AbstractComposeView | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.text.font.Font | ||
import androidx.compose.ui.text.font.FontFamily | ||
import androidx.compose.ui.unit.dp | ||
import app.cash.paparazzi.plugin.font.R | ||
|
||
class ComposeView(context: Context, attrs: AttributeSet) : AbstractComposeView(context, attrs) { | ||
|
||
@Composable | ||
override fun Content() { | ||
val font = FontFamily(Font(R.font.cashmarket_medium)) | ||
|
||
Column { | ||
Text( | ||
text = "Compose: text with custom font", | ||
fontFamily = font | ||
) | ||
|
||
Image( | ||
modifier = Modifier.size(32.dp), | ||
painter = painterResource(R.drawable.arrow_up), | ||
contentDescription = "arrow up" | ||
) | ||
} | ||
} | ||
} |
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
Binary file modified
BIN
+3.52 KB
(110%)
...om-fonts-multi-module/fonts-view-module/src/test/resources/app_compat_views.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.