Leave a rating/review
You have the TaskDetailScreenContent ready. In this episode, you’ll create the TaskDetailScreen composable that will be used to display the TaskDetailScreenContent composable.
Still insde the TaskDetailScreen.kt file, create a new composable named TaskDetailScreen.
@Composable
fun TaskDetailScreen() {
}
Inside the TaskDetailScreen composable, add the following code:
Scaffold(
topBar = {
ListMakerTopAppBar(
title = "",
showBackButton = true,
onBackPressed = {}
)
},
content = {
TaskDetailsScreenContent(modifier = Modifier.padding(it), emptyList())
},
floatingActionButton = {
ListMakerFloatingActionButton(
title = stringResource(id = R.string.task_to_add),
inputHint = stringResource(id = R.string.task_hint),
onFabClick = { todoName ->
}
)
}
)
Using same process as before, create the string resource named task_to_add with the value What is the task you want to add? Here’s a breakdown of what you’ve done:
-
You’re using the
Scaffoldcomposable to display theListMakerTopAppBarandListMakerFloatingActionButtoncomposable. This is similar to what you did in theTaskListScreencomposable. Notice that for theListMakerTopAppBarcomposable, you’re passing an empty lambda to theonBackPressedparameter. You’ll implement the functionality later on in the course. -
You’re displaying the
TaskDetailsScreenContentcomposable. You’re passing an empty list to thetaskTodosparameter. You’ll implement the functionality later on in the course. -
You’re using the
ListMakerFloatingActionButtoncomposable to display the floating action button. You’re passing an empty lambda to theonFabClickparameter. You’ll implement the functionality later on in the course.