Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide batch add if integrated H & Delegated src is off #1088

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions app/src/main/java/eu/kanade/presentation/more/MoreScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.Storage
import androidx.compose.material3.HorizontalDivider
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalUriHandler
Expand All @@ -34,13 +35,17 @@ import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget
import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.more.DownloadQueueState
import exh.pref.DelegateSourcePreferences
import tachiyomi.core.common.Constants
import tachiyomi.domain.UnsortedPreferences
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.pluralStringResource
import tachiyomi.presentation.core.i18n.stringResource
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get

@Composable
fun MoreScreen(
Expand All @@ -65,6 +70,10 @@ fun MoreScreen(
onClickHistory: () -> Unit,
) {
val uriHandler = LocalUriHandler.current
// SY -->
val unsortedPreferences = remember { Injekt.get<UnsortedPreferences>() }
val delegateSourcePreferences = remember { Injekt.get<DelegateSourcePreferences>() }
// SY <--

Scaffold(
topBar = {
Expand Down Expand Up @@ -185,12 +194,14 @@ fun MoreScreen(
)
}
// SY -->
item {
TextPreferenceWidget(
title = stringResource(SYMR.strings.eh_batch_add),
icon = Icons.AutoMirrored.Outlined.PlaylistAdd,
onPreferenceClick = onClickBatchAdd,
)
if (unsortedPreferences.isHentaiEnabled().get() || delegateSourcePreferences.delegateSources().get()) {
item {
TextPreferenceWidget(
title = stringResource(SYMR.strings.eh_batch_add),
icon = Icons.AutoMirrored.Outlined.PlaylistAdd,
onPreferenceClick = onClickBatchAdd,
)
}
}
// SY <--

Expand Down
Loading