YOLOFuse 密钥管理系统:API Key 安全生成与轮换
2026/1/2 2:25:23
让内容可滑动
//关键点 val scrollState = rememberScrollState() AlertDialog( containerColor = DialogBg, modifier = Modifier .widthIn(min = 400.dp) .fillMaxWidth(0.3f) //关键点 .windowInsetsPadding(WindowInsets.safeDrawing), onDismissRequest = { }, properties = DialogProperties( dismissOnBackPress = true, dismissOnClickOutside = true, // usePlatformDefaultWidth = false, // 禁用平台默认宽度,避免尺寸波动 decorFitsSystemWindows = false // 禁用系统窗口适配,减少布局冲突 ), title = { Row(verticalAlignment = Alignment.CenterVertically) { Image( painter = painterResource(R.drawable.warning), contentDescription = "菜单", modifier = Modifier.size(20.dp) ) Spacer(modifier = Modifier.width(8.dp)) Text(text = title, fontSize = 22.sp) } }, text = { //关键点 Column(modifier = Modifier.verticalScroll(scrollState)) { if (!firstPrompt.isBlank()) { CustomOutlinedTextField( label = { Text(firstStrDes) }, value = firstPrompt, singleLine = true, readOnly = true, enabled = false, onValueChange = { }, keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Text, imeAction = ImeAction.Done ), modifier = Modifier .height(55.dp) .fillMaxWidth(0.95f), contentPadding = PaddingValues(start = 10.dp, end = 2.dp), colors = OutlinedTextFieldDefaults.customColors(), ) Spacer(modifier = Modifier.height(8.dp)) } CustomExposedDropdownMenu( modifier = Modifier .height(55.dp) .fillMaxWidth(0.95f), tempShow, labelStr, selectedOptionText = selectedOptionText ) { result -> selectedOptionTextId.value = result.getShowId() } Spacer(modifier = Modifier.height(8.dp)) CustomOutlinedTextField( label = { Text(textInputDes) }, value = editString.value, singleLine = true, onValueChange = { editString.value = it }, keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Number, imeAction = ImeAction.Done ), modifier = Modifier .height(55.dp) .fillMaxWidth(0.95f), contentPadding = PaddingValues(start = 10.dp, end = 2.dp), colors = OutlinedTextFieldDefaults.customColors(), ) } }, confirmButton = { TextButton(onClick = { if (editString.value.isEmpty()) { ToastUtil.showToast("请输入${textInputValue}") return@TextButton } // 根据选中的ID找到对应的T对象 val selectedItem = showSelectList.find { it.getShowId() == selectedOptionTextId.value } if (null == selectedItem) { ToastUtil.showToast("请选择$labelStr") return@TextButton } okClick?.invoke(selectedItem, editString.value) dialogState.value = false }) { Text(text = "确认") } }, dismissButton = { TextButton(onClick = { dialogState.value = false }) { Text(text = "取消") } }, )