|
@@ -7,13 +7,22 @@ import androidx.compose.foundation.lazy.LazyColumn
|
|
|
import androidx.compose.foundation.lazy.LazyListState
|
|
|
import androidx.compose.foundation.lazy.itemsIndexed
|
|
|
import androidx.compose.foundation.lazy.rememberLazyListState
|
|
|
+import androidx.compose.material.icons.Icons
|
|
|
+import androidx.compose.material.icons.outlined.ArrowBack
|
|
|
+import androidx.compose.material.icons.outlined.SortByAlpha
|
|
|
+import androidx.compose.material3.Icon
|
|
|
+import androidx.compose.material3.IconButton
|
|
|
import androidx.compose.material3.MaterialTheme
|
|
|
+import androidx.compose.material3.Text
|
|
|
+import androidx.compose.material3.TopAppBar
|
|
|
import androidx.compose.runtime.Composable
|
|
|
import androidx.compose.ui.Modifier
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
+import androidx.compose.ui.unit.dp
|
|
|
import eu.kanade.presentation.category.components.CategoryFloatingActionButton
|
|
|
import eu.kanade.presentation.category.components.CategoryListItem
|
|
|
import eu.kanade.presentation.components.AppBar
|
|
|
+import eu.kanade.presentation.components.AppBarActions
|
|
|
import eu.kanade.tachiyomi.R
|
|
|
import eu.kanade.tachiyomi.ui.category.CategoryScreenState
|
|
|
import tachiyomi.domain.category.model.Category
|
|
@@ -27,6 +36,7 @@ import tachiyomi.presentation.core.util.plus
|
|
|
fun CategoryScreen(
|
|
|
state: CategoryScreenState.Success,
|
|
|
onClickCreate: () -> Unit,
|
|
|
+ onClickSortAlphabetically: () -> Unit,
|
|
|
onClickRename: (Category) -> Unit,
|
|
|
onClickDelete: (Category) -> Unit,
|
|
|
onClickMoveUp: (Category) -> Unit,
|
|
@@ -36,9 +46,32 @@ fun CategoryScreen(
|
|
|
val lazyListState = rememberLazyListState()
|
|
|
Scaffold(
|
|
|
topBar = { scrollBehavior ->
|
|
|
- AppBar(
|
|
|
- title = stringResource(R.string.action_edit_categories),
|
|
|
- navigateUp = navigateUp,
|
|
|
+ TopAppBar(
|
|
|
+ title = {
|
|
|
+ Text(
|
|
|
+ text = stringResource(R.string.action_edit_categories),
|
|
|
+ modifier = Modifier.padding(start = 8.dp),
|
|
|
+ )
|
|
|
+ },
|
|
|
+ navigationIcon = {
|
|
|
+ IconButton(onClick = navigateUp) {
|
|
|
+ Icon(
|
|
|
+ imageVector = Icons.Outlined.ArrowBack,
|
|
|
+ contentDescription = stringResource(R.string.abc_action_bar_up_description),
|
|
|
+ )
|
|
|
+ }
|
|
|
+ },
|
|
|
+ actions = {
|
|
|
+ AppBarActions(
|
|
|
+ listOf(
|
|
|
+ AppBar.Action(
|
|
|
+ title = stringResource(R.string.action_sort),
|
|
|
+ icon = Icons.Outlined.SortByAlpha,
|
|
|
+ onClick = onClickSortAlphabetically,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ },
|
|
|
scrollBehavior = scrollBehavior,
|
|
|
)
|
|
|
},
|