View stability_sample_code.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
// 1 | |
data class State( | |
val value: Int, | |
val prompt: String, | |
val values: Set<Int>, | |
val prompts: List<String>, | |
) | |
// 2 | |
@Composable |
View stability_stable_composables.txt
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
restartable skippable scheme("[androidx.compose.ui.UiComposable]") fun SampleUi( | |
stable state: State | |
) | |
restartable skippable scheme("[androidx.compose.ui.UiComposable]") fun PrimitivesMethod( | |
stable value: Int | |
stable prompt: String | |
stable modifier: Modifier? = @static Companion | |
) | |
restartable skippable scheme("[androidx.compose.ui.UiComposable]") fun CollectionsMethod( | |
stable values: Set<Int> |
View stability_stable_classes.txt
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
stable class State { | |
stable val value: Int | |
stable val prompt: String | |
stable val values: Set<Int> | |
stable val prompts: List<String> | |
<runtime stability> = | |
} |
View stability_adding_stability_argument.kts
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
kotlinOptions { | |
val composeReportsDir = "compose_reports" | |
// 1 | |
freeCompilerArgs += listOf( | |
"-P", | |
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=$rootDir/stability-config.txt" | |
) | |
freeCompilerArgs += listOf( | |
"-P", |
View stability_unstable_composables.txt
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
restartable scheme("[androidx.compose.ui.UiComposable]") fun SampleUi( | |
unstable state: State | |
) | |
restartable skippable scheme("[androidx.compose.ui.UiComposable]") fun PrimitivesMethod( | |
stable value: Int | |
stable prompt: String | |
stable modifier: Modifier? = @static Companion | |
) | |
restartable scheme("[androidx.compose.ui.UiComposable]") fun CollectionsMethod( | |
unstable values: Set<Int> |
View stability_unstable_classes.txt
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
unstable class State { | |
stable val value: Int | |
stable val prompt: String | |
unstable val values: Set<Int> | |
unstable val prompts: List<String> | |
<runtime stability> = Unstable | |
} |
View stability_reports_compiler_flag.kts
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
kotlinOptions { | |
// 1 | |
val composeReportsDir = "compose_reports" | |
// 2 | |
freeCompilerArgs += listOf( | |
// 3 | |
"-P", | |
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + | |
project.layout.buildDirectory.get().dir(composeReportsDir).asFile.absolutePath, |
View animiated_drawer_final.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
@Stable | |
interface AnimatedDrawerState { | |
var density: Float | |
val drawerWidth: Dp | |
val drawerTranslationX: Float | |
val drawerElevation: Float | |
val backgroundTranslationX: Float | |
val backgroundAlpha: Float |
View draggable_content_final.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
class MainActivity : ComponentActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
PlaygroundTheme { | |
Surface( | |
modifier = Modifier.fillMaxSize(), | |
color = MaterialTheme.colorScheme.background, | |
) { | |
Box { |
NewerOlder