manager: fix template status display issue (#2910)

manager: 修复模板状态显示问题 (#2910)

修复当 app 设置过模板后再使用自定义配置,离开页面后再次打开,管理器显示应用使用的是模板而不是自定义配置的问题

- bump AGP version

Co-authored-by: u9521 <63995396+u9521@users.noreply.github.com>
This commit is contained in:
ShirkNeko
2025-11-11 16:00:54 +08:00
parent 05cca26075
commit a7f840d811
2 changed files with 14 additions and 6 deletions

View File

@@ -248,7 +248,12 @@ private fun AppProfileInner(
ProfileBox(mode, true) {
// template mode shouldn't change profile here!
if (it == Mode.Default || it == Mode.Custom) {
onProfileChange(profile.copy(rootUseDefault = it == Mode.Default))
onProfileChange(
profile.copy(
rootUseDefault = it == Mode.Default,
rootTemplate = null
)
)
}
mode = it
}
@@ -479,7 +484,10 @@ private fun ProfileBox(
@SuppressLint("UnusedBoxWithConstraintsScope")
@Composable
private fun AppMenuBox(packageName: String, content: @Composable () -> Unit) {
private fun AppMenuBox(
packageName: String,
content: @Composable () -> Unit
) {
var expanded by remember { mutableStateOf(false) }
var touchPoint: Offset by remember { mutableStateOf(Offset.Zero) }
val density = LocalDensity.current
@@ -499,15 +507,15 @@ private fun AppMenuBox(packageName: String, content: @Composable () -> Unit) {
content()
val (offsetX, offsetY) = with(density) {
(touchPoint.x.toDp()) to (touchPoint.y.toDp())
(touchPoint.x.toDp()) to (-touchPoint.y.toDp())
}
DropdownMenu(
expanded = expanded,
offset = DpOffset(offsetX, -offsetY),
offset = DpOffset(offsetX, offsetY),
onDismissRequest = {
expanded = false
},
}
) {
AppMenuOption(
text = stringResource(id = R.string.launch_app),

View File

@@ -1,6 +1,6 @@
[versions]
accompanist-drawablepainter = "0.37.3"
agp = "8.13.0"
agp = "8.13.1"
gson = "2.13.2"
kotlin = "2.2.21"
ksp = "2.2.21-2.0.4"