Minor cleanup

This commit is contained in:
Jobobby04 2023-03-05 15:05:54 -05:00
parent 259b8f383f
commit 70b83e1061
4 changed files with 19 additions and 30 deletions

View File

@ -260,7 +260,7 @@ fun LibraryBottomActionMenu(
// SY -->
val showOverflow = onClickCleanTitles != null || onClickAddToMangaDex != null
val configuration = LocalConfiguration.current
val moveMarkPrev = onDeleteClicked != null && remember { !configuration.isTabletUi() }
val moveMarkPrev = remember { !configuration.isTabletUi() }
var overFlowOpen by remember { mutableStateOf(false) }
// SY <--
Row(
@ -304,17 +304,15 @@ fun LibraryBottomActionMenu(
onClick = onDeleteClicked,
)
// SY -->
if (onMarkAsReadClicked != null) {
Button(
title = stringResource(R.string.action_mark_as_read),
icon = Icons.Outlined.DoneAll,
toConfirm = confirm[1],
onLongClick = { onLongClickItem(1) },
onClick = onMarkAsReadClicked,
)
}
Button(
title = stringResource(R.string.action_mark_as_read),
icon = Icons.Outlined.DoneAll,
toConfirm = confirm[1],
onLongClick = { onLongClickItem(1) },
onClick = onMarkAsReadClicked,
)
if (showOverflow) {
if (!moveMarkPrev && onMarkAsUnreadClicked != null) {
if (!moveMarkPrev) {
Button(
title = stringResource(R.string.action_mark_as_unread),
icon = Icons.Outlined.RemoveDone,
@ -334,7 +332,7 @@ fun LibraryBottomActionMenu(
expanded = overFlowOpen,
onDismissRequest = { overFlowOpen = false },
) {
if (onMarkAsUnreadClicked != null && moveMarkPrev) {
if (moveMarkPrev) {
DropdownMenuItem(
text = { Text(stringResource(R.string.action_mark_as_unread)) },
onClick = onMarkAsUnreadClicked,
@ -360,15 +358,13 @@ fun LibraryBottomActionMenu(
}
}
} else {
if (onMarkAsUnreadClicked != null) {
Button(
title = stringResource(R.string.action_mark_as_unread),
icon = Icons.Outlined.RemoveDone,
toConfirm = confirm[2],
onLongClick = { onLongClickItem(2) },
onClick = onMarkAsUnreadClicked,
)
}
Button(
title = stringResource(R.string.action_mark_as_unread),
icon = Icons.Outlined.RemoveDone,
toConfirm = confirm[2],
onLongClick = { onLongClickItem(2) },
onClick = onMarkAsUnreadClicked,
)
if (onClickMigrate != null) {
Button(
title = stringResource(R.string.migrate),

View File

@ -12,7 +12,6 @@ import androidx.fragment.app.FragmentActivity
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import eu.kanade.domain.UnsortedPreferences
import eu.kanade.domain.base.BasePreferences
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.domain.ui.UiPreferences
import eu.kanade.presentation.more.settings.Preference
@ -35,7 +34,6 @@ object SettingsBrowseScreen : SearchableSettings {
override fun getPreferences(): List<Preference> {
val context = LocalContext.current
val sourcePreferences = remember { Injekt.get<SourcePreferences>() }
val preferences = remember { Injekt.get<BasePreferences>() }
// SY -->
val uiPreferences = remember { Injekt.get<UiPreferences>() }
val unsortedPreferences = remember { Injekt.get<UnsortedPreferences>() }

View File

@ -18,7 +18,7 @@ enum class EHLogLevel(@StringRes val nameRes: Int, @StringRes val description: I
fun init(context: Context) {
curLogLevel = PreferenceManager.getDefaultSharedPreferences(context)
.getInt("eh_log_level", 0) // todo
.getInt("eh_log_level", MINIMAL.ordinal) // todo
}
fun shouldLog(requiredLogLevel: EHLogLevel): Boolean {

View File

@ -1,6 +1,5 @@
package exh.metadata.sql.models
import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
@Serializable
@ -19,8 +18,4 @@ data class SearchMetadata(
// The version of this metadata's extra. Used to track changes to the 'extra' field's schema
val extraVersion: Int,
) {
// Transient information attached to this piece of metadata, useful for caching
var transientCache: Map<String, @Contextual Any>? = null
}
)