提取App颜色
This commit is contained in:
@@ -2,6 +2,65 @@ package com.aiosman.riderpro
|
|||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
||||||
object AppColors {
|
var AppColors = LightThemeColors()
|
||||||
val mainColor = Color(0xffED1C24)
|
//var AppColors = DarkThemeColors()
|
||||||
}
|
|
||||||
|
open class AppThemeData(
|
||||||
|
var main: Color,
|
||||||
|
var mainText: Color,
|
||||||
|
var basicMain: Color,
|
||||||
|
var nonActive: Color,
|
||||||
|
var text: Color,
|
||||||
|
var nonActiveText: Color,
|
||||||
|
var secondaryText: Color,
|
||||||
|
var loadingMain: Color,
|
||||||
|
var loadingText: Color,
|
||||||
|
var disabledBackground: Color,
|
||||||
|
var background: Color,
|
||||||
|
var divider: Color,
|
||||||
|
var inputBackground: Color,
|
||||||
|
var inputHint: Color,
|
||||||
|
var error : Color,
|
||||||
|
var checkedBackground: Color,
|
||||||
|
var checkedText: Color,
|
||||||
|
)
|
||||||
|
|
||||||
|
class LightThemeColors : AppThemeData(
|
||||||
|
main = Color(0xffda3832),
|
||||||
|
mainText = Color(0xffffffff),
|
||||||
|
basicMain = Color(0xfff0f0f0),
|
||||||
|
nonActive = Color(0xfff5f5f5),
|
||||||
|
text = Color(0xff333333),
|
||||||
|
nonActiveText = Color(0xff333333),
|
||||||
|
secondaryText = Color(0x99000000),
|
||||||
|
loadingMain = Color(0xFFD95757),
|
||||||
|
loadingText = Color(0xffffffff),
|
||||||
|
disabledBackground = Color(0xFFD0D0D0),
|
||||||
|
background = Color(0xFFFFFFFF),
|
||||||
|
divider = Color(0xFFEbEbEb),
|
||||||
|
inputBackground = Color(0xFFF7f7f7),
|
||||||
|
inputHint = Color(0xffdadada),
|
||||||
|
error = Color(0xffFF0000),
|
||||||
|
checkedBackground = Color(0xff000000),
|
||||||
|
checkedText = Color(0xffFFFFFF),
|
||||||
|
)
|
||||||
|
|
||||||
|
class DarkThemeColors : AppThemeData(
|
||||||
|
main = Color(0xffda3832),
|
||||||
|
mainText = Color(0xffffffff),
|
||||||
|
basicMain = Color(0xFF1C1C1C),
|
||||||
|
nonActive = Color(0xff1f1f1f),
|
||||||
|
text = Color(0xffffffff),
|
||||||
|
nonActiveText = Color(0xff888888),
|
||||||
|
secondaryText = Color(0x99ffffff),
|
||||||
|
loadingMain = Color(0xFFD95757),
|
||||||
|
loadingText = Color(0xff000000),
|
||||||
|
disabledBackground = Color(0xFF3A3A3A),
|
||||||
|
background = Color(0xFF121212),
|
||||||
|
divider = Color(0xFF282828),
|
||||||
|
inputBackground = Color(0xFF1C1C1C),
|
||||||
|
inputHint = Color(0xff888888),
|
||||||
|
error = Color(0xffFF0000),
|
||||||
|
checkedBackground = Color(0xffffffff),
|
||||||
|
checkedText = Color(0xff000000),
|
||||||
|
)
|
||||||
@@ -19,13 +19,13 @@ import androidx.compose.runtime.rememberCoroutineScope
|
|||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.ConstVars
|
import com.aiosman.riderpro.ConstVars
|
||||||
import com.aiosman.riderpro.ErrorCode
|
import com.aiosman.riderpro.ErrorCode
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
@@ -35,7 +35,6 @@ import com.aiosman.riderpro.data.AccountServiceImpl
|
|||||||
import com.aiosman.riderpro.data.DictService
|
import com.aiosman.riderpro.data.DictService
|
||||||
import com.aiosman.riderpro.data.DictServiceImpl
|
import com.aiosman.riderpro.data.DictServiceImpl
|
||||||
import com.aiosman.riderpro.data.ServiceException
|
import com.aiosman.riderpro.data.ServiceException
|
||||||
import com.aiosman.riderpro.getErrorMessageCode
|
|
||||||
import com.aiosman.riderpro.ui.comment.NoticeScreenHeader
|
import com.aiosman.riderpro.ui.comment.NoticeScreenHeader
|
||||||
import com.aiosman.riderpro.ui.composables.ActionButton
|
import com.aiosman.riderpro.ui.composables.ActionButton
|
||||||
import com.aiosman.riderpro.ui.composables.StatusBarSpacer
|
import com.aiosman.riderpro.ui.composables.StatusBarSpacer
|
||||||
@@ -148,7 +147,7 @@ fun ResetPasswordScreen() {
|
|||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.reset_mail_send_success),
|
text = stringResource(R.string.reset_mail_send_success),
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = Color(0xFF333333),
|
color = AppColors.text,
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
),
|
),
|
||||||
@@ -158,7 +157,7 @@ fun ResetPasswordScreen() {
|
|||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.reset_mail_send_failed),
|
text = stringResource(R.string.reset_mail_send_failed),
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = Color(0xFF333333),
|
color = AppColors.text,
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
),
|
),
|
||||||
@@ -177,8 +176,8 @@ fun ResetPasswordScreen() {
|
|||||||
} else {
|
} else {
|
||||||
stringResource(R.string.recover)
|
stringResource(R.string.recover)
|
||||||
},
|
},
|
||||||
backgroundColor = Color(0xffda3832),
|
backgroundColor = AppColors.main,
|
||||||
color = Color.White,
|
color = AppColors.mainText,
|
||||||
isLoading = isLoading,
|
isLoading = isLoading,
|
||||||
contentPadding = PaddingValues(0.dp),
|
contentPadding = PaddingValues(0.dp),
|
||||||
enabled = countDown == null,
|
enabled = countDown == null,
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ fun ChangePasswordScreen() {
|
|||||||
.width(345.dp)
|
.width(345.dp)
|
||||||
.height(48.dp),
|
.height(48.dp),
|
||||||
text = "Let's Ride",
|
text = "Let's Ride",
|
||||||
backgroundImage = R.mipmap.rider_pro_signup_red_bg
|
|
||||||
) {
|
) {
|
||||||
if (validate()) {
|
if (validate()) {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ fun AccountEditScreen2() {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(32.dp)
|
.size(32.dp)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.background(AppColors.mainColor)
|
.background(AppColors.main)
|
||||||
.align(Alignment.BottomEnd)
|
.align(Alignment.BottomEnd)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
navController.navigate(NavigationRoute.ImageCrop.route)
|
navController.navigate(NavigationRoute.ImageCrop.route)
|
||||||
|
|||||||
@@ -20,11 +20,13 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.composables.StatusBarMaskLayout
|
import com.aiosman.riderpro.ui.composables.StatusBarMaskLayout
|
||||||
@@ -72,17 +74,18 @@ fun NoticeScreenHeader(
|
|||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = R.drawable.rider_pro_back_icon),
|
painter = painterResource(id = R.drawable.rider_pro_back_icon,),
|
||||||
contentDescription = title,
|
contentDescription = title,
|
||||||
modifier = Modifier.size(16.dp).clickable(
|
modifier = Modifier.size(16.dp).clickable(
|
||||||
indication = null,
|
indication = null,
|
||||||
interactionSource = remember { MutableInteractionSource() }
|
interactionSource = remember { MutableInteractionSource() }
|
||||||
) {
|
) {
|
||||||
nav.popBackStack()
|
nav.popBackStack()
|
||||||
}
|
},
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.size(12.dp))
|
Spacer(modifier = Modifier.size(12.dp))
|
||||||
Text(title, fontWeight = FontWeight.W800, fontSize = 17.sp)
|
Text(title, fontWeight = FontWeight.W800, fontSize = 17.sp, color = AppColors.text)
|
||||||
if (moreIcon) {
|
if (moreIcon) {
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
Image(
|
Image(
|
||||||
|
|||||||
@@ -1,16 +1,12 @@
|
|||||||
package com.aiosman.riderpro.ui.composables
|
package com.aiosman.riderpro.ui.composables
|
||||||
|
|
||||||
import androidx.annotation.DrawableRes
|
//import androidx.compose.foundation.layout.ColumnScopeInstance.weight
|
||||||
import androidx.compose.animation.animateColorAsState
|
import androidx.compose.animation.animateColorAsState
|
||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
//import androidx.compose.foundation.layout.ColumnScopeInstance.weight
|
|
||||||
import androidx.compose.foundation.layout.PaddingValues
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.Row
|
|
||||||
import androidx.compose.foundation.layout.Spacer
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
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.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
@@ -26,23 +22,23 @@ import androidx.compose.ui.text.font.FontWeight
|
|||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ActionButton(
|
fun ActionButton(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
text: String,
|
text: String,
|
||||||
color: Color = Color.Black,
|
color: Color = AppColors.text,
|
||||||
@DrawableRes backgroundImage: Int? = null,
|
backgroundColor: Color = AppColors.basicMain,
|
||||||
backgroundColor: Color = Color(0xfff0f0f0),
|
|
||||||
leading: @Composable (() -> Unit)? = null,
|
leading: @Composable (() -> Unit)? = null,
|
||||||
expandText: Boolean = false,
|
expandText: Boolean = false,
|
||||||
contentPadding: PaddingValues = PaddingValues(vertical = 16.dp),
|
contentPadding: PaddingValues = PaddingValues(vertical = 16.dp),
|
||||||
isLoading: Boolean = false,
|
isLoading: Boolean = false,
|
||||||
loadingTextColor: Color = Color.White,
|
loadingTextColor: Color = AppColors.loadingText,
|
||||||
loadingText: String = "Loading",
|
loadingText: String = "Loading",
|
||||||
loadingBackgroundColor: Color = Color(0xFFD95757),
|
loadingBackgroundColor: Color = AppColors.loadingMain,
|
||||||
disabledBackgroundColor: Color = Color(0xFFD0D0D0),
|
disabledBackgroundColor: Color = AppColors.disabledBackground,
|
||||||
enabled: Boolean = true,
|
enabled: Boolean = true,
|
||||||
fullWidth:Boolean = false,
|
fullWidth:Boolean = false,
|
||||||
click: () -> Unit = {}
|
click: () -> Unit = {}
|
||||||
@@ -124,7 +120,7 @@ fun ActionButton(
|
|||||||
) {
|
) {
|
||||||
CircularProgressIndicator(
|
CircularProgressIndicator(
|
||||||
modifier = Modifier.size(24.dp),
|
modifier = Modifier.size(24.dp),
|
||||||
color = Color.White
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
loadingText,
|
loadingText,
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
|
|
||||||
|
|
||||||
@@ -26,8 +27,8 @@ fun Checkbox(
|
|||||||
checked: Boolean = false,
|
checked: Boolean = false,
|
||||||
onCheckedChange: (Boolean) -> Unit = {}
|
onCheckedChange: (Boolean) -> Unit = {}
|
||||||
) {
|
) {
|
||||||
val backgroundColor by animateColorAsState(if (checked) Color.Black else Color.Transparent)
|
val backgroundColor by animateColorAsState(if (checked) AppColors.checkedBackground else Color.Transparent)
|
||||||
val borderColor by animateColorAsState(if (checked) Color.Transparent else Color(0xffebebeb))
|
val borderColor by animateColorAsState(if (checked) Color.Transparent else AppColors.secondaryText)
|
||||||
val borderWidth by animateDpAsState(if (checked) 0.dp else 2.dp)
|
val borderWidth by animateDpAsState(if (checked) 0.dp else 2.dp)
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
@@ -45,7 +46,7 @@ fun Checkbox(
|
|||||||
Icon(
|
Icon(
|
||||||
Icons.Default.Check,
|
Icons.Default.Check,
|
||||||
contentDescription = "Checked",
|
contentDescription = "Checked",
|
||||||
tint = Color.White,
|
tint = AppColors.checkedText
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun CheckboxWithLabel(
|
fun CheckboxWithLabel(
|
||||||
@@ -33,7 +34,7 @@ fun CheckboxWithLabel(
|
|||||||
modifier = Modifier.padding(start = 8.dp),
|
modifier = Modifier.padding(start = 8.dp),
|
||||||
fontSize = fontSize.sp,
|
fontSize = fontSize.sp,
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = if (error) Color.Red else Color.Black
|
color = if (error) AppColors.error else AppColors.text
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,22 @@
|
|||||||
package com.aiosman.riderpro.ui.composables
|
package com.aiosman.riderpro.ui.composables
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.width
|
|
||||||
import androidx.compose.foundation.layout.wrapContentWidth
|
import androidx.compose.foundation.layout.wrapContentWidth
|
||||||
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
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
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.layout.ContentScale
|
|
||||||
import androidx.compose.ui.res.painterResource
|
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.Dp
|
|
||||||
import androidx.compose.ui.unit.TextUnit
|
import androidx.compose.ui.unit.TextUnit
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
|
|
||||||
@@ -27,30 +24,27 @@ import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
|||||||
fun FollowButton(
|
fun FollowButton(
|
||||||
isFollowing: Boolean,
|
isFollowing: Boolean,
|
||||||
fontSize: TextUnit = 12.sp,
|
fontSize: TextUnit = 12.sp,
|
||||||
imageModifier: Modifier = Modifier,
|
|
||||||
onFollowClick: () -> Unit,
|
onFollowClick: () -> Unit,
|
||||||
){
|
){
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.wrapContentWidth()
|
.wrapContentWidth()
|
||||||
.padding(start = 6.dp)
|
.clip(RoundedCornerShape(8.dp))
|
||||||
|
.background(
|
||||||
|
color = if (isFollowing) AppColors.main else AppColors.nonActive
|
||||||
|
)
|
||||||
|
.padding(horizontal = 16.dp, vertical = 8.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
onFollowClick()
|
onFollowClick()
|
||||||
},
|
},
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
Image(
|
|
||||||
modifier = imageModifier,
|
|
||||||
painter = painterResource(id = R.drawable.follow_bg),
|
|
||||||
contentDescription = "",
|
|
||||||
contentScale = ContentScale.FillWidth
|
|
||||||
)
|
|
||||||
Text(
|
Text(
|
||||||
text = if (isFollowing) stringResource(R.string.following_upper) else stringResource(
|
text = if (isFollowing) stringResource(R.string.following_upper) else stringResource(
|
||||||
R.string.follow_upper
|
R.string.follow_upper
|
||||||
),
|
),
|
||||||
fontSize = fontSize,
|
fontSize = fontSize,
|
||||||
color = Color.White,
|
color = if (isFollowing) AppColors.mainText else AppColors.nonActiveText,
|
||||||
style = TextStyle(fontWeight = FontWeight.Bold)
|
style = TextStyle(fontWeight = FontWeight.Bold)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.focus.onFocusChanged
|
import androidx.compose.ui.focus.onFocusChanged
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.ColorFilter
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
|
import androidx.compose.ui.graphics.SolidColor
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
@@ -41,6 +42,7 @@ import androidx.compose.ui.text.input.VisualTransformation
|
|||||||
import androidx.compose.ui.text.style.TextIndent
|
import androidx.compose.ui.text.style.TextIndent
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
|
|
||||||
@@ -59,17 +61,17 @@ fun TextInputField(
|
|||||||
var isFocused by remember { mutableStateOf(false) }
|
var isFocused by remember { mutableStateOf(false) }
|
||||||
Column(modifier = modifier) {
|
Column(modifier = modifier) {
|
||||||
label?.let {
|
label?.let {
|
||||||
Text(it, color = Color(0xFFCCCCCC))
|
Text(it, color = AppColors.secondaryText)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
}
|
}
|
||||||
Box(
|
Box(
|
||||||
contentAlignment = Alignment.CenterStart,
|
contentAlignment = Alignment.CenterStart,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(24.dp))
|
.clip(RoundedCornerShape(24.dp))
|
||||||
.background(Color(0xFFF7f7f7))
|
.background(AppColors.inputBackground)
|
||||||
.border(
|
.border(
|
||||||
width = 2.dp,
|
width = 2.dp,
|
||||||
color = if (error == null) Color.Transparent else Color(0xFFE53935),
|
color = if (error == null) Color.Transparent else AppColors.error,
|
||||||
shape = RoundedCornerShape(24.dp)
|
shape = RoundedCornerShape(24.dp)
|
||||||
)
|
)
|
||||||
.padding(horizontal = 16.dp, vertical = 16.dp)
|
.padding(horizontal = 16.dp, vertical = 16.dp)
|
||||||
@@ -86,7 +88,7 @@ fun TextInputField(
|
|||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.W500,
|
fontWeight = FontWeight.W500,
|
||||||
color = Color(0xff333333)
|
color = AppColors.text
|
||||||
),
|
),
|
||||||
keyboardOptions = KeyboardOptions(
|
keyboardOptions = KeyboardOptions(
|
||||||
keyboardType = if (password) KeyboardType.Password else KeyboardType.Text
|
keyboardType = if (password) KeyboardType.Password else KeyboardType.Text
|
||||||
@@ -94,6 +96,7 @@ fun TextInputField(
|
|||||||
visualTransformation = if (showPassword) VisualTransformation.None else PasswordVisualTransformation(),
|
visualTransformation = if (showPassword) VisualTransformation.None else PasswordVisualTransformation(),
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
|
cursorBrush = SolidColor(AppColors.text),
|
||||||
)
|
)
|
||||||
if (password) {
|
if (password) {
|
||||||
Image(
|
Image(
|
||||||
@@ -104,14 +107,14 @@ fun TextInputField(
|
|||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
showPassword = !showPassword
|
showPassword = !showPassword
|
||||||
},
|
},
|
||||||
colorFilter = ColorFilter.tint(Color.Black)
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.isEmpty()) {
|
if (text.isEmpty()) {
|
||||||
hint?.let {
|
hint?.let {
|
||||||
Text(it, modifier = Modifier.padding(start = 5.dp), color = Color(0xffdadada), fontWeight = FontWeight.W600)
|
Text(it, modifier = Modifier.padding(start = 5.dp), color = AppColors.inputHint, fontWeight = FontWeight.W600)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,7 +138,7 @@ fun TextInputField(
|
|||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.size(4.dp))
|
Spacer(modifier = Modifier.size(4.dp))
|
||||||
AnimatedContent(targetState = error) { targetError ->
|
AnimatedContent(targetState = error) { targetError ->
|
||||||
Text(targetError ?: "", color = Color(0xFFE53935), fontSize = 12.sp)
|
Text(targetError ?: "", color = AppColors.text, fontSize = 12.sp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.tooling.preview.UiMode
|
import androidx.compose.ui.tooling.preview.UiMode
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.comment.NoticeScreenHeader
|
import com.aiosman.riderpro.ui.comment.NoticeScreenHeader
|
||||||
import com.aiosman.riderpro.ui.composables.StatusBarMaskLayout
|
import com.aiosman.riderpro.ui.composables.StatusBarMaskLayout
|
||||||
@@ -41,16 +42,15 @@ fun FollowerListScreen(userId: Int) {
|
|||||||
}
|
}
|
||||||
StatusBarMaskLayout(
|
StatusBarMaskLayout(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(color = Color(0xFFFFFFFF))
|
.background(color = AppColors.background)
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
maskBoxBackgroundColor = Color(0xFFFFFFFF)
|
maskBoxBackgroundColor = AppColors.background,
|
||||||
) {
|
) {
|
||||||
var dataFlow = model.usersFlow
|
var dataFlow = model.usersFlow
|
||||||
var users = dataFlow.collectAsLazyPagingItems()
|
var users = dataFlow.collectAsLazyPagingItems()
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(color = Color(0xFFFFFFFF))
|
|
||||||
.padding(vertical = 16.dp)
|
.padding(vertical = 16.dp)
|
||||||
) {
|
) {
|
||||||
NoticeScreenHeader(stringResource(R.string.followers_upper), moreIcon = false)
|
NoticeScreenHeader(stringResource(R.string.followers_upper), moreIcon = false)
|
||||||
@@ -59,12 +59,10 @@ fun FollowerListScreen(userId: Int) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.background(color = Color(0xFFFFFFFF))
|
|
||||||
.pullRefresh(refreshState)
|
.pullRefresh(refreshState)
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier.fillMaxSize()
|
||||||
.background(color = Color(0xFFFFFFFF))
|
|
||||||
) {
|
) {
|
||||||
items(users.itemCount) { index ->
|
items(users.itemCount) { index ->
|
||||||
users[index]?.let { user ->
|
users[index]?.let { user ->
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.comment.NoticeScreenHeader
|
import com.aiosman.riderpro.ui.comment.NoticeScreenHeader
|
||||||
import com.aiosman.riderpro.ui.composables.StatusBarMaskLayout
|
import com.aiosman.riderpro.ui.composables.StatusBarMaskLayout
|
||||||
@@ -37,9 +38,9 @@ fun FollowingListScreen(userId: Int) {
|
|||||||
}
|
}
|
||||||
StatusBarMaskLayout(
|
StatusBarMaskLayout(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(color = Color(0xFFFFFFFF))
|
.background(color = AppColors.background)
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
maskBoxBackgroundColor = Color(0xFFFFFFFF)
|
maskBoxBackgroundColor = AppColors.background
|
||||||
) {
|
) {
|
||||||
var dataFlow = model.usersFlow
|
var dataFlow = model.usersFlow
|
||||||
var users = dataFlow.collectAsLazyPagingItems()
|
var users = dataFlow.collectAsLazyPagingItems()
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import androidx.compose.ui.text.style.TextOverflow
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.NavigationRoute
|
import com.aiosman.riderpro.ui.NavigationRoute
|
||||||
@@ -110,18 +111,6 @@ fun NotificationsScreen() {
|
|||||||
}
|
}
|
||||||
navController.navigate(NavigationRoute.Followers.route)
|
navController.navigate(NavigationRoute.Followers.route)
|
||||||
}
|
}
|
||||||
// NotificationIndicator(
|
|
||||||
// MessageListViewModel.favouriteNoticeCount,
|
|
||||||
// R.drawable.rider_pro_favoriate,
|
|
||||||
// stringResource(R.string.favourites_upper)
|
|
||||||
// ) {
|
|
||||||
// if (MessageListViewModel.favouriteNoticeCount > 0) {
|
|
||||||
// // 刷新收藏消息列表
|
|
||||||
// FavouriteNoticeViewModel.isFirstLoad = true
|
|
||||||
// MessageListViewModel.clearFavouriteNoticeCount()
|
|
||||||
// }
|
|
||||||
// navController.navigate(NavigationRoute.FavouritesScreen.route)
|
|
||||||
// }
|
|
||||||
NotificationIndicator(
|
NotificationIndicator(
|
||||||
MessageListViewModel.commentNoticeCount,
|
MessageListViewModel.commentNoticeCount,
|
||||||
R.drawable.rider_pro_comment,
|
R.drawable.rider_pro_comment,
|
||||||
@@ -130,7 +119,7 @@ fun NotificationsScreen() {
|
|||||||
navController.navigate(NavigationRoute.CommentNoticeScreen.route)
|
navController.navigate(NavigationRoute.CommentNoticeScreen.route)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HorizontalDivider(color = Color(0xFFEbEbEb), modifier = Modifier.padding(16.dp))
|
HorizontalDivider(color = AppColors.divider, modifier = Modifier.padding(16.dp))
|
||||||
NotificationCounterItem(MessageListViewModel.unReadConversationCount.toInt())
|
NotificationCounterItem(MessageListViewModel.unReadConversationCount.toInt())
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -178,13 +167,13 @@ fun NotificationIndicator(
|
|||||||
if (notificationCount > 0) {
|
if (notificationCount > 0) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(Color(0xFFE53935), RoundedCornerShape(16.dp))
|
.background(AppColors.main, RoundedCornerShape(16.dp))
|
||||||
.padding(4.dp)
|
.padding(4.dp)
|
||||||
.align(Alignment.TopEnd)
|
.align(Alignment.TopEnd)
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = notificationCount.toString(),
|
text = notificationCount.toString(),
|
||||||
color = Color.White,
|
color = AppColors.mainText,
|
||||||
fontSize = 10.sp,
|
fontSize = 10.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
modifier = Modifier.align(Alignment.Center)
|
modifier = Modifier.align(Alignment.Center)
|
||||||
@@ -239,12 +228,12 @@ fun NotificationCounterItem(count: Int) {
|
|||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(Color(0xFFE53935), RoundedCornerShape(16.dp))
|
.background(AppColors.main, RoundedCornerShape(16.dp))
|
||||||
.padding(horizontal = 8.dp, vertical = 2.dp)
|
.padding(horizontal = 8.dp, vertical = 2.dp)
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = count.toString(),
|
text = count.toString(),
|
||||||
color = Color.White,
|
color = AppColors.mainText,
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
)
|
)
|
||||||
@@ -300,7 +289,7 @@ fun ChatMessageList(
|
|||||||
Text(
|
Text(
|
||||||
text = item.lastMessageTime,
|
text = item.lastMessageTime,
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = Color(0x66000000)
|
color = AppColors.secondaryText,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(6.dp))
|
Spacer(modifier = Modifier.height(6.dp))
|
||||||
@@ -309,7 +298,7 @@ fun ChatMessageList(
|
|||||||
text = "${if (item.isSelf) "Me: " else ""}${item.displayText}",
|
text = "${if (item.isSelf) "Me: " else ""}${item.displayText}",
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
color = Color(0x99000000),
|
color = AppColors.secondaryText,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
@@ -317,12 +306,12 @@ fun ChatMessageList(
|
|||||||
if (item.unreadCount > 0) {
|
if (item.unreadCount > 0) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(Color(0xFFE53935), CircleShape)
|
.background(AppColors.main, CircleShape)
|
||||||
.padding(horizontal = 8.dp, vertical = 2.dp)
|
.padding(horizontal = 8.dp, vertical = 2.dp)
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = item.unreadCount.toString(),
|
text = item.unreadCount.toString(),
|
||||||
color = Color.White,
|
color = AppColors.mainText,
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
modifier = Modifier.align(Alignment.Center)
|
modifier = Modifier.align(Alignment.Center)
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.AppState
|
import com.aiosman.riderpro.AppState
|
||||||
import com.aiosman.riderpro.AppStore
|
import com.aiosman.riderpro.AppStore
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
@@ -131,7 +132,7 @@ fun LoginPage() {
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color.White)
|
.background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -157,15 +158,21 @@ fun LoginPage() {
|
|||||||
Text(
|
Text(
|
||||||
"Connecting Riders",
|
"Connecting Riders",
|
||||||
fontSize = 28.sp,
|
fontSize = 28.sp,
|
||||||
fontWeight = FontWeight.W900
|
fontWeight = FontWeight.W900,
|
||||||
|
color = AppColors.text
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
"Worldwide",
|
||||||
|
fontSize = 28.sp,
|
||||||
|
fontWeight = FontWeight.W900,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Text("Worldwide", fontSize = 28.sp, fontWeight = FontWeight.W900)
|
|
||||||
Spacer(modifier = Modifier.height(32.dp))
|
Spacer(modifier = Modifier.height(32.dp))
|
||||||
ActionButton(
|
ActionButton(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
text = stringResource(R.string.sign_up_upper),
|
text = stringResource(R.string.sign_up_upper),
|
||||||
color = Color.White,
|
color = AppColors.mainText,
|
||||||
backgroundColor = Color(0xffda3832)
|
backgroundColor = AppColors.main
|
||||||
) {
|
) {
|
||||||
navController.navigate(
|
navController.navigate(
|
||||||
NavigationRoute.EmailSignUp.route,
|
NavigationRoute.EmailSignUp.route,
|
||||||
@@ -175,7 +182,7 @@ fun LoginPage() {
|
|||||||
ActionButton(
|
ActionButton(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
text = stringResource(R.string.sign_in_with_google),
|
text = stringResource(R.string.sign_in_with_google),
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
leading = {
|
leading = {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = R.drawable.rider_pro_google),
|
painter = painterResource(id = R.drawable.rider_pro_google),
|
||||||
@@ -197,7 +204,7 @@ fun LoginPage() {
|
|||||||
stringResource(R.string.login_upper),
|
stringResource(R.string.login_upper),
|
||||||
fontSize = 17.sp,
|
fontSize = 17.sp,
|
||||||
fontWeight = FontWeight.W900,
|
fontWeight = FontWeight.W900,
|
||||||
color = Color(0xff333333),
|
color = AppColors.text,
|
||||||
modifier = Modifier.noRippleClickable {
|
modifier = Modifier.noRippleClickable {
|
||||||
navController.navigate(
|
navController.navigate(
|
||||||
NavigationRoute.UserAuth.route,
|
NavigationRoute.UserAuth.route,
|
||||||
@@ -213,9 +220,36 @@ fun LoginPage() {
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MovingImageWall(resources: Resources) {
|
fun MovingImageWall(resources: Resources) {
|
||||||
val imageList1 = remember { mutableStateListOf(R.drawable.wall_1_1, R.drawable.wall_1_2, R.drawable.wall_1_3,R.drawable.wall_1_1, R.drawable.wall_1_2, R.drawable.wall_1_3) }
|
val imageList1 = remember {
|
||||||
val imageList2 = remember { mutableStateListOf(R.drawable.wall_2_1, R.drawable.wall_2_2, R.drawable.wall_2_3,R.drawable.wall_2_1, R.drawable.wall_2_2, R.drawable.wall_2_3) }
|
mutableStateListOf(
|
||||||
val imageList3 = remember { mutableStateListOf(R.drawable.wall_3_1, R.drawable.wall_3_2, R.drawable.wall_3_3,R.drawable.wall_3_1, R.drawable.wall_3_2, R.drawable.wall_3_3) }
|
R.drawable.wall_1_1,
|
||||||
|
R.drawable.wall_1_2,
|
||||||
|
R.drawable.wall_1_3,
|
||||||
|
R.drawable.wall_1_1,
|
||||||
|
R.drawable.wall_1_2,
|
||||||
|
R.drawable.wall_1_3
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val imageList2 = remember {
|
||||||
|
mutableStateListOf(
|
||||||
|
R.drawable.wall_2_1,
|
||||||
|
R.drawable.wall_2_2,
|
||||||
|
R.drawable.wall_2_3,
|
||||||
|
R.drawable.wall_2_1,
|
||||||
|
R.drawable.wall_2_2,
|
||||||
|
R.drawable.wall_2_3
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val imageList3 = remember {
|
||||||
|
mutableStateListOf(
|
||||||
|
R.drawable.wall_3_1,
|
||||||
|
R.drawable.wall_3_2,
|
||||||
|
R.drawable.wall_3_3,
|
||||||
|
R.drawable.wall_3_1,
|
||||||
|
R.drawable.wall_3_2,
|
||||||
|
R.drawable.wall_3_3
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
val density = resources.displayMetrics.density // 获取屏幕密度
|
val density = resources.displayMetrics.density // 获取屏幕密度
|
||||||
val imageHeight = 208.dp
|
val imageHeight = 208.dp
|
||||||
@@ -232,13 +266,23 @@ fun MovingImageWall(resources: Resources) {
|
|||||||
// 使用 LaunchedEffect 在每次 recomposition 时启动动画
|
// 使用 LaunchedEffect 在每次 recomposition 时启动动画
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
animateImageWall(imageList1, offset1, speed = 1f, resources = resources) { offset1 = it }
|
animateImageWall(imageList1, offset1, speed = 1f, resources = resources) {
|
||||||
|
offset1 = it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
animateImageWall(imageList2, offset2, speed = 1.5f, reverse = true, resources = resources) { offset2 = it }
|
animateImageWall(
|
||||||
|
imageList2,
|
||||||
|
offset2,
|
||||||
|
speed = 1.5f,
|
||||||
|
reverse = true,
|
||||||
|
resources = resources
|
||||||
|
) { offset2 = it }
|
||||||
}
|
}
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
animateImageWall(imageList3, offset3, speed = 2f, resources = resources) { offset3 = it }
|
animateImageWall(imageList3, offset3, speed = 2f, resources = resources) {
|
||||||
|
offset3 = it
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,35 +305,43 @@ fun MovingImageWall(resources: Resources) {
|
|||||||
// 消耗所有滚动事件,阻止用户滚动
|
// 消耗所有滚动事件,阻止用户滚动
|
||||||
delta
|
delta
|
||||||
}
|
}
|
||||||
Row (modifier = Modifier
|
Row(
|
||||||
.fillMaxWidth()){
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
) {
|
||||||
// 第1列
|
// 第1列
|
||||||
ImageColumn(imageList1, offset1,
|
ImageColumn(
|
||||||
|
imageList1, offset1,
|
||||||
Modifier
|
Modifier
|
||||||
.verticalScroll(scrollState1)
|
.verticalScroll(scrollState1)
|
||||||
.scrollable(
|
.scrollable(
|
||||||
state = scrollableState1,
|
state = scrollableState1,
|
||||||
orientation = Orientation.Vertical
|
orientation = Orientation.Vertical
|
||||||
)
|
)
|
||||||
.weight(1f))
|
.weight(1f)
|
||||||
|
)
|
||||||
// 第2列
|
// 第2列
|
||||||
ImageColumn(imageList2, offset2,
|
ImageColumn(
|
||||||
|
imageList2, offset2,
|
||||||
Modifier
|
Modifier
|
||||||
.verticalScroll(scrollState2)
|
.verticalScroll(scrollState2)
|
||||||
.scrollable(
|
.scrollable(
|
||||||
state = scrollableState2,
|
state = scrollableState2,
|
||||||
orientation = Orientation.Vertical
|
orientation = Orientation.Vertical
|
||||||
)
|
)
|
||||||
.weight(1f), reverse = true)
|
.weight(1f), reverse = true
|
||||||
|
)
|
||||||
// 第3列
|
// 第3列
|
||||||
ImageColumn(imageList3, offset3,
|
ImageColumn(
|
||||||
|
imageList3, offset3,
|
||||||
Modifier
|
Modifier
|
||||||
.verticalScroll(scrollState3)
|
.verticalScroll(scrollState3)
|
||||||
.scrollable(
|
.scrollable(
|
||||||
state = scrollableState3,
|
state = scrollableState3,
|
||||||
orientation = Orientation.Vertical
|
orientation = Orientation.Vertical
|
||||||
)
|
)
|
||||||
.weight(1f))
|
.weight(1f)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 白色叠加层
|
// 白色叠加层
|
||||||
@@ -297,7 +349,7 @@ fun MovingImageWall(resources: Resources) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.fillMaxHeight()
|
.fillMaxHeight()
|
||||||
.background(Color.White.copy(alpha = 0.3f)),
|
.background(AppColors.background.copy(alpha = 0.3f)),
|
||||||
contentAlignment = Alignment.BottomCenter
|
contentAlignment = Alignment.BottomCenter
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
@@ -308,7 +360,7 @@ fun MovingImageWall(resources: Resources) {
|
|||||||
Brush.verticalGradient(
|
Brush.verticalGradient(
|
||||||
colors = listOf(
|
colors = listOf(
|
||||||
Color.Transparent,
|
Color.Transparent,
|
||||||
Color.White
|
AppColors.background
|
||||||
),
|
),
|
||||||
startY = 0f,
|
startY = 0f,
|
||||||
endY = 500f
|
endY = 500f
|
||||||
@@ -345,7 +397,7 @@ fun ImageColumn(
|
|||||||
translationY = translation
|
translationY = translation
|
||||||
}
|
}
|
||||||
.clip(RoundedCornerShape(16.dp)),
|
.clip(RoundedCornerShape(16.dp)),
|
||||||
contentAlignment = Alignment.Center){
|
contentAlignment = Alignment.Center) {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = imageList[(currentImage + i) % imageCount]),
|
painter = painterResource(id = imageList[(currentImage + i) % imageCount]),
|
||||||
contentDescription = "背景图片",
|
contentDescription = "背景图片",
|
||||||
@@ -361,6 +413,7 @@ fun ImageColumn(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun animateImageWall(
|
suspend fun animateImageWall(
|
||||||
imageList: MutableList<Int>,
|
imageList: MutableList<Int>,
|
||||||
initialOffset: Float,
|
initialOffset: Float,
|
||||||
|
|||||||
@@ -161,7 +161,6 @@ fun SignupScreen() {
|
|||||||
.width(345.dp)
|
.width(345.dp)
|
||||||
.height(48.dp),
|
.height(48.dp),
|
||||||
text = stringResource(R.string.sign_in_with_email),
|
text = stringResource(R.string.sign_in_with_email),
|
||||||
backgroundImage = R.mipmap.rider_pro_signup_red_bg,
|
|
||||||
leading = {
|
leading = {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = R.mipmap.rider_pro_email),
|
painter = painterResource(id = R.mipmap.rider_pro_email),
|
||||||
@@ -204,7 +203,6 @@ fun SignupScreen() {
|
|||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
},
|
},
|
||||||
text = stringResource(R.string.sign_in_with_google),
|
text = stringResource(R.string.sign_in_with_google),
|
||||||
backgroundImage = R.mipmap.rider_pro_signup_white_bg
|
|
||||||
) {
|
) {
|
||||||
googleLogin()
|
googleLogin()
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import androidx.compose.ui.text.TextStyle
|
|||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.AppState
|
import com.aiosman.riderpro.AppState
|
||||||
import com.aiosman.riderpro.AppStore
|
import com.aiosman.riderpro.AppStore
|
||||||
import com.aiosman.riderpro.ErrorCode
|
import com.aiosman.riderpro.ErrorCode
|
||||||
@@ -120,22 +121,24 @@ fun UserAuthScreen() {
|
|||||||
}
|
}
|
||||||
} catch (e: ServiceException) {
|
} catch (e: ServiceException) {
|
||||||
// handle error
|
// handle error
|
||||||
if (e.code == 12005) {
|
when (e.code) {
|
||||||
emailError = context.getString(R.string.error_invalidate_username_password)
|
12005 -> {
|
||||||
passwordError = context.getString(R.string.error_invalidate_username_password)
|
emailError = context.getString(R.string.error_invalidate_username_password)
|
||||||
} else if (e.code == ErrorCode.InvalidateCaptcha.code) {
|
passwordError = context.getString(R.string.error_invalidate_username_password)
|
||||||
loadLoginCaptcha()
|
}
|
||||||
Toast.makeText(
|
ErrorCode.InvalidateCaptcha.code -> {
|
||||||
context,
|
loadLoginCaptcha()
|
||||||
context.getString(R.string.incorrect_captcha_please_try_again),
|
Toast.makeText(
|
||||||
Toast.LENGTH_SHORT
|
context,
|
||||||
).show()
|
context.getString(R.string.incorrect_captcha_please_try_again),
|
||||||
} else {
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
Toast.makeText(context, e.message, Toast.LENGTH_SHORT).show()
|
}
|
||||||
|
else -> {
|
||||||
|
Toast.makeText(context, e.message, Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|
||||||
Toast.makeText(context, e.message, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, e.message, Toast.LENGTH_SHORT).show()
|
||||||
} finally {
|
} finally {
|
||||||
captchaData = null
|
captchaData = null
|
||||||
@@ -206,7 +209,7 @@ fun UserAuthScreen() {
|
|||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color.White)
|
.background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
Box(
|
Box(
|
||||||
@@ -220,10 +223,12 @@ fun UserAuthScreen() {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
|
|
||||||
.padding(horizontal = 24.dp),
|
.padding(horizontal = 24.dp),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
|
||||||
) {
|
) {
|
||||||
Spacer(modifier = Modifier.padding(48.dp))
|
StatusBarSpacer()
|
||||||
TextInputField(
|
TextInputField(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth(),
|
.fillMaxWidth(),
|
||||||
@@ -263,7 +268,8 @@ fun UserAuthScreen() {
|
|||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
fontWeight = FontWeight.W500
|
fontWeight = FontWeight.W500
|
||||||
)
|
),
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
Text(
|
Text(
|
||||||
@@ -274,7 +280,8 @@ fun UserAuthScreen() {
|
|||||||
},
|
},
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
fontWeight = FontWeight.W500
|
fontWeight = FontWeight.W500
|
||||||
)
|
),
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -282,18 +289,18 @@ fun UserAuthScreen() {
|
|||||||
ActionButton(
|
ActionButton(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
text = stringResource(R.string.lets_ride_upper),
|
text = stringResource(R.string.lets_ride_upper),
|
||||||
backgroundColor = Color(0xffda3832),
|
backgroundColor = AppColors.main,
|
||||||
color = Color.White
|
color = AppColors.mainText,
|
||||||
) {
|
) {
|
||||||
onLogin()
|
onLogin()
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
Text(stringResource(R.string.or_login_with), color = Color(0xFF999999))
|
Text(stringResource(R.string.or_login_with), color = AppColors.secondaryText)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
ActionButton(
|
ActionButton(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
text = stringResource(R.string.sign_in_with_google),
|
text = stringResource(R.string.sign_in_with_google),
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
leading = {
|
leading = {
|
||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = R.drawable.rider_pro_google),
|
painter = painterResource(id = R.drawable.rider_pro_google),
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
|
|||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.PaddingValues
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
@@ -84,6 +85,7 @@ import com.aiosman.riderpro.exp.formatPostTime
|
|||||||
import com.aiosman.riderpro.exp.timeAgo
|
import com.aiosman.riderpro.exp.timeAgo
|
||||||
import com.aiosman.riderpro.ui.NavigationRoute
|
import com.aiosman.riderpro.ui.NavigationRoute
|
||||||
import com.aiosman.riderpro.ui.comment.NoticeScreenHeader
|
import com.aiosman.riderpro.ui.comment.NoticeScreenHeader
|
||||||
|
import com.aiosman.riderpro.ui.composables.ActionButton
|
||||||
import com.aiosman.riderpro.ui.composables.AnimatedFavouriteIcon
|
import com.aiosman.riderpro.ui.composables.AnimatedFavouriteIcon
|
||||||
import com.aiosman.riderpro.ui.composables.AnimatedLikeIcon
|
import com.aiosman.riderpro.ui.composables.AnimatedLikeIcon
|
||||||
import com.aiosman.riderpro.ui.composables.BottomNavigationPlaceholder
|
import com.aiosman.riderpro.ui.composables.BottomNavigationPlaceholder
|
||||||
@@ -687,19 +689,20 @@ fun Header(
|
|||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
Text(text = nickname ?: "", fontWeight = FontWeight.Bold)
|
Text(
|
||||||
// if (AppState.UserId != userId) {
|
text = nickname ?: "",
|
||||||
// FollowButton(
|
fontWeight = FontWeight.Bold,
|
||||||
// isFollowing = isFollowing,
|
modifier = Modifier.weight(1f)
|
||||||
// onFollowClick = onFollowClick,
|
)
|
||||||
// imageModifier = Modifier
|
if (AppState.UserId != userId) {
|
||||||
// .height(18.dp)
|
FollowButton(
|
||||||
// .width(80.dp),
|
isFollowing = isFollowing,
|
||||||
// fontSize = 12.sp
|
onFollowClick = onFollowClick,
|
||||||
// )
|
fontSize = 12.sp
|
||||||
// }
|
)
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
}
|
||||||
if (AppState.UserId == userId) {
|
if (AppState.UserId == userId) {
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
|
||||||
Box {
|
Box {
|
||||||
Image(
|
Image(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
Reference in New Issue
Block a user