mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 09:11:52 +01:00
simplify
This commit is contained in:
parent
81486e30e9
commit
f4bd57315a
@ -8,7 +8,6 @@ import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
@ -84,10 +83,7 @@ fun BrowseSourceComfortableGridItem(
|
||||
Badge(text = stringResource(R.string.in_library))
|
||||
}
|
||||
},
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
},
|
||||
onLongClick = onLongClick,
|
||||
onClick = onClick,
|
||||
)
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
@ -84,10 +83,7 @@ private fun BrowseSourceCompactGridItem(
|
||||
Badge(text = stringResource(R.string.in_library))
|
||||
}
|
||||
},
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
},
|
||||
onLongClick = onLongClick,
|
||||
onClick = onClick,
|
||||
)
|
||||
}
|
||||
|
@ -4,8 +4,6 @@ import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.State
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.paging.LoadState
|
||||
@ -61,8 +59,6 @@ fun BrowseSourceListItem(
|
||||
onClick: () -> Unit = {},
|
||||
onLongClick: () -> Unit = onClick,
|
||||
) {
|
||||
val haptic = LocalHapticFeedback.current
|
||||
|
||||
MangaListItem(
|
||||
title = manga.title,
|
||||
coverData = MangaCover(
|
||||
@ -78,10 +74,7 @@ fun BrowseSourceListItem(
|
||||
Badge(text = stringResource(R.string.in_library))
|
||||
}
|
||||
},
|
||||
onLongClick = {
|
||||
onLongClick()
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
},
|
||||
onLongClick = onLongClick,
|
||||
onClick = onClick,
|
||||
)
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalHapticFeedback
|
||||
import androidx.core.os.bundleOf
|
||||
import eu.kanade.domain.source.model.Source
|
||||
import eu.kanade.presentation.browse.BrowseSourceScreen
|
||||
@ -50,6 +52,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
override fun ComposeContent() {
|
||||
val scope = rememberCoroutineScope()
|
||||
val context = LocalContext.current
|
||||
val haptic = LocalHapticFeedback.current
|
||||
|
||||
BrowseSourceScreen(
|
||||
presenter = presenter,
|
||||
@ -64,6 +67,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
duplicateManga != null -> presenter.dialog = Dialog.AddDuplicateManga(manga, duplicateManga)
|
||||
else -> presenter.addFavorite(manga)
|
||||
}
|
||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||
}
|
||||
},
|
||||
onWebViewClick = f@{
|
||||
|
Loading…
Reference in New Issue
Block a user