Skip to content

Commit

Permalink
iOS: 隐藏自动更新 #496
Browse files Browse the repository at this point in the history
  • Loading branch information
Him188 committed Sep 22, 2024
1 parent da7fc7a commit 0bc9e5d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright (C) 2024 OpenAni and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link.
*
* https://github.com/open-ani/ani/blob/main/LICENSE
*/

package me.him188.ani.app.ui.settings.tabs.app

import androidx.compose.animation.AnimatedVisibility
Expand Down Expand Up @@ -290,21 +299,21 @@ private fun SettingsScope.SoftwareUpdateGroup(
},
title = { Text("更新类型") },
)
HorizontalDividerItem()
SwitchItem(
updateSettings.inAppDownload,
{ state.updateSettings.update(updateSettings.copy(inAppDownload = it)) },
title = { Text("应用内下载") },
description = {
if (updateSettings.inAppDownload) {
Text("省去跳转浏览器步骤")
} else {
Text("已关闭,将会跳转到外部浏览器完成下载")
}
},
enabled = updateSettings.autoCheckUpdate,
)
if (!LocalPlatform.current.isIos()) {
HorizontalDividerItem()
SwitchItem(
updateSettings.inAppDownload,
{ state.updateSettings.update(updateSettings.copy(inAppDownload = it)) },
title = { Text("应用内下载") },
description = {
if (updateSettings.inAppDownload) {
Text("省去跳转浏览器步骤")
} else {
Text("已关闭,将会跳转到外部浏览器完成下载")
}
},
enabled = updateSettings.autoCheckUpdate,
)
AnimatedVisibility(updateSettings.inAppDownload) {
Column {
HorizontalDividerItem()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/*
* Copyright (C) 2024 OpenAni and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link.
*
* https://github.com/open-ani/ani/blob/main/LICENSE
*/

package me.him188.ani.app.ui.update

import androidx.compose.foundation.layout.Arrangement
Expand All @@ -24,7 +33,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.unit.dp
import me.him188.ani.app.platform.currentAniBuildConfig
import me.him188.ani.app.ui.foundation.LocalPlatform
import me.him188.ani.app.ui.foundation.widgets.RichDialogLayout
import me.him188.ani.utils.platform.isIos

@Composable
fun ChangelogDialog(
Expand All @@ -49,16 +60,18 @@ fun ChangelogDialog(
OutlinedButton({ uriHandler.openUri(RELEASES) }) {
Icon(Icons.Rounded.ArrowOutward, null)
}
Button(
{
latestVersion.downloadUrlAlternatives.firstOrNull()
?.let {
onStartDownload()
onDismissRequest()
}
},
) {
Icon(Icons.Rounded.Download, null)
if (LocalPlatform.current.isIos()) {
Button(
{
latestVersion.downloadUrlAlternatives.firstOrNull()
?.let {
onStartDownload()
onDismissRequest()
}
},
) {
Icon(Icons.Rounded.Download, null)
}
}
},
) {
Expand Down

0 comments on commit 0bc9e5d

Please sign in to comment.