2022-05-15 17:03:57 -04:00
|
|
|
package eu.kanade.presentation.browse
|
2022-05-15 09:59:53 -04:00
|
|
|
|
|
|
|
import androidx.annotation.StringRes
|
2022-10-01 10:32:08 -04:00
|
|
|
import androidx.compose.animation.core.animateDpAsState
|
2022-05-15 09:59:53 -04:00
|
|
|
import androidx.compose.foundation.combinedClickable
|
2022-10-01 10:32:08 -04:00
|
|
|
import androidx.compose.foundation.layout.Box
|
2022-05-15 09:59:53 -04:00
|
|
|
import androidx.compose.foundation.layout.Column
|
2022-10-09 15:52:56 -04:00
|
|
|
import androidx.compose.foundation.layout.PaddingValues
|
2022-05-15 09:59:53 -04:00
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
|
import androidx.compose.foundation.layout.RowScope
|
|
|
|
import androidx.compose.foundation.layout.padding
|
2022-10-01 10:32:08 -04:00
|
|
|
import androidx.compose.foundation.layout.size
|
2022-05-15 09:59:53 -04:00
|
|
|
import androidx.compose.foundation.lazy.items
|
|
|
|
import androidx.compose.material.icons.Icons
|
2022-10-29 11:43:51 -04:00
|
|
|
import androidx.compose.material.icons.outlined.Close
|
2022-05-15 09:59:53 -04:00
|
|
|
import androidx.compose.material3.AlertDialog
|
|
|
|
import androidx.compose.material3.Button
|
2022-10-01 10:32:08 -04:00
|
|
|
import androidx.compose.material3.CircularProgressIndicator
|
2022-05-15 09:59:53 -04:00
|
|
|
import androidx.compose.material3.Icon
|
|
|
|
import androidx.compose.material3.IconButton
|
|
|
|
import androidx.compose.material3.LocalTextStyle
|
|
|
|
import androidx.compose.material3.MaterialTheme
|
2022-10-01 10:32:08 -04:00
|
|
|
import androidx.compose.material3.ProvideTextStyle
|
2022-05-15 09:59:53 -04:00
|
|
|
import androidx.compose.material3.Text
|
|
|
|
import androidx.compose.material3.TextButton
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.getValue
|
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
|
|
import androidx.compose.runtime.remember
|
2022-05-19 17:43:27 -04:00
|
|
|
import androidx.compose.runtime.setValue
|
2022-05-15 09:59:53 -04:00
|
|
|
import androidx.compose.ui.Alignment
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.platform.LocalContext
|
|
|
|
import androidx.compose.ui.res.stringResource
|
|
|
|
import androidx.compose.ui.text.style.TextOverflow
|
|
|
|
import androidx.compose.ui.unit.dp
|
2022-10-01 10:32:08 -04:00
|
|
|
import com.google.accompanist.flowlayout.FlowRow
|
2022-05-15 09:59:53 -04:00
|
|
|
import eu.kanade.presentation.browse.components.BaseBrowseItem
|
|
|
|
import eu.kanade.presentation.browse.components.ExtensionIcon
|
2022-07-16 14:44:37 -04:00
|
|
|
import eu.kanade.presentation.components.EmptyScreen
|
2022-06-19 10:33:25 -04:00
|
|
|
import eu.kanade.presentation.components.FastScrollLazyColumn
|
2022-07-16 14:44:37 -04:00
|
|
|
import eu.kanade.presentation.components.LoadingScreen
|
2022-10-09 11:20:43 -04:00
|
|
|
import eu.kanade.presentation.components.SwipeRefresh
|
2022-10-01 10:32:08 -04:00
|
|
|
import eu.kanade.presentation.manga.components.DotSeparatorNoSpaceText
|
2022-05-15 09:59:53 -04:00
|
|
|
import eu.kanade.presentation.theme.header
|
|
|
|
import eu.kanade.presentation.util.horizontalPadding
|
2022-05-15 14:00:35 -04:00
|
|
|
import eu.kanade.presentation.util.plus
|
2022-10-01 10:32:08 -04:00
|
|
|
import eu.kanade.presentation.util.secondaryItemAlpha
|
2022-05-15 16:19:55 -04:00
|
|
|
import eu.kanade.presentation.util.topPaddingValues
|
2022-05-15 09:59:53 -04:00
|
|
|
import eu.kanade.tachiyomi.R
|
|
|
|
import eu.kanade.tachiyomi.extension.model.Extension
|
|
|
|
import eu.kanade.tachiyomi.extension.model.InstallStep
|
|
|
|
import eu.kanade.tachiyomi.ui.browse.extension.ExtensionUiModel
|
2022-05-15 17:03:57 -04:00
|
|
|
import eu.kanade.tachiyomi.ui.browse.extension.ExtensionsPresenter
|
2022-05-15 09:59:53 -04:00
|
|
|
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
fun ExtensionScreen(
|
2022-05-15 17:03:57 -04:00
|
|
|
presenter: ExtensionsPresenter,
|
2022-10-09 15:52:56 -04:00
|
|
|
contentPadding: PaddingValues,
|
2022-05-15 09:59:53 -04:00
|
|
|
onLongClickItem: (Extension) -> Unit,
|
|
|
|
onClickItemCancel: (Extension) -> Unit,
|
|
|
|
onInstallExtension: (Extension.Available) -> Unit,
|
|
|
|
onUninstallExtension: (Extension) -> Unit,
|
|
|
|
onUpdateExtension: (Extension.Installed) -> Unit,
|
|
|
|
onTrustExtension: (Extension.Untrusted) -> Unit,
|
|
|
|
onOpenExtension: (Extension.Installed) -> Unit,
|
|
|
|
onClickUpdateAll: () -> Unit,
|
|
|
|
onRefresh: () -> Unit,
|
|
|
|
) {
|
|
|
|
SwipeRefresh(
|
2022-10-09 11:20:43 -04:00
|
|
|
refreshing = presenter.isRefreshing,
|
2022-05-15 09:59:53 -04:00
|
|
|
onRefresh = onRefresh,
|
2022-10-09 11:20:43 -04:00
|
|
|
enabled = !presenter.isLoading,
|
2022-05-15 09:59:53 -04:00
|
|
|
) {
|
2022-07-16 14:44:37 -04:00
|
|
|
when {
|
|
|
|
presenter.isLoading -> LoadingScreen()
|
2022-10-09 15:52:56 -04:00
|
|
|
presenter.isEmpty -> EmptyScreen(
|
|
|
|
textResource = R.string.empty_screen,
|
|
|
|
modifier = Modifier.padding(contentPadding),
|
|
|
|
)
|
2022-07-16 14:44:37 -04:00
|
|
|
else -> {
|
2022-05-15 09:59:53 -04:00
|
|
|
ExtensionContent(
|
2022-07-16 14:44:37 -04:00
|
|
|
state = presenter,
|
2022-10-09 15:52:56 -04:00
|
|
|
contentPadding = contentPadding,
|
2022-05-15 09:59:53 -04:00
|
|
|
onLongClickItem = onLongClickItem,
|
|
|
|
onClickItemCancel = onClickItemCancel,
|
|
|
|
onInstallExtension = onInstallExtension,
|
|
|
|
onUninstallExtension = onUninstallExtension,
|
|
|
|
onUpdateExtension = onUpdateExtension,
|
|
|
|
onTrustExtension = onTrustExtension,
|
|
|
|
onOpenExtension = onOpenExtension,
|
|
|
|
onClickUpdateAll = onClickUpdateAll,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Composable
|
2022-09-18 22:38:44 -04:00
|
|
|
private fun ExtensionContent(
|
2022-07-16 14:44:37 -04:00
|
|
|
state: ExtensionsState,
|
2022-10-09 15:52:56 -04:00
|
|
|
contentPadding: PaddingValues,
|
2022-05-15 09:59:53 -04:00
|
|
|
onLongClickItem: (Extension) -> Unit,
|
|
|
|
onClickItemCancel: (Extension) -> Unit,
|
|
|
|
onInstallExtension: (Extension.Available) -> Unit,
|
|
|
|
onUninstallExtension: (Extension) -> Unit,
|
|
|
|
onUpdateExtension: (Extension.Installed) -> Unit,
|
|
|
|
onTrustExtension: (Extension.Untrusted) -> Unit,
|
|
|
|
onOpenExtension: (Extension.Installed) -> Unit,
|
|
|
|
onClickUpdateAll: () -> Unit,
|
|
|
|
) {
|
2022-05-19 17:43:27 -04:00
|
|
|
var trustState by remember { mutableStateOf<Extension.Untrusted?>(null) }
|
|
|
|
|
2022-06-19 10:33:25 -04:00
|
|
|
FastScrollLazyColumn(
|
2022-10-09 15:52:56 -04:00
|
|
|
contentPadding = contentPadding + topPaddingValues,
|
2022-05-15 09:59:53 -04:00
|
|
|
) {
|
|
|
|
items(
|
2022-07-16 14:44:37 -04:00
|
|
|
items = state.items,
|
2022-05-15 09:59:53 -04:00
|
|
|
contentType = {
|
|
|
|
when (it) {
|
2022-10-21 22:50:33 -04:00
|
|
|
is ExtensionUiModel.Header -> "header"
|
2022-05-15 09:59:53 -04:00
|
|
|
is ExtensionUiModel.Item -> "item"
|
|
|
|
}
|
|
|
|
},
|
2022-09-26 17:23:04 -04:00
|
|
|
key = {
|
|
|
|
when (it) {
|
2022-10-01 10:32:08 -04:00
|
|
|
is ExtensionUiModel.Header -> "extensionHeader-${it.hashCode()}"
|
2022-10-21 22:50:33 -04:00
|
|
|
is ExtensionUiModel.Item -> "extension-${it.hashCode()}"
|
2022-09-26 17:23:04 -04:00
|
|
|
}
|
|
|
|
},
|
2022-05-15 09:59:53 -04:00
|
|
|
) { item ->
|
|
|
|
when (item) {
|
|
|
|
is ExtensionUiModel.Header.Resource -> {
|
|
|
|
val action: @Composable RowScope.() -> Unit =
|
|
|
|
if (item.textRes == R.string.ext_updates_pending) {
|
|
|
|
{
|
|
|
|
Button(onClick = { onClickUpdateAll() }) {
|
|
|
|
Text(
|
2022-05-19 17:43:27 -04:00
|
|
|
text = stringResource(R.string.ext_update_all),
|
2022-05-15 09:59:53 -04:00
|
|
|
style = LocalTextStyle.current.copy(
|
|
|
|
color = MaterialTheme.colorScheme.onPrimary,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
{}
|
|
|
|
}
|
|
|
|
ExtensionHeader(
|
|
|
|
textRes = item.textRes,
|
|
|
|
modifier = Modifier.animateItemPlacement(),
|
|
|
|
action = action,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
is ExtensionUiModel.Header.Text -> {
|
|
|
|
ExtensionHeader(
|
|
|
|
text = item.text,
|
|
|
|
modifier = Modifier.animateItemPlacement(),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
is ExtensionUiModel.Item -> {
|
|
|
|
ExtensionItem(
|
|
|
|
modifier = Modifier.animateItemPlacement(),
|
|
|
|
item = item,
|
|
|
|
onClickItem = {
|
|
|
|
when (it) {
|
|
|
|
is Extension.Available -> onInstallExtension(it)
|
2022-07-15 14:44:59 -04:00
|
|
|
is Extension.Installed -> onOpenExtension(it)
|
2022-05-19 17:43:27 -04:00
|
|
|
is Extension.Untrusted -> { trustState = it }
|
2022-05-15 09:59:53 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
onLongClickItem = onLongClickItem,
|
|
|
|
onClickItemCancel = onClickItemCancel,
|
|
|
|
onClickItemAction = {
|
|
|
|
when (it) {
|
|
|
|
is Extension.Available -> onInstallExtension(it)
|
|
|
|
is Extension.Installed -> {
|
|
|
|
if (it.hasUpdate) {
|
|
|
|
onUpdateExtension(it)
|
|
|
|
} else {
|
|
|
|
onOpenExtension(it)
|
|
|
|
}
|
|
|
|
}
|
2022-05-19 17:43:27 -04:00
|
|
|
is Extension.Untrusted -> { trustState = it }
|
2022-05-15 09:59:53 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (trustState != null) {
|
|
|
|
ExtensionTrustDialog(
|
|
|
|
onClickConfirm = {
|
2022-05-19 17:43:27 -04:00
|
|
|
onTrustExtension(trustState!!)
|
|
|
|
trustState = null
|
2022-05-15 09:59:53 -04:00
|
|
|
},
|
|
|
|
onClickDismiss = {
|
2022-05-19 17:43:27 -04:00
|
|
|
onUninstallExtension(trustState!!)
|
|
|
|
trustState = null
|
2022-05-15 09:59:53 -04:00
|
|
|
},
|
|
|
|
onDismissRequest = {
|
2022-05-19 17:43:27 -04:00
|
|
|
trustState = null
|
2022-05-15 09:59:53 -04:00
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Composable
|
2022-09-18 22:38:44 -04:00
|
|
|
private fun ExtensionItem(
|
2022-05-15 09:59:53 -04:00
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
item: ExtensionUiModel.Item,
|
|
|
|
onClickItem: (Extension) -> Unit,
|
|
|
|
onLongClickItem: (Extension) -> Unit,
|
|
|
|
onClickItemCancel: (Extension) -> Unit,
|
|
|
|
onClickItemAction: (Extension) -> Unit,
|
|
|
|
) {
|
|
|
|
val (extension, installStep) = item
|
|
|
|
BaseBrowseItem(
|
|
|
|
modifier = modifier
|
|
|
|
.combinedClickable(
|
|
|
|
onClick = { onClickItem(extension) },
|
|
|
|
onLongClick = { onLongClickItem(extension) },
|
|
|
|
),
|
|
|
|
onClickItem = { onClickItem(extension) },
|
|
|
|
onLongClickItem = { onLongClickItem(extension) },
|
|
|
|
icon = {
|
2022-10-01 10:32:08 -04:00
|
|
|
Box(
|
|
|
|
modifier = Modifier
|
|
|
|
.size(40.dp),
|
|
|
|
contentAlignment = Alignment.Center,
|
|
|
|
) {
|
|
|
|
val idle = installStep.isCompleted()
|
|
|
|
if (!idle) {
|
|
|
|
CircularProgressIndicator(
|
|
|
|
modifier = Modifier.size(40.dp),
|
|
|
|
strokeWidth = 2.dp,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
val padding by animateDpAsState(targetValue = if (idle) 0.dp else 8.dp)
|
|
|
|
ExtensionIcon(
|
|
|
|
extension = extension,
|
|
|
|
modifier = Modifier
|
|
|
|
.matchParentSize()
|
|
|
|
.padding(padding),
|
|
|
|
)
|
|
|
|
}
|
2022-05-15 09:59:53 -04:00
|
|
|
},
|
|
|
|
action = {
|
|
|
|
ExtensionItemActions(
|
|
|
|
extension = extension,
|
|
|
|
installStep = installStep,
|
|
|
|
onClickItemCancel = onClickItemCancel,
|
|
|
|
onClickItemAction = onClickItemAction,
|
|
|
|
)
|
|
|
|
},
|
|
|
|
) {
|
|
|
|
ExtensionItemContent(
|
|
|
|
extension = extension,
|
2022-10-01 10:32:08 -04:00
|
|
|
installStep = installStep,
|
2022-05-15 09:59:53 -04:00
|
|
|
modifier = Modifier.weight(1f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Composable
|
2022-09-18 22:38:44 -04:00
|
|
|
private fun ExtensionItemContent(
|
2022-05-15 09:59:53 -04:00
|
|
|
extension: Extension,
|
2022-10-01 10:32:08 -04:00
|
|
|
installStep: InstallStep,
|
2022-05-15 09:59:53 -04:00
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
) {
|
|
|
|
Column(
|
|
|
|
modifier = modifier.padding(start = horizontalPadding),
|
|
|
|
) {
|
|
|
|
Text(
|
|
|
|
text = extension.name,
|
|
|
|
maxLines = 1,
|
|
|
|
overflow = TextOverflow.Ellipsis,
|
|
|
|
style = MaterialTheme.typography.bodyMedium,
|
|
|
|
)
|
2022-10-01 10:32:08 -04:00
|
|
|
// Won't look good but it's not like we can ellipsize overflowing content
|
|
|
|
FlowRow(
|
|
|
|
modifier = Modifier.secondaryItemAlpha(),
|
|
|
|
mainAxisSpacing = 4.dp,
|
2022-05-15 09:59:53 -04:00
|
|
|
) {
|
2022-10-01 10:32:08 -04:00
|
|
|
ProvideTextStyle(value = MaterialTheme.typography.bodySmall) {
|
|
|
|
if (extension is Extension.Installed && extension.lang.isNotEmpty()) {
|
|
|
|
Text(
|
|
|
|
text = LocaleHelper.getSourceDisplayName(extension.lang, LocalContext.current),
|
|
|
|
)
|
|
|
|
}
|
2022-05-15 09:59:53 -04:00
|
|
|
|
2022-10-01 10:32:08 -04:00
|
|
|
if (extension.versionName.isNotEmpty()) {
|
|
|
|
Text(
|
|
|
|
text = extension.versionName,
|
|
|
|
)
|
|
|
|
}
|
2022-05-15 09:59:53 -04:00
|
|
|
|
2022-10-01 10:32:08 -04:00
|
|
|
val warning = when {
|
|
|
|
extension is Extension.Untrusted -> R.string.ext_untrusted
|
|
|
|
extension is Extension.Installed && extension.isUnofficial -> R.string.ext_unofficial
|
|
|
|
extension is Extension.Installed && extension.isObsolete -> R.string.ext_obsolete
|
|
|
|
extension.isNsfw -> R.string.ext_nsfw_short
|
|
|
|
else -> null
|
|
|
|
}
|
|
|
|
if (warning != null) {
|
|
|
|
Text(
|
|
|
|
text = stringResource(warning).uppercase(),
|
2022-05-15 09:59:53 -04:00
|
|
|
color = MaterialTheme.colorScheme.error,
|
2022-10-01 10:32:08 -04:00
|
|
|
maxLines = 1,
|
|
|
|
overflow = TextOverflow.Ellipsis,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!installStep.isCompleted()) {
|
|
|
|
DotSeparatorNoSpaceText()
|
|
|
|
Text(
|
|
|
|
text = when (installStep) {
|
|
|
|
InstallStep.Pending -> stringResource(R.string.ext_pending)
|
|
|
|
InstallStep.Downloading -> stringResource(R.string.ext_downloading)
|
|
|
|
InstallStep.Installing -> stringResource(R.string.ext_installing)
|
|
|
|
else -> error("Must not show non-install process text")
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2022-05-15 09:59:53 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Composable
|
2022-09-18 22:38:44 -04:00
|
|
|
private fun ExtensionItemActions(
|
2022-05-15 09:59:53 -04:00
|
|
|
extension: Extension,
|
|
|
|
installStep: InstallStep,
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
onClickItemCancel: (Extension) -> Unit = {},
|
|
|
|
onClickItemAction: (Extension) -> Unit = {},
|
|
|
|
) {
|
2022-10-01 10:32:08 -04:00
|
|
|
val isIdle = installStep.isCompleted()
|
2022-05-15 09:59:53 -04:00
|
|
|
Row(modifier = modifier) {
|
2022-10-01 10:32:08 -04:00
|
|
|
if (isIdle) {
|
|
|
|
TextButton(
|
|
|
|
onClick = { onClickItemAction(extension) },
|
|
|
|
) {
|
|
|
|
Text(
|
|
|
|
text = when (installStep) {
|
|
|
|
InstallStep.Installed -> stringResource(R.string.ext_installed)
|
|
|
|
InstallStep.Error -> stringResource(R.string.action_retry)
|
|
|
|
InstallStep.Idle -> {
|
|
|
|
when (extension) {
|
|
|
|
is Extension.Installed -> {
|
|
|
|
if (extension.hasUpdate) {
|
|
|
|
stringResource(R.string.ext_update)
|
|
|
|
} else {
|
|
|
|
stringResource(R.string.action_settings)
|
|
|
|
}
|
2022-05-15 09:59:53 -04:00
|
|
|
}
|
2022-10-01 10:32:08 -04:00
|
|
|
is Extension.Untrusted -> stringResource(R.string.ext_trust)
|
|
|
|
is Extension.Available -> stringResource(R.string.ext_install)
|
2022-05-15 09:59:53 -04:00
|
|
|
}
|
|
|
|
}
|
2022-10-01 10:32:08 -04:00
|
|
|
else -> error("Must not show install process text")
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
} else {
|
2022-05-15 09:59:53 -04:00
|
|
|
IconButton(onClick = { onClickItemCancel(extension) }) {
|
2022-05-17 08:09:11 -04:00
|
|
|
Icon(
|
2022-10-29 11:43:51 -04:00
|
|
|
imageVector = Icons.Outlined.Close,
|
2022-10-15 11:58:24 -04:00
|
|
|
contentDescription = stringResource(R.string.action_cancel),
|
2022-05-17 08:09:11 -04:00
|
|
|
)
|
2022-05-15 09:59:53 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Composable
|
2022-09-18 22:38:44 -04:00
|
|
|
private fun ExtensionHeader(
|
2022-05-15 09:59:53 -04:00
|
|
|
@StringRes textRes: Int,
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
action: @Composable RowScope.() -> Unit = {},
|
|
|
|
) {
|
|
|
|
ExtensionHeader(
|
2022-06-25 11:20:34 -04:00
|
|
|
text = stringResource(textRes),
|
2022-05-15 09:59:53 -04:00
|
|
|
modifier = modifier,
|
|
|
|
action = action,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
@Composable
|
2022-09-18 22:38:44 -04:00
|
|
|
private fun ExtensionHeader(
|
2022-05-15 09:59:53 -04:00
|
|
|
text: String,
|
|
|
|
modifier: Modifier = Modifier,
|
|
|
|
action: @Composable RowScope.() -> Unit = {},
|
|
|
|
) {
|
|
|
|
Row(
|
|
|
|
modifier = modifier.padding(horizontal = horizontalPadding),
|
|
|
|
verticalAlignment = Alignment.CenterVertically,
|
|
|
|
) {
|
|
|
|
Text(
|
|
|
|
text = text,
|
|
|
|
modifier = Modifier
|
|
|
|
.padding(vertical = 8.dp)
|
|
|
|
.weight(1f),
|
|
|
|
style = MaterialTheme.typography.header,
|
|
|
|
)
|
|
|
|
action()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Composable
|
2022-09-18 22:38:44 -04:00
|
|
|
private fun ExtensionTrustDialog(
|
2022-05-15 09:59:53 -04:00
|
|
|
onClickConfirm: () -> Unit,
|
|
|
|
onClickDismiss: () -> Unit,
|
|
|
|
onDismissRequest: () -> Unit,
|
|
|
|
) {
|
|
|
|
AlertDialog(
|
|
|
|
title = {
|
2022-05-19 17:43:27 -04:00
|
|
|
Text(text = stringResource(R.string.untrusted_extension))
|
2022-05-15 09:59:53 -04:00
|
|
|
},
|
|
|
|
text = {
|
2022-05-19 17:43:27 -04:00
|
|
|
Text(text = stringResource(R.string.untrusted_extension_message))
|
2022-05-15 09:59:53 -04:00
|
|
|
},
|
|
|
|
confirmButton = {
|
|
|
|
TextButton(onClick = onClickConfirm) {
|
2022-05-19 17:43:27 -04:00
|
|
|
Text(text = stringResource(R.string.ext_trust))
|
2022-05-15 09:59:53 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
dismissButton = {
|
|
|
|
TextButton(onClick = onClickDismiss) {
|
2022-05-19 17:43:27 -04:00
|
|
|
Text(text = stringResource(R.string.ext_uninstall))
|
2022-05-15 09:59:53 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
onDismissRequest = onDismissRequest,
|
|
|
|
)
|
|
|
|
}
|