更新登录UI

This commit is contained in:
2024-10-01 01:49:29 +08:00
parent c43006d38b
commit 45a698003f
5 changed files with 28 additions and 28 deletions

View File

@@ -22,6 +22,7 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.buildAnnotatedString
@@ -30,11 +31,12 @@ import androidx.compose.ui.text.withStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.viewinterop.AndroidView
import com.aiosman.riderpro.R
import com.aiosman.riderpro.data.DictService
import com.aiosman.riderpro.data.DictServiceImpl
import kotlinx.coroutines.launch
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterialApi::class)
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun PolicyCheckbox(
checked: Boolean = false,
@@ -84,17 +86,19 @@ fun PolicyCheckbox(
size = 16
)
val text = buildAnnotatedString {
append("I agree to the ")
val keyword = stringResource(R.string.private_policy_keyword)
val template = stringResource(R.string.private_policy_template)
append(template)
withStyle(style = SpanStyle(color = if (error) Color.Red else Color.Black)) {
append("terms and conditions")
append(keyword)
}
addStyle(
style = SpanStyle(
color = Color.Blue,
textDecoration = TextDecoration.Underline
),
start = "I agree to the ".length,
end = "I agree to the terms and conditions".length
start = template.length,
end = template.length + keyword.length
)
}
ClickableText(

View File

@@ -137,7 +137,7 @@ fun Profile(
val bannerHeight = 500
var headerBannerMaxHeight: Int = userHeight + bannerHeight
val headerBannerMinHeight = 100
val speedFactor = 0.5f
val speedFactor = 0.75f
var currentHeaderHeight by rememberSaveable { mutableStateOf<Int>(headerBannerMaxHeight) }
var scrollState = rememberLazyListState()
var gridScrollState = rememberLazyStaggeredGridState()
@@ -189,16 +189,13 @@ fun Profile(
return Offset(x = 0f, y = consumedHeader / speedFactor)
}
override suspend fun onPreFling(available: Velocity): Velocity {
return Velocity.Zero
}
override suspend fun onPostFling(
consumed: Velocity,
available: Velocity
): Velocity {
return Velocity.Zero
}
// override fun onPostScroll(
// consumed: Offset,
// available: Offset,
// source: NestedScrollSource
// ): Offset {
// return Offset.Zero
// }
}
}
@@ -448,7 +445,7 @@ fun Profile(
}
) {
Text(
text = "Gallery",
text = stringResource(R.string.gallery),
fontSize = 14.sp,
fontWeight = FontWeight.W600,
color = Color.Black,
@@ -471,7 +468,7 @@ fun Profile(
}
) {
Text(
text = "Moments",
text = stringResource(R.string.moment),
fontSize = 14.sp,
fontWeight = FontWeight.W600,
color = Color.Black,
@@ -784,7 +781,7 @@ fun OtherProfileAction(
)
Spacer(modifier = Modifier.width(4.dp))
Text(
text = "CHAT",
text = stringResource(R.string.chat_upper),
fontSize = 14.sp,
fontWeight = FontWeight.W600,
color = Color.Black,

View File

@@ -241,15 +241,6 @@ fun EmailSignupScreen() {
) {
acceptTerms = it
}
// CheckboxWithLabel(
// checked = acceptTerms,
// checkSize = 16,
// fontSize = 12,
// label = stringResource(R.string.agree_terms_of_service),
// error = termsError
// ) {
// acceptTerms = it
// }
Spacer(modifier = Modifier.height(16.dp))
CheckboxWithLabel(
checked = acceptPromotions,

View File

@@ -72,4 +72,8 @@
<string name="reset_mail_send_failed">邮件发送失败,请检查您的网络连接或稍后重试。</string>
<string name="seconds_ago">%1d秒前</string>
<string name="minutes_ago">%1d分钟前</string>
<string name="private_policy_template">同意</string>
<string name="private_policy_keyword">用户协议</string>
<string name="gallery">图片</string>
<string name="chat_upper">私信</string>
</resources>

View File

@@ -71,4 +71,8 @@
<string name="reset_mail_send_failed">Failed to send email. Please check your network connection or try again later.</string>
<string name="seconds_ago">%1d seconds ago</string>
<string name="minutes_ago">%1d minutes ago</string>
<string name="private_policy_template">I agree to the</string>
<string name="private_policy_keyword">term of service</string>
<string name="gallery">Gallery</string>
<string name="chat_upper">CHAT</string>
</resources>