手动创建AI界面调整
This commit is contained in:
@@ -131,9 +131,10 @@ fun AddAgentScreen() {
|
|||||||
.background(color = appColors.decentBackground),
|
.background(color = appColors.decentBackground),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
|
var showManualCreation by remember { mutableStateOf(false) }
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp)
|
modifier = Modifier.padding(horizontal = 14.dp, vertical = 16.dp)
|
||||||
.background(color = appColors.decentBackground)
|
.background(color = appColors.decentBackground)
|
||||||
) {
|
) {
|
||||||
// 自定义header,控制返回按钮行为
|
// 自定义header,控制返回按钮行为
|
||||||
@@ -166,11 +167,11 @@ fun AddAgentScreen() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(32.dp))
|
Spacer(modifier = Modifier.height(1.dp))
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(90.dp)
|
.height(50.dp)
|
||||||
.padding(horizontal = 20.dp),
|
.padding(horizontal = 20.dp),
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
@@ -183,7 +184,12 @@ fun AddAgentScreen() {
|
|||||||
),
|
),
|
||||||
contentScale = ContentScale.Crop
|
contentScale = ContentScale.Crop
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
}
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
Column(
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
.padding(start = 20.dp)
|
||||||
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "${AppState.profile?.nickName ?: "User"} 你好呀!今天想创造什么?",
|
text = "${AppState.profile?.nickName ?: "User"} 你好呀!今天想创造什么?",
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
@@ -191,19 +197,27 @@ fun AddAgentScreen() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
var showManualCreation by remember { mutableStateOf(false) }
|
Column(
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
.padding(start = 20.dp)
|
||||||
|
) {
|
||||||
|
if (!showManualCreation) {
|
||||||
|
Text(
|
||||||
|
text = "只需要一句话,你的专属AI将在这里诞生。",
|
||||||
|
fontSize = 14.sp,
|
||||||
|
color = LocalAppTheme.current.text.copy(alpha = 0.6f),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
|
|
||||||
|
|
||||||
if (!showManualCreation) {
|
if (!showManualCreation) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 20.dp)
|
.padding(horizontal = 20.dp)
|
||||||
) {
|
) {
|
||||||
Text(
|
|
||||||
text = "只需要一句话,你的专属AI将在这里诞生。",
|
|
||||||
fontSize = 14.sp,
|
|
||||||
color = LocalAppTheme.current.text.copy(alpha = 0.6f),
|
|
||||||
)
|
|
||||||
Spacer(modifier = Modifier.height(24.dp))
|
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@@ -418,7 +432,71 @@ fun AddAgentScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
// 原版头像的加号
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.padding(horizontal = 16.dp)
|
||||||
|
.align(Alignment.Start)
|
||||||
|
) {
|
||||||
|
// 添加新的一句话创造AI按钮
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.align(Alignment.Start)
|
||||||
|
.width(140.dp)
|
||||||
|
.height(40.dp)
|
||||||
|
.shadow(
|
||||||
|
elevation = 10.dp,
|
||||||
|
shape = RoundedCornerShape(10.dp),
|
||||||
|
spotColor = Color(0x33F563FF),
|
||||||
|
ambientColor = Color(0x99F563FF),
|
||||||
|
clip = false
|
||||||
|
)
|
||||||
|
.background(
|
||||||
|
brush = Brush.linearGradient(
|
||||||
|
listOf(
|
||||||
|
Color(0xFF6246FF),
|
||||||
|
Color(0xFF7C45ED)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
shape = RoundedCornerShape(10.dp)
|
||||||
|
)
|
||||||
|
.padding(0.5.dp)
|
||||||
|
.background(
|
||||||
|
color = appColors.background,
|
||||||
|
shape = RoundedCornerShape(10.dp),
|
||||||
|
)
|
||||||
|
.noRippleClickable {
|
||||||
|
showManualCreation = false
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.padding(horizontal = 12.dp, vertical = 8.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
painter = painterResource(id = R.mipmap.icons_info_magic),
|
||||||
|
contentDescription = null,
|
||||||
|
tint = Color.Black,
|
||||||
|
modifier = Modifier.size(18.dp),
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Text(
|
||||||
|
text = "一句话创造AI",
|
||||||
|
color = Color.Black,
|
||||||
|
fontWeight = FontWeight.W600,
|
||||||
|
fontSize = 14.sp
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
Text(
|
||||||
|
text = "头像",
|
||||||
|
fontSize = 12.sp,
|
||||||
|
fontWeight = FontWeight.W600
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(72.dp)
|
.size(72.dp)
|
||||||
@@ -441,29 +519,41 @@ fun AddAgentScreen() {
|
|||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Default.Add,
|
painter = painterResource(id = R.mipmap.icons_infor_edit),
|
||||||
contentDescription = "Add",
|
contentDescription = "Edit",
|
||||||
tint = Color.White,
|
tint = Color.White,
|
||||||
|
modifier = Modifier.size(20.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Spacer(modifier = Modifier.height(18.dp))
|
Spacer(modifier = Modifier.height(18.dp))
|
||||||
// 原版两个输入框
|
// 原版两个输入框
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
) {
|
) {
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.agent_name),
|
||||||
|
fontSize = 12.sp,
|
||||||
|
fontWeight = FontWeight.W600
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
FormTextInput(
|
FormTextInput(
|
||||||
value = model.name,
|
value = model.name,
|
||||||
label = stringResource(R.string.agent_name),
|
hint = "给它取个名字,让它成为独一无二的你",
|
||||||
hint = stringResource(R.string.agent_name_hint),
|
|
||||||
background = appColors.inputBackground2,
|
background = appColors.inputBackground2,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
) { value ->
|
) { value ->
|
||||||
onNameChange(value)
|
onNameChange(value)
|
||||||
}
|
}
|
||||||
|
Text(
|
||||||
|
text = stringResource(R.string.agent_desc),
|
||||||
|
fontSize = 12.sp,
|
||||||
|
fontWeight = FontWeight.W600
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
FormTextInput2(
|
FormTextInput2(
|
||||||
value = model.desc,
|
value = model.desc,
|
||||||
label = stringResource(R.string.agent_desc),
|
|
||||||
hint = stringResource(R.string.agent_desc_hint),
|
hint = stringResource(R.string.agent_desc_hint),
|
||||||
background = appColors.inputBackground2,
|
background = appColors.inputBackground2,
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.text.BasicTextField
|
import androidx.compose.foundation.text.BasicTextField
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
@@ -52,7 +54,7 @@ fun FormTextInput(
|
|||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(16.dp))
|
.clip(RoundedCornerShape(25.dp))
|
||||||
.background(background ?: AppColors.inputBackground)
|
.background(background ?: AppColors.inputBackground)
|
||||||
.let {
|
.let {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
@@ -79,34 +81,49 @@ fun FormTextInput(
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.padding(start = 16.dp)
|
|
||||||
) {
|
) {
|
||||||
if (value.isEmpty()) {
|
Icon(
|
||||||
Text(
|
painter = painterResource(id = R.mipmap.icons_infor_edit),
|
||||||
text = hint ?: "",
|
contentDescription = null,
|
||||||
style = TextStyle(
|
modifier = Modifier
|
||||||
fontSize = 16.sp,
|
.size(16.dp)
|
||||||
fontWeight = FontWeight.Normal,
|
.align(Alignment.TopStart),
|
||||||
color = AppColors.inputHint
|
tint = Color.Unspecified.copy(alpha = 0.4f)
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
BasicTextField(
|
|
||||||
maxLines = 1,
|
|
||||||
value = value,
|
|
||||||
onValueChange = {
|
|
||||||
onValueChange(it)
|
|
||||||
},
|
|
||||||
singleLine = true,
|
|
||||||
textStyle = TextStyle(
|
|
||||||
fontSize = 16.sp,
|
|
||||||
fontWeight = FontWeight.Normal,
|
|
||||||
color = AppColors.text
|
|
||||||
),
|
|
||||||
cursorBrush = SolidColor(AppColors.text),
|
|
||||||
)
|
)
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Spacer(modifier = Modifier.width(24.dp))
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
) {
|
||||||
|
if (value.isEmpty()) {
|
||||||
|
Text(
|
||||||
|
text = hint ?: "",
|
||||||
|
style = TextStyle(
|
||||||
|
fontSize = 14.sp,
|
||||||
|
fontWeight = FontWeight.Normal,
|
||||||
|
color = AppColors.inputHint
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
BasicTextField(
|
||||||
|
maxLines = 1,
|
||||||
|
value = value,
|
||||||
|
onValueChange = {
|
||||||
|
onValueChange(it)
|
||||||
|
},
|
||||||
|
singleLine = true,
|
||||||
|
textStyle = TextStyle(
|
||||||
|
fontSize = 14.sp,
|
||||||
|
fontWeight = FontWeight.Normal,
|
||||||
|
color = AppColors.text
|
||||||
|
),
|
||||||
|
cursorBrush = SolidColor(AppColors.text),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.text.BasicTextField
|
import androidx.compose.foundation.text.BasicTextField
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
@@ -55,7 +57,7 @@ fun FormTextInput2(
|
|||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(16.dp))
|
.clip(RoundedCornerShape(25.dp))
|
||||||
.background(background ?: AppColors.inputBackground)
|
.background(background ?: AppColors.inputBackground)
|
||||||
.let {
|
.let {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
@@ -83,40 +85,56 @@ fun FormTextInput2(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
) {
|
) {
|
||||||
if (value.isEmpty()) {
|
Icon(
|
||||||
Text(
|
painter = painterResource(id = R.mipmap.icons_infor_edit),
|
||||||
text = hint ?: "",
|
contentDescription = null,
|
||||||
style = TextStyle(
|
|
||||||
fontSize = 16.sp,
|
|
||||||
fontWeight = FontWeight.Normal,
|
|
||||||
color = AppColors.inputHint
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
BasicTextField(
|
|
||||||
maxLines = 5,
|
|
||||||
value = value,
|
|
||||||
onValueChange = {
|
|
||||||
onValueChange(it)
|
|
||||||
},
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.let {
|
.size(16.dp)
|
||||||
if (focusRequester != null) {
|
.align(Alignment.TopStart),
|
||||||
it.focusRequester(focusRequester)
|
tint = Color.Unspecified.copy(alpha = 0.4f)
|
||||||
} else {
|
|
||||||
it
|
|
||||||
}
|
|
||||||
},
|
|
||||||
textStyle = TextStyle(
|
|
||||||
fontSize = 16.sp,
|
|
||||||
fontWeight = FontWeight.Normal,
|
|
||||||
color = AppColors.text,
|
|
||||||
lineHeight = 20.sp
|
|
||||||
),
|
|
||||||
cursorBrush = SolidColor(AppColors.text),
|
|
||||||
)
|
)
|
||||||
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
|
) {
|
||||||
|
Spacer(modifier = Modifier.width(24.dp))
|
||||||
|
Box(
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
) {
|
||||||
|
if (value.isEmpty()) {
|
||||||
|
Text(
|
||||||
|
text = hint ?: "",
|
||||||
|
style = TextStyle(
|
||||||
|
fontSize = 14.sp,
|
||||||
|
fontWeight = FontWeight.Normal,
|
||||||
|
color = AppColors.inputHint
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
BasicTextField(
|
||||||
|
maxLines = 5,
|
||||||
|
value = value,
|
||||||
|
onValueChange = {
|
||||||
|
onValueChange(it)
|
||||||
|
},
|
||||||
|
modifier = Modifier
|
||||||
|
.let {
|
||||||
|
if (focusRequester != null) {
|
||||||
|
it.focusRequester(focusRequester)
|
||||||
|
} else {
|
||||||
|
it
|
||||||
|
}
|
||||||
|
},
|
||||||
|
textStyle = TextStyle(
|
||||||
|
fontSize = 14.sp,
|
||||||
|
fontWeight = FontWeight.Normal,
|
||||||
|
color = AppColors.text,
|
||||||
|
lineHeight = 20.sp
|
||||||
|
),
|
||||||
|
cursorBrush = SolidColor(AppColors.text),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user