diff --git a/app/src/main/java/com/xinto/mauth/ui/component/ResponsiveAppBarScaffold.kt b/app/src/main/java/com/xinto/mauth/ui/component/ResponsiveAppBarScaffold.kt index 91043ee..007e60d 100644 --- a/app/src/main/java/com/xinto/mauth/ui/component/ResponsiveAppBarScaffold.kt +++ b/app/src/main/java/com/xinto/mauth/ui/component/ResponsiveAppBarScaffold.kt @@ -42,7 +42,7 @@ fun ResponsiveAppBarScaffold( TopAppBar( title = appBarTitle, actions = { - actions(Arrangement.Start) + actions(Arrangement.Reverse) }, scrollBehavior = scrollBehavior ) @@ -57,7 +57,7 @@ fun ResponsiveAppBarScaffold( if (sizeClass.widthSizeClass != WindowWidthSizeClass.Expanded) { BottomAppBar( actions = { - actions(Arrangement.Reverse) + actions(Arrangement.Start) }, floatingActionButton = floatingActionButton ) diff --git a/app/src/main/java/com/xinto/mauth/ui/screen/home/component/HomeScaffold.kt b/app/src/main/java/com/xinto/mauth/ui/screen/home/component/HomeScaffold.kt index 85e8658..d1da63f 100644 --- a/app/src/main/java/com/xinto/mauth/ui/screen/home/component/HomeScaffold.kt +++ b/app/src/main/java/com/xinto/mauth/ui/screen/home/component/HomeScaffold.kt @@ -69,52 +69,6 @@ fun HomeScaffold( horizontalArrangement = arrangement, verticalAlignment = Alignment.CenterVertically, ) { - var isSortVisible by remember { mutableStateOf(false) } - IconButton(onClick = { - isSortVisible = true - }) { - Icon( - painter = painterResource(R.drawable.ic_sort), - contentDescription = null - ) - DropdownMenu( - expanded = isSortVisible, - onDismissRequest = { - isSortVisible = false - } - ) { - SortSetting.entries.forEach { - DropdownMenuItem( - onClick = { - isSortVisible = false - onActiveSortChange(it) - }, - text = { - val resource = remember(it) { - when (it) { - SortSetting.DateAsc -> R.string.home_sort_date_ascending - SortSetting.DateDesc -> R.string.home_sort_date_descending - SortSetting.LabelAsc -> R.string.home_sort_label_ascending - SortSetting.LabelDesc -> R.string.home_sort_label_descending - SortSetting.IssuerAsc -> R.string.home_sort_issuer_ascending - SortSetting.IssuerDesc -> R.string.home_sort_issuer_descending - } - } - Text(stringResource(resource)) - }, - trailingIcon = { - if (activeSortSetting == it) { - Icon( - painter = painterResource(R.drawable.ic_check), - contentDescription = null - ) - } - } - ) - } - } - } - var isMoreActionsVisible by remember { mutableStateOf(false) } IconButton(onClick = { isMoreActionsVisible = true @@ -161,6 +115,53 @@ fun HomeScaffold( ) } } + + var isSortVisible by remember { mutableStateOf(false) } + IconButton(onClick = { + isSortVisible = true + }) { + Icon( + painter = painterResource(R.drawable.ic_sort), + contentDescription = null + ) + DropdownMenu( + expanded = isSortVisible, + onDismissRequest = { + isSortVisible = false + } + ) { + SortSetting.entries.forEach { + DropdownMenuItem( + onClick = { + isSortVisible = false + onActiveSortChange(it) + }, + text = { + val resource = remember(it) { + when (it) { + SortSetting.DateAsc -> R.string.home_sort_date_ascending + SortSetting.DateDesc -> R.string.home_sort_date_descending + SortSetting.LabelAsc -> R.string.home_sort_label_ascending + SortSetting.LabelDesc -> R.string.home_sort_label_descending + SortSetting.IssuerAsc -> R.string.home_sort_issuer_ascending + SortSetting.IssuerDesc -> R.string.home_sort_issuer_descending + } + } + Text(stringResource(resource)) + }, + trailingIcon = { + if (activeSortSetting == it) { + Icon( + painter = painterResource(R.drawable.ic_check), + contentDescription = null + ) + } + } + ) + } + } + } + } } }