CustomSelectionContainer: toolbarShown → toolbarHidden(typo correction) + ReaderTextParagraph: No OnClick and OnDoubleClick actions when text is selecting. (v1.0.1)
This commit is contained in:
parent
04e67aa03c
commit
9dfa06973f
3 changed files with 8 additions and 4 deletions
|
|
@ -207,7 +207,7 @@ fun CustomSelectionContainer(
|
|||
onCopyRequested: (() -> Unit),
|
||||
onTranslateRequested: ((String) -> Unit),
|
||||
onDictionaryRequested: ((String) -> Unit),
|
||||
content: @Composable (Boolean) -> Unit
|
||||
content: @Composable (toolbarHidden: Boolean) -> Unit
|
||||
) {
|
||||
val view = LocalView.current
|
||||
val context = LocalContext.current
|
||||
|
|
|
|||
|
|
@ -348,14 +348,14 @@ private fun ReaderScreen(
|
|||
)
|
||||
)
|
||||
}
|
||||
) { toolbarShowed ->
|
||||
) { toolbarHidden ->
|
||||
LazyColumn(
|
||||
state = state.value.listState,
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(backgroundColor)
|
||||
.then(
|
||||
if (!loading.value && toolbarShowed) {
|
||||
if (!loading.value && toolbarHidden) {
|
||||
Modifier
|
||||
.clickable(
|
||||
interactionSource = null,
|
||||
|
|
@ -398,6 +398,7 @@ private fun ReaderScreen(
|
|||
fontSize = mainState.value.fontSize!!.sp,
|
||||
sidePadding = sidePadding,
|
||||
paragraphIndentation = mainState.value.paragraphIndentation!!,
|
||||
toolbarHidden = toolbarHidden,
|
||||
onEvent = onEvent
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ import java.util.Locale
|
|||
* @param fontSize Line's font size.
|
||||
* @param sidePadding Line's side padding.
|
||||
* @param paragraphIndentation Whether Paragraph Indentation is enabled for this line.
|
||||
* @param toolbarHidden Whether selection toolbar is hidden.
|
||||
* @param onEvent [ReaderEvent] callback.
|
||||
*/
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
|
|
@ -77,6 +78,7 @@ fun LazyItemScope.ReaderTextParagraph(
|
|||
fontSize: TextUnit,
|
||||
sidePadding: Dp,
|
||||
paragraphIndentation: Boolean,
|
||||
toolbarHidden: Boolean,
|
||||
onEvent: (ReaderEvent) -> Unit
|
||||
) {
|
||||
val text = remember(
|
||||
|
|
@ -167,7 +169,8 @@ fun LazyItemScope.ReaderTextParagraph(
|
|||
.then(
|
||||
if (
|
||||
state.value.book.enableTranslator &&
|
||||
state.value.book.doubleClickTranslation
|
||||
state.value.book.doubleClickTranslation &&
|
||||
toolbarHidden
|
||||
) {
|
||||
Modifier.combinedClickable(
|
||||
interactionSource = null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue