Open SedSim opened 10 months ago
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-material-theming?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-3-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-material-theming#6
In which task and step of the codelab can this issue be found?
"6. For the title parameter, pass in a Row which will hold the Image and Text of the CenterAlignedTopAppBar."
Describe the problem
Code is not compiling and shows error because "CenterAlignedTopAppBar" is experimental and will be removed in future.
Steps to reproduce?
Versions
Android Studio version: Android Studio Flamingo | 2022.2.1 Patch 2 API version of the emulator: API34
Additional information
The solution to the problem is to add "@OptIn(ExperimentalMaterial3Api::class)" before the WoofTopAppBar Composable.
means: ... @OptIn(ExperimentalMaterial3Api::class) @Composable fun WoofTopAppBar(modifier: Modifier = Modifier) { CenterAlignedTopAppBar( ...
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-compose-material-theming?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-3-pathway-3%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-material-theming#6
In which task and step of the codelab can this issue be found?
"6. For the title parameter, pass in a Row which will hold the Image and Text of the CenterAlignedTopAppBar."
Describe the problem
Code is not compiling and shows error because "CenterAlignedTopAppBar" is experimental and will be removed in future.
Steps to reproduce?
Versions
Android Studio version: Android Studio Flamingo | 2022.2.1 Patch 2 API version of the emulator: API34
Additional information
The solution to the problem is to add "@OptIn(ExperimentalMaterial3Api::class)" before the WoofTopAppBar Composable.
means: ... @OptIn(ExperimentalMaterial3Api::class) @Composable fun WoofTopAppBar(modifier: Modifier = Modifier) { CenterAlignedTopAppBar( ...