Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| hotSwanCompiler { | |
| preview { | |
| outputDir.set(".hotswan/preview-captures") | |
| renderDelayMs.set(2500L) | |
| sdkModeEnabled.set(true) | |
| } | |
| } |
This file contains hidden or 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
| ./gradlew captureAllPreviews |
This file contains hidden or 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
| dependencies { | |
| debugImplementation("com.github.skydoves.compose.hotswan:preview:1.1.3") | |
| } |
This file contains hidden or 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
| data class User( | |
| val firstName: String, | |
| val lastName: String, | |
| val avatarUrl: String // Newly added property | |
| ) |
This file contains hidden or 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
| <!-- strings.xml --> | |
| <string name="welcome_message">Welcome back</string> | |
| <!-- Change to: "Hey there, welcome back" and save --> |
This file contains hidden or 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
| class ProfileViewModel : ViewModel() { | |
| // add a new function in your ViewModel | |
| fun formatDisplayName(user: User): String { | |
| // Change the formatting logic and save | |
| return "${user.firstName} ${user.lastName}" | |
| } | |
| } | |
| @Composable |
This file contains hidden or 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
| @Composable | |
| fun ProfileCard(user: User) { | |
| Column { | |
| UserAvatar(user) // New composable, defined below | |
| Text(text = user.name) | |
| } | |
| } | |
| @Composable | |
| fun UserAvatar(user: User) { |
This file contains hidden or 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
| @Composable | |
| fun ProfileCard(user: User) { | |
| Column( | |
| modifier = Modifier | |
| .padding(24.dp) // Change this to 16.dp and save | |
| .fillMaxWidth() | |
| ) { | |
| Text( | |
| text = user.name, | |
| fontSize = 20.sp, // Change this to 24.sp and save |
This file contains hidden or 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
| LandscapistImage( | |
| imageModel = { imageUrl }, | |
| component = rememberImageComponent { | |
| +ShimmerPlugin() | |
| +CircularRevealPlugin(duration = 350) | |
| +PalettePlugin( | |
| paletteLoadedListener = { palette -> | |
| dominantColor = palette.dominantSwatch?.rgb | |
| }, | |
| ) |
NewerOlder