General improvements (#134)
* Add visual options and seamless transitions to the EPUB reader * Add support for DOCX file format * Refine padding and status bar inset handling in Epub pagination mode * Add file size parameter for recent files and sorting * Refactor book data cleanup logic into a centralized method * Bump version to 1.0.40(41)
This commit is contained in:
parent
15264a31ae
commit
6fd6dd5609
20 changed files with 623 additions and 134 deletions
|
|
@ -5970,42 +5970,44 @@ fun PdfViewerScreen(
|
|||
}
|
||||
|
||||
// AI feat
|
||||
Box {
|
||||
var showAiFeaturesMenu by remember { mutableStateOf(false) }
|
||||
TooltipIconButton(
|
||||
text = stringResource(R.string.tooltip_ai),
|
||||
description = stringResource(R.string.tooltip_ai_desc),
|
||||
onClick = { showAiFeaturesMenu = true }
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ai),
|
||||
contentDescription = "AI Features"
|
||||
)
|
||||
}
|
||||
DropdownMenu(
|
||||
expanded = showAiFeaturesMenu,
|
||||
onDismissRequest = { showAiFeaturesMenu = false }) {
|
||||
DropdownMenuItem(
|
||||
text = {
|
||||
Text("Summarize Page (Page ${currentPage + 1})")
|
||||
}, onClick = {
|
||||
showAiFeaturesMenu = false
|
||||
if (isProUser) {
|
||||
showSummarizationPopup = true
|
||||
coroutineScope.launch {
|
||||
isSummarizationLoading = true
|
||||
summarizationResult = null
|
||||
summarizeCurrentPage(onUpdate = { result ->
|
||||
summarizationResult = result
|
||||
}, onFinish = {
|
||||
isSummarizationLoading = false
|
||||
})
|
||||
if (BuildConfig.FLAVOR != "oss") {
|
||||
Box {
|
||||
var showAiFeaturesMenu by remember { mutableStateOf(false) }
|
||||
TooltipIconButton(
|
||||
text = stringResource(R.string.tooltip_ai),
|
||||
description = stringResource(R.string.tooltip_ai_desc),
|
||||
onClick = { showAiFeaturesMenu = true }
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ai),
|
||||
contentDescription = "AI Features"
|
||||
)
|
||||
}
|
||||
DropdownMenu(
|
||||
expanded = showAiFeaturesMenu,
|
||||
onDismissRequest = { showAiFeaturesMenu = false }) {
|
||||
DropdownMenuItem(
|
||||
text = {
|
||||
Text("Summarize Page (Page ${currentPage + 1})")
|
||||
}, onClick = {
|
||||
showAiFeaturesMenu = false
|
||||
if (isProUser) {
|
||||
showSummarizationPopup = true
|
||||
coroutineScope.launch {
|
||||
isAiDefinitionLoading = true
|
||||
summarizationResult = null
|
||||
summarizeCurrentPage(onUpdate = { result ->
|
||||
summarizationResult = result
|
||||
}, onFinish = {
|
||||
isAiDefinitionLoading = false
|
||||
})
|
||||
}
|
||||
} else {
|
||||
showSummarizationUpsellDialog = true
|
||||
}
|
||||
} else {
|
||||
showSummarizationUpsellDialog = true
|
||||
}
|
||||
}, enabled = !isSummarizationLoading && pdfDocument != null
|
||||
)
|
||||
}, enabled = !isSummarizationLoading && pdfDocument != null
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue