Merge branch 'github/main'

pull/305/head
Automerger 2 years ago
commit 3083c5e2ce

@ -70,6 +70,34 @@ fun NiaTopAppBar(
)
}
/**
* Top app bar with action, displayed on the right
*/
@Composable
fun NiaTopAppBar(
@StringRes titleRes: Int,
actionIcon: ImageVector,
actionIconContentDescription: String?,
modifier: Modifier = Modifier,
colors: TopAppBarColors = TopAppBarDefaults.centerAlignedTopAppBarColors(),
onActionClick: () -> Unit = {}
) {
CenterAlignedTopAppBar(
title = { Text(text = stringResource(id = titleRes)) },
actions = {
IconButton(onClick = onActionClick) {
Icon(
imageVector = actionIcon,
contentDescription = actionIconContentDescription,
tint = MaterialTheme.colorScheme.onSurface
)
}
},
colors = colors,
modifier = modifier
)
}
@Preview("Top App Bar")
@Composable
fun NiaTopAppBarPreview() {

@ -77,10 +77,6 @@ fun BookmarksScreen(
topBar = {
NiaTopAppBar(
titleRes = R.string.top_app_bar_title_saved,
navigationIcon = NiaIcons.Search,
navigationIconContentDescription = stringResource(
id = R.string.top_app_bar_action_search
),
actionIcon = NiaIcons.AccountCircle,
actionIconContentDescription = stringResource(
id = R.string.top_app_bar_action_menu

@ -132,10 +132,6 @@ fun ForYouScreen(
topBar = {
NiaTopAppBar(
titleRes = R.string.top_app_bar_title,
navigationIcon = NiaIcons.Search,
navigationIconContentDescription = stringResource(
id = R.string.for_you_top_app_bar_action_search
),
actionIcon = NiaIcons.AccountCircle,
actionIconContentDescription = stringResource(
id = R.string.for_you_top_app_bar_action_my_account

@ -96,10 +96,6 @@ fun InterestsScreen(
NiaTopAppBar(
titleRes = R.string.interests,
navigationIcon = NiaIcons.Search,
navigationIconContentDescription = stringResource(
id = R.string.interests_top_app_bar_action_seearch
),
actionIcon = NiaIcons.MoreVert,
actionIconContentDescription = stringResource(
id = R.string.interests_top_app_bar_action_menu

Loading…
Cancel
Save