-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Delete BottomNavBar.kt [Add] - Add TopAppBar.kt
- Loading branch information
Showing
24 changed files
with
331 additions
and
279 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
25 changes: 0 additions & 25 deletions
25
app/src/main/java/com/example/whats_eat/navigation/NavigationMenu.kt
This file was deleted.
Oops, something went wrong.
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
145 changes: 145 additions & 0 deletions
145
core/designsystem/src/main/java/com/example/designsystem/component/AppBar.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
package com.example.designsystem.component | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.RowScope | ||
import androidx.compose.material3.CenterAlignedTopAppBar | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.IconButton | ||
import androidx.compose.material3.LargeTopAppBar | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.material3.TopAppBarDefaults | ||
import androidx.compose.material3.TopAppBarScrollBehavior | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.vector.ImageVector | ||
import androidx.compose.ui.text.font.FontWeight | ||
import com.example.designsystem.theme.EatTypography | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun EatCenterAlignedAppBar( | ||
title: @Composable () -> Unit, | ||
navigationIcon: @Composable () -> Unit, | ||
actions: @Composable RowScope.() -> Unit, | ||
modifier: Modifier = Modifier, | ||
scrollBehavior: TopAppBarScrollBehavior? = null | ||
) { | ||
CenterAlignedTopAppBar( | ||
title = title, | ||
modifier = modifier, | ||
navigationIcon = navigationIcon, | ||
actions = actions, | ||
colors = TopAppBarDefaults.centerAlignedTopAppBarColors( | ||
containerColor = MaterialTheme.colorScheme.surface, | ||
navigationIconContentColor = MaterialTheme.colorScheme.onSurface, | ||
titleContentColor = MaterialTheme.colorScheme.onSurface, | ||
actionIconContentColor = MaterialTheme.colorScheme.onSurfaceVariant | ||
), | ||
scrollBehavior = scrollBehavior | ||
) | ||
} | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun EatCenterAlignedAppBar( | ||
navigationIcon: ImageVector, | ||
navigationIconOnClick: () -> Unit, | ||
actions: @Composable RowScope.() -> Unit, | ||
modifier: Modifier = Modifier | ||
) { | ||
EatCenterAlignedAppBar( | ||
title = { /* Nothing Here */ }, | ||
modifier = modifier, | ||
navigationIcon = { | ||
IconButton( | ||
onClick = navigationIconOnClick, | ||
content = { | ||
Icon( | ||
imageVector = navigationIcon, | ||
contentDescription = "Icon Button" | ||
) | ||
} | ||
) | ||
}, | ||
actions = actions | ||
) | ||
} | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun EatCenterAlignedAppBar( | ||
navigationIcon: ImageVector, | ||
navigationIconOnClick: () -> Unit, | ||
modifier: Modifier = Modifier | ||
) { | ||
EatCenterAlignedAppBar( | ||
title = { /* Nothing Here */ }, | ||
modifier = modifier, | ||
navigationIcon = { | ||
IconButton( | ||
onClick = navigationIconOnClick, | ||
content = { | ||
Icon( | ||
imageVector = navigationIcon, | ||
contentDescription = "Icon Button" | ||
) | ||
} | ||
) | ||
}, | ||
actions = { /* Nothing Here */ } | ||
) | ||
} | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun EatLargeTopAppBar( | ||
modifier: Modifier = Modifier, | ||
title: @Composable () -> Unit, | ||
actions: @Composable RowScope.() -> Unit | ||
) { | ||
LargeTopAppBar( | ||
title = title, | ||
modifier = modifier, | ||
actions = actions | ||
) | ||
} | ||
|
||
@Composable | ||
fun EatLargeTopAppBar( | ||
mainTitle: String, | ||
subTitle: String, | ||
actionIcon: ImageVector, | ||
actionIconOnClick: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
EatLargeTopAppBar( | ||
title = { | ||
Column { | ||
Text( | ||
text = mainTitle, | ||
fontWeight = FontWeight.Bold, | ||
style = EatTypography.headlineMedium | ||
) | ||
Text( | ||
text = subTitle, | ||
fontWeight = FontWeight.Medium, | ||
style = EatTypography.titleSmall | ||
) | ||
} | ||
}, | ||
modifier = modifier, | ||
actions = { | ||
IconButton( | ||
onClick = actionIconOnClick, | ||
content = { | ||
Icon( | ||
imageVector = actionIcon, | ||
contentDescription = "Icon" | ||
) | ||
} | ||
) | ||
} | ||
) | ||
} |
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
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
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
Oops, something went wrong.