no need using builder to create AppBarAction
This commit is contained in:
parent
a7c6232a50
commit
89a5f2e702
4 changed files with 24 additions and 37 deletions
|
|
@ -280,17 +280,13 @@ fun SourceFeedToolbar(
|
|||
// KMK -->
|
||||
actions = {
|
||||
AppBarActions(
|
||||
actions = persistentListOf<AppBar.AppBarAction>().builder()
|
||||
.apply {
|
||||
add(
|
||||
AppBar.Action(
|
||||
title = stringResource(MR.strings.action_bulk_select),
|
||||
icon = Icons.Outlined.Checklist,
|
||||
onClick = toggleSelectionMode,
|
||||
),
|
||||
)
|
||||
}
|
||||
.build(),
|
||||
actions = persistentListOf(
|
||||
AppBar.Action(
|
||||
title = stringResource(MR.strings.action_bulk_select),
|
||||
icon = Icons.Outlined.Checklist,
|
||||
onClick = toggleSelectionMode,
|
||||
),
|
||||
)
|
||||
)
|
||||
persistentListOf(
|
||||
SourceSettingsButton(sourceId),
|
||||
|
|
|
|||
|
|
@ -65,17 +65,13 @@ fun GlobalSearchToolbar(
|
|||
// KMK -->
|
||||
actions = {
|
||||
AppBarActions(
|
||||
actions = persistentListOf<AppBar.AppBarAction>().builder()
|
||||
.apply {
|
||||
add(
|
||||
AppBar.Action(
|
||||
title = stringResource(MR.strings.action_bulk_select),
|
||||
icon = Icons.Outlined.Checklist,
|
||||
onClick = toggleSelectionMode,
|
||||
),
|
||||
)
|
||||
}
|
||||
.build(),
|
||||
actions = persistentListOf(
|
||||
AppBar.Action(
|
||||
title = stringResource(MR.strings.action_bulk_select),
|
||||
icon = Icons.Outlined.Checklist,
|
||||
onClick = toggleSelectionMode,
|
||||
),
|
||||
)
|
||||
)
|
||||
},
|
||||
// KMK <--
|
||||
|
|
|
|||
|
|
@ -17,14 +17,13 @@ import tachiyomi.i18n.MR
|
|||
import tachiyomi.presentation.core.i18n.stringResource
|
||||
import tachiyomi.source.local.LocalSource
|
||||
|
||||
// KMK -->
|
||||
@Composable
|
||||
fun SourceSettingsButton(
|
||||
id: Long,
|
||||
@Suppress("UNUSED_PARAMETER") modifier: Modifier = Modifier
|
||||
) {
|
||||
// Create a fake source
|
||||
val source = Source(id,"", "", supportsLatest = false, isStub = false)
|
||||
val source = Source(id, "", "", supportsLatest = false, isStub = false)
|
||||
SourceSettingsButton(source = source)
|
||||
}
|
||||
|
||||
|
|
@ -38,8 +37,9 @@ fun SourceSettingsButton(
|
|||
|
||||
val navigator = LocalNavigator.currentOrThrow
|
||||
IconButton(onClick = {
|
||||
if (source.installedExtension !== null)
|
||||
if (source.installedExtension !== null) {
|
||||
navigator.push(ExtensionDetailsScreen(source.installedExtension!!.pkgName))
|
||||
}
|
||||
}) {
|
||||
Icon(
|
||||
imageVector = Icons.Outlined.Settings,
|
||||
|
|
@ -47,4 +47,3 @@ fun SourceSettingsButton(
|
|||
)
|
||||
}
|
||||
}
|
||||
// KMK <--
|
||||
|
|
|
|||
|
|
@ -85,17 +85,13 @@ data class SourceSearchScreen(
|
|||
// KMK -->
|
||||
actions = {
|
||||
AppBarActions(
|
||||
actions = persistentListOf<AppBar.AppBarAction>().builder()
|
||||
.apply {
|
||||
add(
|
||||
AppBar.Action(
|
||||
title = stringResource(MR.strings.action_bulk_select),
|
||||
icon = Icons.Outlined.Checklist,
|
||||
onClick = bulkFavoriteScreenModel::toggleSelectionMode,
|
||||
),
|
||||
)
|
||||
}
|
||||
.build(),
|
||||
actions = persistentListOf(
|
||||
AppBar.Action(
|
||||
title = stringResource(MR.strings.action_bulk_select),
|
||||
icon = Icons.Outlined.Checklist,
|
||||
onClick = bulkFavoriteScreenModel::toggleSelectionMode,
|
||||
),
|
||||
)
|
||||
)
|
||||
},
|
||||
// KMK <--
|
||||
|
|
|
|||
Loading…
Reference in a new issue