Skip to content

Commit

Permalink
perf: dialog dismissButton
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Aug 5, 2024
1 parent 602879d commit 2381bd6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
18 changes: 13 additions & 5 deletions app/src/main/kotlin/li/songe/gkd/ui/AppItemPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -344,16 +343,17 @@ fun AppItemPage(

showGroupItem?.let { showGroupItemVal ->
AlertDialog(
modifier = Modifier.defaultMinSize(300.dp),
onDismissRequest = { setShowGroupItem(null) },
title = {
Text(text = "规则组详情")
},
text = {
Column {
Text(text = showGroupItemVal.name)
Spacer(modifier = Modifier.height(10.dp))
Text(text = showGroupItemVal.desc ?: "")
if (showGroupItemVal.desc != null) {
Spacer(modifier = Modifier.height(10.dp))
Text(text = showGroupItemVal.desc)
}
}
},
confirmButton = {
Expand All @@ -371,7 +371,15 @@ fun AppItemPage(
Text(text = "查看图片")
}
}
})
},
dismissButton = {
TextButton(onClick = throttle {
setShowGroupItem(null)
}) {
Text(text = "关闭")
}
}
)
}

if (editGroupRaw != null && subsItem != null) {
Expand Down
8 changes: 7 additions & 1 deletion app/src/main/kotlin/li/songe/gkd/ui/GlobalRulePage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,12 @@ fun GlobalRulePage(subsItemId: Long, focusGroupKey: Int? = null) {
Text(text = "查看图片")
}
}
})
},
dismissButton = {
TextButton(onClick = { setShowGroupItem(null) }) {
Text(text = "关闭")
}
}
)
}
}

0 comments on commit 2381bd6

Please sign in to comment.