Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

03 update starter and final with padding values #42

Open
wants to merge 2 commits into
base: editions/2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ fun ColumnScreen() {
}

@Composable
fun MyColumn() {
fun MyColumn(modifier: Modifier = Modifier) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.SpaceEvenly,
modifier = Modifier.fillMaxSize()
modifier = modifier.fillMaxSize()
) {

THREE_ELEMENT_LIST.forEach { textResId ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ fun RowScreen() {
}

@Composable
fun MyRow() {
Row(verticalAlignment = Alignment.CenterVertically,
fun MyRow(modifier: Modifier = Modifier) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceEvenly,
modifier = Modifier.fillMaxSize()) {
modifier = modifier.fillMaxSize()
) {

THREE_ELEMENT_LIST.forEach { textResId ->
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@

package com.yourcompany.android.jetpackcompose.screens

import androidx.compose.foundation.layout.padding
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Menu
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -66,7 +68,12 @@ fun MyScaffold() {
Scaffold(
scaffoldState = scaffoldState,
contentColor = colorResource(id = R.color.colorPrimary),
content = { MyRow() },
content = { paddingValues ->
MyRow(
modifier = Modifier
.padding(bottom = paddingValues.calculateBottomPadding())
)
},
topBar = { MyTopAppBar(scaffoldState = scaffoldState, scope = scope) },
bottomBar = { MyBottomAppBar() },
drawerContent = { MyColumn() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
package com.yourcompany.android.jetpackcompose.screens

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.yourcompany.android.jetpackcompose.router.BackButtonHandler
import com.yourcompany.android.jetpackcompose.router.JetFundamentalsRouter
import com.yourcompany.android.jetpackcompose.router.Screen
Expand All @@ -49,6 +50,6 @@ fun ColumnScreen() {
}

@Composable
fun MyColumn() {
fun MyColumn(modifier: Modifier = Modifier) {
//TODO write your code here
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
package com.yourcompany.android.jetpackcompose.screens

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.yourcompany.android.jetpackcompose.R
import com.yourcompany.android.jetpackcompose.router.BackButtonHandler
import com.yourcompany.android.jetpackcompose.router.JetFundamentalsRouter
Expand All @@ -52,6 +53,6 @@ fun RowScreen() {
}

@Composable
fun MyRow() {
fun MyRow(modifier: Modifier = Modifier) {
//TODO write your code here
}