File tree Expand file tree Collapse file tree
app/src/main/java/com/quickfilemanager/ui/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com.quickfilemanager.ui.components
2+
3+ import androidx.compose.foundation.layout.*
4+ import androidx.compose.material3.*
5+ import androidx.compose.runtime.*
6+ import androidx.compose.ui.Modifier
7+ import androidx.compose.ui.unit.dp
8+
9+ @Composable
10+ fun CreateFolderDialog (
11+ onDismiss : () -> Unit ,
12+ onConfirm : (String ) -> Unit
13+ ) {
14+ var name by remember { mutableStateOf(" " ) }
15+
16+ AlertDialog (
17+ onDismissRequest = onDismiss,
18+ title = { Text (" 新建文件夹" ) },
19+ text = {
20+ OutlinedTextField (
21+ value = name,
22+ onValueChange = { name = it },
23+ label = { Text (" 文件夹名称" ) },
24+ singleLine = true ,
25+ modifier = Modifier .fillMaxWidth()
26+ )
27+ },
28+ confirmButton = {
29+ TextButton (
30+ onClick = { onConfirm(name) },
31+ enabled = name.isNotBlank()
32+ ) {
33+ Text (" 创建" )
34+ }
35+ },
36+ dismissButton = {
37+ TextButton (onClick = onDismiss) {
38+ Text (" 取消" )
39+ }
40+ }
41+ )
42+ }
You can’t perform that action at this time.
0 commit comments