提取应用颜色
This commit is contained in:
@@ -33,7 +33,7 @@ import kotlin.coroutines.suspendCoroutine
|
|||||||
object AppState {
|
object AppState {
|
||||||
var UserId: Int? = null
|
var UserId: Int? = null
|
||||||
var profile :AccountProfileEntity? = null
|
var profile :AccountProfileEntity? = null
|
||||||
|
var darkMode = false
|
||||||
suspend fun initWithAccount(scope: CoroutineScope, context: Context) {
|
suspend fun initWithAccount(scope: CoroutineScope, context: Context) {
|
||||||
val accountService: AccountService = AccountServiceImpl()
|
val accountService: AccountService = AccountServiceImpl()
|
||||||
// 获取用户认证信息
|
// 获取用户认证信息
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.aiosman.riderpro
|
|||||||
|
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
|
||||||
var AppColors = LightThemeColors()
|
//var AppColors = LightThemeColors()
|
||||||
//var AppColors = DarkThemeColors()
|
var AppColors = if (AppState.darkMode) DarkThemeColors() else LightThemeColors()
|
||||||
|
|
||||||
open class AppThemeData(
|
open class AppThemeData(
|
||||||
var main: Color,
|
var main: Color,
|
||||||
@@ -17,13 +17,15 @@ open class AppThemeData(
|
|||||||
var loadingText: Color,
|
var loadingText: Color,
|
||||||
var disabledBackground: Color,
|
var disabledBackground: Color,
|
||||||
var background: Color,
|
var background: Color,
|
||||||
|
var decentBackground: Color,
|
||||||
var divider: Color,
|
var divider: Color,
|
||||||
var inputBackground: Color,
|
var inputBackground: Color,
|
||||||
var inputHint: Color,
|
var inputHint: Color,
|
||||||
var error : Color,
|
var error: Color,
|
||||||
var checkedBackground: Color,
|
var checkedBackground: Color,
|
||||||
var checkedText: Color,
|
var checkedText: Color,
|
||||||
)
|
var chatActionColor: Color,
|
||||||
|
)
|
||||||
|
|
||||||
class LightThemeColors : AppThemeData(
|
class LightThemeColors : AppThemeData(
|
||||||
main = Color(0xffda3832),
|
main = Color(0xffda3832),
|
||||||
@@ -43,6 +45,9 @@ class LightThemeColors : AppThemeData(
|
|||||||
error = Color(0xffFF0000),
|
error = Color(0xffFF0000),
|
||||||
checkedBackground = Color(0xff000000),
|
checkedBackground = Color(0xff000000),
|
||||||
checkedText = Color(0xffFFFFFF),
|
checkedText = Color(0xffFFFFFF),
|
||||||
|
decentBackground = Color(0xfff5f5f5),
|
||||||
|
chatActionColor = Color(0xffe0e0e0)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
class DarkThemeColors : AppThemeData(
|
class DarkThemeColors : AppThemeData(
|
||||||
@@ -63,4 +68,6 @@ class DarkThemeColors : AppThemeData(
|
|||||||
error = Color(0xffFF0000),
|
error = Color(0xffFF0000),
|
||||||
checkedBackground = Color(0xffffffff),
|
checkedBackground = Color(0xffffffff),
|
||||||
checkedText = Color(0xff000000),
|
checkedText = Color(0xff000000),
|
||||||
|
decentBackground = Color(0xFF171717),
|
||||||
|
chatActionColor = Color(0xFF3D3D3D)
|
||||||
)
|
)
|
||||||
@@ -4,7 +4,7 @@ import android.content.Context
|
|||||||
|
|
||||||
object ConstVars {
|
object ConstVars {
|
||||||
// api 地址
|
// api 地址
|
||||||
// const val BASE_SERVER = "http://192.168.31.130:8088"
|
// const val BASE_SERVER = "http://192.168.31.131:8088"
|
||||||
// const val BASE_SERVER = "http://192.168.142.140:8088"
|
// const val BASE_SERVER = "http://192.168.142.140:8088"
|
||||||
// const val BASE_SERVER = "https://8.137.22.101:8088"
|
// const val BASE_SERVER = "https://8.137.22.101:8088"
|
||||||
const val BASE_SERVER = "https://rider-pro.aiosman.com/beta_api"
|
const val BASE_SERVER = "https://rider-pro.aiosman.com/beta_api"
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import androidx.activity.result.contract.ActivityResultContracts
|
|||||||
import androidx.compose.animation.AnimatedContentScope
|
import androidx.compose.animation.AnimatedContentScope
|
||||||
import androidx.compose.animation.ExperimentalSharedTransitionApi
|
import androidx.compose.animation.ExperimentalSharedTransitionApi
|
||||||
import androidx.compose.animation.SharedTransitionScope
|
import androidx.compose.animation.SharedTransitionScope
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.compositionLocalOf
|
import androidx.compose.runtime.compositionLocalOf
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
import androidx.lifecycle.ProcessLifecycleOwner
|
import androidx.lifecycle.ProcessLifecycleOwner
|
||||||
@@ -32,6 +34,7 @@ import com.aiosman.riderpro.ui.Navigation
|
|||||||
import com.aiosman.riderpro.ui.NavigationRoute
|
import com.aiosman.riderpro.ui.NavigationRoute
|
||||||
import com.aiosman.riderpro.ui.navigateToPost
|
import com.aiosman.riderpro.ui.navigateToPost
|
||||||
import com.aiosman.riderpro.ui.post.NewPostViewModel
|
import com.aiosman.riderpro.ui.post.NewPostViewModel
|
||||||
|
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||||
import com.google.firebase.analytics.FirebaseAnalytics
|
import com.google.firebase.analytics.FirebaseAnalytics
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
@@ -91,6 +94,9 @@ class MainActivity : ComponentActivity() {
|
|||||||
|
|
||||||
JPushInterface.init(this)
|
JPushInterface.init(this)
|
||||||
|
|
||||||
|
if (AppState.darkMode) {
|
||||||
|
window.decorView.setBackgroundColor(android.graphics.Color.BLACK)
|
||||||
|
}
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
|
|
||||||
// 初始化腾讯云通信 SDK
|
// 初始化腾讯云通信 SDK
|
||||||
@@ -107,6 +113,7 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
|
|
||||||
Navigation(startDestination) { navController ->
|
Navigation(startDestination) { navController ->
|
||||||
// 处理带有 postId 的通知点击
|
// 处理带有 postId 的通知点击
|
||||||
val postId = intent.getStringExtra("POST_ID")
|
val postId = intent.getStringExtra("POST_ID")
|
||||||
|
|||||||
@@ -23,6 +23,15 @@ object AppStore {
|
|||||||
.requestEmail()
|
.requestEmail()
|
||||||
.build()
|
.build()
|
||||||
googleSignInOptions = gso
|
googleSignInOptions = gso
|
||||||
|
// apply dark mode
|
||||||
|
if (sharedPreferences.getBoolean("darkMode", false)) {
|
||||||
|
AppState.darkMode = true
|
||||||
|
}
|
||||||
|
AppColors = if (AppState.darkMode) {
|
||||||
|
DarkThemeColors()
|
||||||
|
}else{
|
||||||
|
LightThemeColors()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun saveData() {
|
suspend fun saveData() {
|
||||||
@@ -38,4 +47,12 @@ object AppStore {
|
|||||||
token = sharedPreferences.getString("token", null)
|
token = sharedPreferences.getString("token", null)
|
||||||
rememberMe = sharedPreferences.getBoolean("rememberMe", false)
|
rememberMe = sharedPreferences.getBoolean("rememberMe", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun saveDarkMode(darkMode: Boolean) {
|
||||||
|
sharedPreferences.edit().apply {
|
||||||
|
putBoolean("darkMode", darkMode)
|
||||||
|
}.apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@ 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.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
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.data.AccountService
|
import com.aiosman.riderpro.data.AccountService
|
||||||
@@ -75,7 +76,7 @@ fun ChangePasswordScreen() {
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color.White),
|
.background(AppColors.background),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ fun AccountEditScreen2() {
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color.White),
|
.background(color = AppColors.background),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
horizontalAlignment = Alignment.CenterHorizontally
|
||||||
) {
|
) {
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import androidx.compose.animation.core.animateDpAsState
|
|||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
|
||||||
import androidx.compose.foundation.gestures.awaitFirstDown
|
import androidx.compose.foundation.gestures.awaitFirstDown
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@@ -54,6 +53,8 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
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.SolidColor
|
||||||
import androidx.compose.ui.input.pointer.pointerInput
|
import androidx.compose.ui.input.pointer.pointerInput
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
@@ -70,6 +71,7 @@ import androidx.lifecycle.ViewModel
|
|||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
|
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.entity.ChatItem
|
import com.aiosman.riderpro.entity.ChatItem
|
||||||
@@ -80,7 +82,6 @@ import com.aiosman.riderpro.ui.composables.MenuItem
|
|||||||
import com.aiosman.riderpro.ui.composables.StatusBarSpacer
|
import com.aiosman.riderpro.ui.composables.StatusBarSpacer
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
import com.tencent.imsdk.v2.V2TIMMessage
|
import com.tencent.imsdk.v2.V2TIMMessage
|
||||||
import kotlinx.coroutines.flow.collectLatest
|
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
|
|
||||||
@@ -159,7 +160,7 @@ fun ChatScreen(userId: String) {
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(Color.White)
|
.background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
Row(
|
Row(
|
||||||
@@ -176,14 +177,16 @@ fun ChatScreen(userId: String) {
|
|||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
navController.popBackStack()
|
navController.popBackStack()
|
||||||
},
|
},
|
||||||
contentDescription = null
|
contentDescription = null,
|
||||||
|
colorFilter = ColorFilter.tint(
|
||||||
|
AppColors.text)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(16.dp))
|
Spacer(modifier = Modifier.width(16.dp))
|
||||||
Text(
|
Text(
|
||||||
text = viewModel.userProfile?.nickName ?: "",
|
text = viewModel.userProfile?.nickName ?: "",
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
fontWeight = androidx.compose.ui.text.font.FontWeight.Bold
|
fontWeight = androidx.compose.ui.text.font.FontWeight.Bold
|
||||||
)
|
)
|
||||||
@@ -197,7 +200,9 @@ fun ChatScreen(userId: String) {
|
|||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
isMenuExpanded = true
|
isMenuExpanded = true
|
||||||
},
|
},
|
||||||
contentDescription = null
|
contentDescription = null,
|
||||||
|
colorFilter = ColorFilter.tint(
|
||||||
|
AppColors.text)
|
||||||
)
|
)
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = isMenuExpanded,
|
expanded = isMenuExpanded,
|
||||||
@@ -236,7 +241,8 @@ fun ChatScreen(userId: String) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(1.dp)
|
.height(1.dp)
|
||||||
.background(Color(0xfff7f7f7))
|
.background(
|
||||||
|
AppColors.decentBackground)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
ChatInput(
|
ChatInput(
|
||||||
@@ -254,7 +260,7 @@ fun ChatScreen(userId: String) {
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color(0xfff7f7f7))
|
.background(AppColors.decentBackground)
|
||||||
.padding(paddingValues)
|
.padding(paddingValues)
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
@@ -273,7 +279,7 @@ fun ChatScreen(userId: String) {
|
|||||||
Text(
|
Text(
|
||||||
text = calendar.time.formatChatTime(context), // Format the timestamp
|
text = calendar.time.formatChatTime(context), // Format the timestamp
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = Color.Gray,
|
color = AppColors.secondaryText,
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
textAlign = TextAlign.Center
|
textAlign = TextAlign.Center
|
||||||
),
|
),
|
||||||
@@ -298,7 +304,7 @@ fun ChatScreen(userId: String) {
|
|||||||
.padding(bottom = 16.dp, end = 16.dp)
|
.padding(bottom = 16.dp, end = 16.dp)
|
||||||
.shadow(4.dp, shape = RoundedCornerShape(16.dp))
|
.shadow(4.dp, shape = RoundedCornerShape(16.dp))
|
||||||
.clip(RoundedCornerShape(16.dp))
|
.clip(RoundedCornerShape(16.dp))
|
||||||
.background(Color.White)
|
.background(AppColors.background)
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
@@ -310,7 +316,7 @@ fun ChatScreen(userId: String) {
|
|||||||
Text(
|
Text(
|
||||||
text = "${goToNewCount} New Message",
|
text = "${goToNewCount} New Message",
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@@ -430,7 +436,7 @@ fun ChatOtherItem(item: ChatItem) {
|
|||||||
max = (if (item.messageType == V2TIMMessage.V2TIM_ELEM_TYPE_TEXT) 250.dp else 150.dp)
|
max = (if (item.messageType == V2TIMMessage.V2TIM_ELEM_TYPE_TEXT) 250.dp else 150.dp)
|
||||||
)
|
)
|
||||||
.clip(RoundedCornerShape(8.dp))
|
.clip(RoundedCornerShape(8.dp))
|
||||||
.background(Color(0xffFFFFFF))
|
.background(AppColors.background)
|
||||||
.padding(
|
.padding(
|
||||||
vertical = (if (item.messageType == V2TIMMessage.V2TIM_ELEM_TYPE_TEXT) 8.dp else 0.dp),
|
vertical = (if (item.messageType == V2TIMMessage.V2TIM_ELEM_TYPE_TEXT) 8.dp else 0.dp),
|
||||||
horizontal = (if (item.messageType == V2TIMMessage.V2TIM_ELEM_TYPE_TEXT) 16.dp else 0.dp)
|
horizontal = (if (item.messageType == V2TIMMessage.V2TIM_ELEM_TYPE_TEXT) 16.dp else 0.dp)
|
||||||
@@ -442,7 +448,7 @@ fun ChatOtherItem(item: ChatItem) {
|
|||||||
Text(
|
Text(
|
||||||
text = item.message,
|
text = item.message,
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
),
|
),
|
||||||
textAlign = TextAlign.Start
|
textAlign = TextAlign.Start
|
||||||
@@ -461,7 +467,7 @@ fun ChatOtherItem(item: ChatItem) {
|
|||||||
Text(
|
Text(
|
||||||
text = "Unsupported message type",
|
text = "Unsupported message type",
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = Color.White,
|
color = AppColors.text,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -539,9 +545,9 @@ fun ChatInput(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.clip(RoundedCornerShape(16.dp))
|
.clip(RoundedCornerShape(16.dp))
|
||||||
.background(Color(0xffe5e5e5))
|
.background(AppColors.background)
|
||||||
.padding(horizontal = 16.dp),
|
.padding(horizontal = 16.dp),
|
||||||
contentAlignment = androidx.compose.ui.Alignment.CenterStart,
|
contentAlignment = Alignment.CenterStart,
|
||||||
) {
|
) {
|
||||||
BasicTextField(
|
BasicTextField(
|
||||||
value = text,
|
value = text,
|
||||||
@@ -549,9 +555,10 @@ fun ChatInput(
|
|||||||
text = it
|
text = it
|
||||||
},
|
},
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp
|
||||||
),
|
),
|
||||||
|
cursorBrush = SolidColor(AppColors.text),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(vertical = 8.dp)
|
.padding(vertical = 8.dp)
|
||||||
@@ -590,7 +597,7 @@ fun ChatInput(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
tint = Color(0xffe0e0e0)
|
tint = AppColors.chatActionColor
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
Crossfade(
|
Crossfade(
|
||||||
@@ -608,7 +615,7 @@ fun ChatInput(
|
|||||||
text = ""
|
text = ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tint = if (isNotEmpty) Color.Red else Color(0xffe0e0e0)
|
tint = if (isNotEmpty) AppColors.main else AppColors.chatActionColor
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import androidx.paging.LoadState
|
import androidx.paging.LoadState
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
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.entity.CommentEntity
|
import com.aiosman.riderpro.entity.CommentEntity
|
||||||
@@ -63,7 +64,7 @@ fun CommentNoticeScreen() {
|
|||||||
var comments = dataFlow.collectAsLazyPagingItems()
|
var comments = dataFlow.collectAsLazyPagingItems()
|
||||||
val navController = LocalNavController.current
|
val navController = LocalNavController.current
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxSize().background(color = Color(0xFFFFFFFF))
|
modifier = Modifier.fillMaxSize().background(color = AppColors.background)
|
||||||
) {
|
) {
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
Box(
|
Box(
|
||||||
@@ -109,7 +110,7 @@ fun CommentNoticeScreen() {
|
|||||||
) {
|
) {
|
||||||
LinearProgressIndicator(
|
LinearProgressIndicator(
|
||||||
modifier = Modifier.width(160.dp),
|
modifier = Modifier.width(160.dp),
|
||||||
color = Color(0xFFDA3832)
|
color = AppColors.main
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,6 +129,7 @@ fun CommentNoticeScreen() {
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = "Load comment error, click to retry",
|
text = "Load comment error, click to retry",
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,7 +185,8 @@ fun CommentNoticeItem(
|
|||||||
Text(
|
Text(
|
||||||
text = commentItem.name,
|
text = commentItem.name,
|
||||||
fontSize = 18.sp,
|
fontSize = 18.sp,
|
||||||
modifier = Modifier
|
modifier = Modifier,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
Row {
|
Row {
|
||||||
@@ -195,7 +198,7 @@ fun CommentNoticeItem(
|
|||||||
text = text,
|
text = text,
|
||||||
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
|
||||||
)
|
)
|
||||||
@@ -203,7 +206,7 @@ fun CommentNoticeItem(
|
|||||||
Text(
|
Text(
|
||||||
text = commentItem.date.timeAgo(context),
|
text = commentItem.date.timeAgo(context),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = Color(0x66000000)
|
color = AppColors.secondaryText,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +231,7 @@ fun CommentNoticeItem(
|
|||||||
if (commentItem.unread) {
|
if (commentItem.unread) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(Color(0xFFE53935), CircleShape)
|
.background(AppColors.main, CircleShape)
|
||||||
.size(12.dp)
|
.size(12.dp)
|
||||||
.align(Alignment.TopEnd)
|
.align(Alignment.TopEnd)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import androidx.compose.material3.Text
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
|
|
||||||
@OptIn(ExperimentalAnimationApi::class)
|
@OptIn(ExperimentalAnimationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
@@ -36,6 +37,6 @@ fun AnimatedCounter(count: Int, modifier: Modifier = Modifier, fontSize: Int = 2
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
) { targetCount ->
|
) { targetCount ->
|
||||||
Text(text = "$targetCount", modifier = modifier, fontSize = fontSize.sp)
|
Text(text = "$targetCount", modifier = modifier, fontSize = fontSize.sp, color = AppColors.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@ import androidx.compose.ui.graphics.Color
|
|||||||
import androidx.compose.ui.graphics.ColorFilter
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
|
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
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -65,6 +66,7 @@ fun AnimatedFavouriteIcon(
|
|||||||
modifier = modifier.graphicsLayer {
|
modifier = modifier.graphicsLayer {
|
||||||
rotationZ = animatableRotation.value
|
rotationZ = animatableRotation.value
|
||||||
},
|
},
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,8 +15,10 @@ 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.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
|
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
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -65,6 +67,7 @@ fun AnimatedLikeIcon(
|
|||||||
modifier = modifier.graphicsLayer {
|
modifier = modifier.graphicsLayer {
|
||||||
rotationZ = animatableRotation.value
|
rotationZ = animatableRotation.value
|
||||||
},
|
},
|
||||||
|
colorFilter = if (!liked) ColorFilter.tint(AppColors.text) else null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ import androidx.compose.ui.res.stringResource
|
|||||||
import androidx.compose.ui.text.font.FontVariation.width
|
import androidx.compose.ui.text.font.FontVariation.width
|
||||||
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 com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.NavigationRoute
|
import com.aiosman.riderpro.ui.NavigationRoute
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
@@ -53,7 +54,7 @@ fun DropdownMenu(
|
|||||||
.let {
|
.let {
|
||||||
if (width != null) it.width(width.dp) else it
|
if (width != null) it.width(width.dp) else it
|
||||||
}
|
}
|
||||||
.background(Color.White)
|
.background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
for (item in menuItems) {
|
for (item in menuItems) {
|
||||||
Box(
|
Box(
|
||||||
@@ -67,7 +68,8 @@ fun DropdownMenu(
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
item.title,
|
item.title,
|
||||||
fontWeight = FontWeight.W500
|
fontWeight = FontWeight.W500,
|
||||||
|
color = AppColors.text,
|
||||||
)
|
)
|
||||||
if (width != null) {
|
if (width != null) {
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
@@ -78,7 +80,8 @@ fun DropdownMenu(
|
|||||||
Icon(
|
Icon(
|
||||||
painter = painterResource(id = item.icon),
|
painter = painterResource(id = item.icon),
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp),
|
||||||
|
tint = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.SolidColor
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.text.TextStyle
|
import androidx.compose.ui.text.TextStyle
|
||||||
@@ -43,6 +44,7 @@ import androidx.compose.ui.text.font.FontWeight
|
|||||||
import androidx.compose.ui.text.style.TextOverflow
|
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 com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.entity.CommentEntity
|
import com.aiosman.riderpro.entity.CommentEntity
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
@@ -64,7 +66,7 @@ fun EditCommentBottomModal(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(Color(0xfff7f7f7))
|
.background(AppColors.background)
|
||||||
.padding(horizontal = 16.dp, vertical = 16.dp)
|
.padding(horizontal = 16.dp, vertical = 16.dp)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
@@ -76,9 +78,11 @@ fun EditCommentBottomModal(
|
|||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
modifier = Modifier.weight(1f),
|
modifier = Modifier.weight(1f),
|
||||||
fontSize = 20.sp,
|
fontSize = 20.sp,
|
||||||
fontStyle = FontStyle.Italic
|
fontStyle = FontStyle.Italic,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Crossfade(targetState = text.isNotEmpty(), animationSpec = tween(500),
|
Crossfade(
|
||||||
|
targetState = text.isNotEmpty(), animationSpec = tween(500),
|
||||||
label = ""
|
label = ""
|
||||||
) { isNotEmpty ->
|
) { isNotEmpty ->
|
||||||
Icon(
|
Icon(
|
||||||
@@ -87,13 +91,13 @@ fun EditCommentBottomModal(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(32.dp)
|
.size(32.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
if (text.isNotEmpty()){
|
if (text.isNotEmpty()) {
|
||||||
onSend(text)
|
onSend(text)
|
||||||
text = ""
|
text = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
tint = if (isNotEmpty) Color.Red else Color(0xffe0e0e0)
|
tint = if (isNotEmpty) AppColors.main else AppColors.nonActive
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,7 +119,12 @@ fun EditCommentBottomModal(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
Text(replyComment.name, fontWeight = FontWeight.Bold, fontSize = 16.sp)
|
Text(
|
||||||
|
replyComment.name,
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
fontSize = 16.sp,
|
||||||
|
color = AppColors.text
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
Text(
|
Text(
|
||||||
@@ -124,7 +133,8 @@ fun EditCommentBottomModal(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(start = 32.dp),
|
.padding(start = 32.dp),
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
}
|
}
|
||||||
@@ -138,7 +148,7 @@ fun EditCommentBottomModal(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.clip(RoundedCornerShape(20.dp))
|
.clip(RoundedCornerShape(20.dp))
|
||||||
.background(Color(0xffe5e5e5))
|
.background(AppColors.inputBackground)
|
||||||
.padding(horizontal = 16.dp, vertical = 16.dp)
|
.padding(horizontal = 16.dp, vertical = 16.dp)
|
||||||
) {
|
) {
|
||||||
BasicTextField(
|
BasicTextField(
|
||||||
@@ -146,11 +156,12 @@ fun EditCommentBottomModal(
|
|||||||
onValueChange = {
|
onValueChange = {
|
||||||
text = it
|
text = it
|
||||||
},
|
},
|
||||||
|
cursorBrush = SolidColor(AppColors.text),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
fontWeight = FontWeight.Normal
|
fontWeight = FontWeight.Normal
|
||||||
),
|
),
|
||||||
minLines = 5
|
minLines = 5
|
||||||
|
|||||||
@@ -24,11 +24,13 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
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.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
|
||||||
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
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -46,10 +48,10 @@ fun FormTextInput(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(16.dp))
|
.clip(RoundedCornerShape(16.dp))
|
||||||
.background(Color(0xfff8f8f8))
|
.background(AppColors.inputBackground)
|
||||||
.let {
|
.let {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
it.border(1.dp, Color(0xFFE53935), RoundedCornerShape(24.dp))
|
it.border(1.dp, AppColors.error, RoundedCornerShape(24.dp))
|
||||||
} else {
|
} else {
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
@@ -65,7 +67,7 @@ fun FormTextInput(
|
|||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
color = Color(0xFF333333)
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -80,7 +82,7 @@ fun FormTextInput(
|
|||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.Normal,
|
fontWeight = FontWeight.Normal,
|
||||||
color = Color(0xFFCCCCCC)
|
color = AppColors.inputHint
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -94,8 +96,10 @@ fun FormTextInput(
|
|||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.Normal
|
fontWeight = FontWeight.Normal,
|
||||||
|
color = AppColors.text
|
||||||
),
|
),
|
||||||
|
cursorBrush = SolidColor(AppColors.text),
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -123,7 +127,7 @@ fun FormTextInput(
|
|||||||
)
|
)
|
||||||
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.error, fontSize = 12.sp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.aiosman.riderpro.ui.favourite
|
package com.aiosman.riderpro.ui.favourite
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
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.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.aspectRatio
|
import androidx.compose.foundation.layout.aspectRatio
|
||||||
@@ -25,6 +26,7 @@ import androidx.compose.ui.res.painterResource
|
|||||||
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.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
|
||||||
@@ -50,7 +52,7 @@ fun FavouriteListPage() {
|
|||||||
refreshPager()
|
refreshPager()
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier.fillMaxSize().background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
Box(
|
Box(
|
||||||
@@ -71,7 +73,7 @@ fun FavouriteListPage() {
|
|||||||
}
|
}
|
||||||
LazyVerticalGrid(
|
LazyVerticalGrid(
|
||||||
columns = GridCells.Fixed(3),
|
columns = GridCells.Fixed(3),
|
||||||
modifier = Modifier.fillMaxSize()
|
modifier = Modifier.fillMaxSize().padding(horizontal = 16.dp)
|
||||||
) {
|
) {
|
||||||
items(moments.itemCount) { idx ->
|
items(moments.itemCount) { idx ->
|
||||||
val momentItem = moments[idx] ?: return@items
|
val momentItem = moments[idx] ?: return@items
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ 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.AppState
|
||||||
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
|
||||||
@@ -34,7 +36,7 @@ fun FavouriteNoticeScreen() {
|
|||||||
model.updateNotice()
|
model.updateNotice()
|
||||||
}
|
}
|
||||||
StatusBarMaskLayout(
|
StatusBarMaskLayout(
|
||||||
darkIcons = true,
|
darkIcons = !AppState.darkMode,
|
||||||
maskBoxBackgroundColor = Color(0xFFFFFFFF)
|
maskBoxBackgroundColor = Color(0xFFFFFFFF)
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ 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 androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.AppState
|
import com.aiosman.riderpro.AppState
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
@@ -46,9 +47,9 @@ import kotlinx.coroutines.launch
|
|||||||
fun FollowerNoticeScreen() {
|
fun FollowerNoticeScreen() {
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
StatusBarMaskLayout(
|
StatusBarMaskLayout(
|
||||||
modifier = Modifier.background(color = Color(0xFFFFFFFF)).padding(horizontal = 16.dp),
|
modifier = Modifier.background(color = AppColors.background).padding(horizontal = 16.dp),
|
||||||
darkIcons = true,
|
darkIcons = !AppState.darkMode,
|
||||||
maskBoxBackgroundColor = Color(0xFFFFFFFF)
|
maskBoxBackgroundColor = AppColors.background
|
||||||
) {
|
) {
|
||||||
val model = FollowerNoticeViewModel
|
val model = FollowerNoticeViewModel
|
||||||
var dataFlow = model.followerItemsFlow
|
var dataFlow = model.followerItemsFlow
|
||||||
@@ -57,7 +58,7 @@ fun FollowerNoticeScreen() {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(vertical = 16.dp)
|
.padding(vertical = 16.dp)
|
||||||
.background(color = Color(0xFFFFFFFF))
|
.background(color = AppColors.background)
|
||||||
) {
|
) {
|
||||||
NoticeScreenHeader(stringResource(R.string.followers_upper), moreIcon = false)
|
NoticeScreenHeader(stringResource(R.string.followers_upper), moreIcon = false)
|
||||||
}
|
}
|
||||||
@@ -67,7 +68,7 @@ fun FollowerNoticeScreen() {
|
|||||||
}
|
}
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
.background(color = Color(0xFFFFFFFF))
|
.background(color = AppColors.background)
|
||||||
) {
|
) {
|
||||||
items(followers.itemCount) { index ->
|
items(followers.itemCount) { index ->
|
||||||
followers[index]?.let { follower ->
|
followers[index]?.let { follower ->
|
||||||
@@ -125,7 +126,7 @@ fun FollowItem(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
) {
|
) {
|
||||||
Text(nickname, fontWeight = FontWeight.Bold, fontSize = 16.sp)
|
Text(nickname, fontWeight = FontWeight.Bold, fontSize = 16.sp, color = AppColors.text)
|
||||||
}
|
}
|
||||||
// if (userId != AppState.UserId) {
|
// if (userId != AppState.UserId) {
|
||||||
// FollowButton(
|
// FollowButton(
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.platform.LocalDensity
|
import androidx.compose.ui.platform.LocalDensity
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
|
import com.aiosman.riderpro.AppState
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.ui.NavigationRoute
|
import com.aiosman.riderpro.ui.NavigationRoute
|
||||||
import com.aiosman.riderpro.ui.index.tabs.add.AddPage
|
import com.aiosman.riderpro.ui.index.tabs.add.AddPage
|
||||||
@@ -113,7 +115,7 @@ fun IndexScreen() {
|
|||||||
innerPadding
|
innerPadding
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier.padding(0.dp),
|
modifier = Modifier.background(AppColors.background).padding(0.dp),
|
||||||
beyondBoundsPageCount = 5,
|
beyondBoundsPageCount = 5,
|
||||||
userScrollEnabled = false
|
userScrollEnabled = false
|
||||||
) { page ->
|
) { page ->
|
||||||
@@ -132,7 +134,7 @@ fun IndexScreen() {
|
|||||||
fun Home() {
|
fun Home() {
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = true)
|
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = !AppState.darkMode)
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -149,7 +151,7 @@ fun Home() {
|
|||||||
fun Street() {
|
fun Street() {
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = true)
|
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = !AppState.darkMode)
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -165,7 +167,7 @@ fun Street() {
|
|||||||
fun Add() {
|
fun Add() {
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
systemUiController.setStatusBarColor(Color.Black, darkIcons = false)
|
systemUiController.setStatusBarColor(Color.Black, darkIcons = !AppState.darkMode)
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -199,7 +201,7 @@ fun Video() {
|
|||||||
fun Profile() {
|
fun Profile() {
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = true)
|
systemUiController.setStatusBarColor(Color.Transparent, !AppState.darkMode)
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -215,7 +217,7 @@ fun Profile() {
|
|||||||
fun Notifications() {
|
fun Notifications() {
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = true)
|
systemUiController.setStatusBarColor(Color.Transparent, !AppState.darkMode)
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.aiosman.riderpro.ui.index.tabs.message
|
package com.aiosman.riderpro.ui.index.tabs.message
|
||||||
|
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@@ -24,10 +25,15 @@ import androidx.compose.material3.HorizontalDivider
|
|||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
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.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
@@ -37,6 +43,8 @@ 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.AppColors
|
||||||
|
import com.aiosman.riderpro.AppState
|
||||||
|
import com.aiosman.riderpro.AppStore
|
||||||
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
|
||||||
@@ -189,13 +197,14 @@ fun NotificationIndicator(
|
|||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = iconRes),
|
painter = painterResource(id = iconRes),
|
||||||
contentDescription = label,
|
contentDescription = label,
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp),
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
) {
|
) {
|
||||||
Text(label, modifier = Modifier.align(Alignment.Center))
|
Text(label, modifier = Modifier.align(Alignment.Center), color = AppColors.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -206,6 +215,8 @@ fun NotificationIndicator(
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun NotificationCounterItem(count: Int) {
|
fun NotificationCounterItem(count: Int) {
|
||||||
|
val context = LocalContext.current
|
||||||
|
var clickCount by remember { mutableStateOf(0) }
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(vertical = 16.dp, horizontal = 32.dp),
|
modifier = Modifier.padding(vertical = 16.dp, horizontal = 32.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically
|
verticalAlignment = Alignment.CenterVertically
|
||||||
@@ -217,13 +228,21 @@ fun NotificationCounterItem(count: Int) {
|
|||||||
painter = painterResource(id = R.drawable.rider_pro_notification),
|
painter = painterResource(id = R.drawable.rider_pro_notification),
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(24.dp)
|
.size(24.dp).noRippleClickable {
|
||||||
|
clickCount++
|
||||||
|
if (clickCount > 5) {
|
||||||
|
clickCount = 0
|
||||||
|
AppStore.saveDarkMode(!AppState.darkMode)
|
||||||
|
Toast.makeText(context, "Dark mode: ${AppState.darkMode},please restart app", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.width(24.dp))
|
Spacer(modifier = Modifier.width(24.dp))
|
||||||
Text(stringResource(R.string.notifications_upper), fontSize = 18.sp)
|
Text(stringResource(R.string.notifications_upper), fontSize = 18.sp, color = AppColors.text)
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
Box(
|
Box(
|
||||||
@@ -283,7 +302,8 @@ fun ChatMessageList(
|
|||||||
text = item.nickname,
|
text = item.nickname,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
@@ -65,6 +66,7 @@ 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 androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
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.entity.MomentEntity
|
import com.aiosman.riderpro.entity.MomentEntity
|
||||||
@@ -169,7 +171,7 @@ fun MomentCard(
|
|||||||
var imageIndex by remember { mutableStateOf(0) }
|
var imageIndex by remember { mutableStateOf(0) }
|
||||||
val navController = LocalNavController.current
|
val navController = LocalNavController.current
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier.fillMaxWidth().background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 8.dp)
|
modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 8.dp)
|
||||||
@@ -197,11 +199,6 @@ fun MomentCard(
|
|||||||
momentEntity = momentEntity,
|
momentEntity = momentEntity,
|
||||||
onLikeClick = onLikeClick,
|
onLikeClick = onLikeClick,
|
||||||
onAddComment = onAddComment,
|
onAddComment = onAddComment,
|
||||||
onShareClick = {
|
|
||||||
NewPostViewModel.asNewPost()
|
|
||||||
NewPostViewModel.relPostId = momentEntity.id
|
|
||||||
navController.navigate(NavigationRoute.NewPost.route)
|
|
||||||
},
|
|
||||||
onFavoriteClick = onFavoriteClick,
|
onFavoriteClick = onFavoriteClick,
|
||||||
imageIndex = imageIndex,
|
imageIndex = imageIndex,
|
||||||
onCommentClick = {
|
onCommentClick = {
|
||||||
@@ -267,7 +264,7 @@ fun MomentName(name: String) {
|
|||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
textAlign = TextAlign.Start,
|
textAlign = TextAlign.Start,
|
||||||
text = name,
|
text = name,
|
||||||
color = Color(0f, 0f, 0f),
|
color = AppColors.text,
|
||||||
fontSize = 16.sp, style = TextStyle(fontWeight = FontWeight.Bold)
|
fontSize = 16.sp, style = TextStyle(fontWeight = FontWeight.Bold)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -298,7 +295,7 @@ fun MomentFollowBtn() {
|
|||||||
fun MomentPostLocation(location: String) {
|
fun MomentPostLocation(location: String) {
|
||||||
Text(
|
Text(
|
||||||
text = location,
|
text = location,
|
||||||
color = Color(0f, 0f, 0f, 0.6f),
|
color = AppColors.secondaryText,
|
||||||
fontSize = 12.sp
|
fontSize = 12.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -307,7 +304,7 @@ fun MomentPostLocation(location: String) {
|
|||||||
fun MomentPostTime(time: String) {
|
fun MomentPostTime(time: String) {
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier,
|
modifier = Modifier,
|
||||||
text = time, color = Color(0f, 0f, 0f, 0.6f),
|
text = time, color = AppColors.text,
|
||||||
fontSize = 12.sp
|
fontSize = 12.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -359,13 +356,12 @@ fun MomentTopRowGroup(momentEntity: MomentEntity) {
|
|||||||
MomentPostTime(momentEntity.time.timeAgo(context))
|
MomentPostTime(momentEntity.time.timeAgo(context))
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
MomentPostLocation(momentEntity.location)
|
MomentPostLocation(momentEntity.location)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class, ExperimentalSharedTransitionApi::class)
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
fun PostImageView(
|
fun PostImageView(
|
||||||
images: List<MomentImageEntity>,
|
images: List<MomentImageEntity>,
|
||||||
@@ -413,7 +409,8 @@ fun MomentContentGroup(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(start = 16.dp, end = 16.dp, bottom = 8.dp),
|
.padding(start = 16.dp, end = 16.dp, bottom = 8.dp),
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (momentEntity.relMoment != null) {
|
if (momentEntity.relMoment != null) {
|
||||||
@@ -442,12 +439,14 @@ fun MomentOperateBtn(@DrawableRes icon: Int, count: String) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(width = 24.dp, height = 24.dp),
|
.size(width = 24.dp, height = 24.dp),
|
||||||
painter = painterResource(id = icon),
|
painter = painterResource(id = icon),
|
||||||
contentDescription = ""
|
contentDescription = "",
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = count,
|
text = count,
|
||||||
modifier = Modifier.padding(start = 7.dp),
|
modifier = Modifier.padding(start = 7.dp),
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -476,11 +475,9 @@ fun MomentBottomOperateRowGroup(
|
|||||||
onAddComment: () -> Unit = {},
|
onAddComment: () -> Unit = {},
|
||||||
onCommentClick: () -> Unit = {},
|
onCommentClick: () -> Unit = {},
|
||||||
onFavoriteClick: () -> Unit = {},
|
onFavoriteClick: () -> Unit = {},
|
||||||
onShareClick: () -> Unit = {},
|
|
||||||
momentEntity: MomentEntity,
|
momentEntity: MomentEntity,
|
||||||
imageIndex: Int = 0
|
imageIndex: Int = 0
|
||||||
) {
|
) {
|
||||||
val navController = LocalNavController.current
|
|
||||||
var showCommentModal by remember { mutableStateOf(false) }
|
var showCommentModal by remember { mutableStateOf(false) }
|
||||||
if (showCommentModal) {
|
if (showCommentModal) {
|
||||||
ModalBottomSheet(
|
ModalBottomSheet(
|
||||||
@@ -496,7 +493,6 @@ fun MomentBottomOperateRowGroup(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(56.dp)
|
.height(56.dp)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
import androidx.compose.ui.graphics.Color
|
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.layout.onGloballyPositioned
|
import androidx.compose.ui.layout.onGloballyPositioned
|
||||||
@@ -60,6 +59,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.compose.ui.unit.sp
|
import androidx.compose.ui.unit.sp
|
||||||
import androidx.paging.PagingData
|
import androidx.paging.PagingData
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.AppState
|
import com.aiosman.riderpro.AppState
|
||||||
import com.aiosman.riderpro.ConstVars
|
import com.aiosman.riderpro.ConstVars
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
@@ -134,7 +134,7 @@ fun ProfileV3(
|
|||||||
CollapsingToolbarScaffold(
|
CollapsingToolbarScaffold(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color(0xfff8f8f8)),
|
.background(AppColors.decentBackground),
|
||||||
state = state,
|
state = state,
|
||||||
scrollStrategy = ScrollStrategy.ExitUntilCollapsed,
|
scrollStrategy = ScrollStrategy.ExitUntilCollapsed,
|
||||||
toolbarScrollable = true,
|
toolbarScrollable = true,
|
||||||
@@ -145,7 +145,7 @@ fun ProfileV3(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(miniToolbarHeight.dp)
|
.height(miniToolbarHeight.dp)
|
||||||
// 保持在最低高度和当前高度之间
|
// 保持在最低高度和当前高度之间
|
||||||
.background(Color(0xfff8f8f8))
|
.background(AppColors.decentBackground)
|
||||||
|
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
@@ -172,6 +172,7 @@ fun ProfileV3(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(bannerHeight.dp)
|
.height(bannerHeight.dp)
|
||||||
|
.background(AppColors.decentBackground)
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -234,7 +235,7 @@ fun ProfileV3(
|
|||||||
.shadow(
|
.shadow(
|
||||||
elevation = 20.dp
|
elevation = 20.dp
|
||||||
)
|
)
|
||||||
.background(Color.White.copy(alpha = 0.7f))
|
.background(AppColors.background.copy(alpha = 0.7f))
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
painter = painterResource(id = R.drawable.rider_pro_more_horizon),
|
painter = painterResource(id = R.drawable.rider_pro_more_horizon),
|
||||||
@@ -242,7 +243,7 @@ fun ProfileV3(
|
|||||||
modifier = Modifier.noRippleClickable {
|
modifier = Modifier.noRippleClickable {
|
||||||
expanded = true
|
expanded = true
|
||||||
},
|
},
|
||||||
tint = Color.Black
|
tint = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
@@ -289,7 +290,9 @@ fun ProfileV3(
|
|||||||
|
|
||||||
}
|
}
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.background(AppColors.decentBackground)
|
||||||
) {
|
) {
|
||||||
// user info
|
// user info
|
||||||
Column(
|
Column(
|
||||||
@@ -350,6 +353,7 @@ fun ProfileV3(
|
|||||||
.graphicsLayer {
|
.graphicsLayer {
|
||||||
alpha = 1 - state.toolbarState.progress
|
alpha = 1 - state.toolbarState.progress
|
||||||
}
|
}
|
||||||
|
.background(AppColors.decentBackground)
|
||||||
.onGloballyPositioned {
|
.onGloballyPositioned {
|
||||||
miniToolbarHeight = with(density) {
|
miniToolbarHeight = with(density) {
|
||||||
it.size.height.toDp().value.toInt()
|
it.size.height.toDp().value.toInt()
|
||||||
@@ -375,7 +379,7 @@ fun ProfileV3(
|
|||||||
text = profile?.nickName ?: "",
|
text = profile?.nickName ?: "",
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
color = Color.Black
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
if (isSelf) {
|
if (isSelf) {
|
||||||
@@ -392,7 +396,7 @@ fun ProfileV3(
|
|||||||
modifier = Modifier.noRippleClickable {
|
modifier = Modifier.noRippleClickable {
|
||||||
minibarExpanded = true
|
minibarExpanded = true
|
||||||
},
|
},
|
||||||
tint = Color.Black
|
tint = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
@@ -442,7 +446,11 @@ fun ProfileV3(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Column {
|
Column(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxSize()
|
||||||
|
.background(AppColors.decentBackground)
|
||||||
|
) {
|
||||||
UserContentPageIndicator(
|
UserContentPageIndicator(
|
||||||
pagerState = pagerState,
|
pagerState = pagerState,
|
||||||
)
|
)
|
||||||
@@ -470,7 +478,9 @@ fun ProfileV3(
|
|||||||
.clip(
|
.clip(
|
||||||
RoundedCornerShape(8.dp)
|
RoundedCornerShape(8.dp)
|
||||||
)
|
)
|
||||||
.background(Color.White)
|
.background(
|
||||||
|
AppColors.background
|
||||||
|
)
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
NewPostViewModel.asNewPost()
|
NewPostViewModel.asNewPost()
|
||||||
@@ -483,14 +493,17 @@ fun ProfileV3(
|
|||||||
.clip(
|
.clip(
|
||||||
RoundedCornerShape(8.dp)
|
RoundedCornerShape(8.dp)
|
||||||
)
|
)
|
||||||
.background(Color(0xfff5f5f5))
|
.background(
|
||||||
|
AppColors.decentBackground
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Default.Add,
|
Icons.Default.Add,
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(32.dp)
|
.size(32.dp)
|
||||||
.align(Alignment.Center)
|
.align(Alignment.Center),
|
||||||
|
tint = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -504,6 +517,7 @@ fun ProfileV3(
|
|||||||
Spacer(modifier = Modifier.height(120.dp))
|
Spacer(modifier = Modifier.height(120.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
1 ->
|
1 ->
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.geometry.Offset
|
import androidx.compose.ui.geometry.Offset
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
import androidx.compose.ui.graphics.PathEffect
|
import androidx.compose.ui.graphics.PathEffect
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.layout.onGloballyPositioned
|
import androidx.compose.ui.layout.onGloballyPositioned
|
||||||
@@ -40,6 +41,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.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.entity.MomentEntity
|
import com.aiosman.riderpro.entity.MomentEntity
|
||||||
@@ -158,7 +160,7 @@ fun TimeGroup(time: String = "2024.06.08 12:23") {
|
|||||||
Text(
|
Text(
|
||||||
text = time,
|
text = time,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
style = TextStyle(fontWeight = FontWeight.W600)
|
style = TextStyle(fontWeight = FontWeight.W600)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -189,7 +191,7 @@ fun ProfileMomentCard(
|
|||||||
.width(14.dp)
|
.width(14.dp)
|
||||||
) {
|
) {
|
||||||
drawLine(
|
drawLine(
|
||||||
color = Color(0xff899DA9),
|
color = AppColors.divider,
|
||||||
start = Offset(0f, 0f),
|
start = Offset(0f, 0f),
|
||||||
end = Offset(0f, size.height),
|
end = Offset(0f, size.height),
|
||||||
strokeWidth = 4f,
|
strokeWidth = 4f,
|
||||||
@@ -199,7 +201,8 @@ fun ProfileMomentCard(
|
|||||||
Spacer(modifier = Modifier.width(10.dp))
|
Spacer(modifier = Modifier.width(10.dp))
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.background(Color.White)
|
.background(
|
||||||
|
AppColors.background)
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.onGloballyPositioned { coordinates ->
|
.onGloballyPositioned { coordinates ->
|
||||||
columnHeight = coordinates.size.height
|
columnHeight = coordinates.size.height
|
||||||
@@ -225,7 +228,7 @@ fun MomentCardTopContent(content: String) {
|
|||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.padding(top = 16.dp, bottom = 0.dp, start = 16.dp, end = 16.dp),
|
modifier = Modifier.padding(top = 16.dp, bottom = 0.dp, start = 16.dp, end = 16.dp),
|
||||||
text = content, fontSize = 16.sp, color = Color.Black
|
text = content, fontSize = 16.sp, color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -285,8 +288,9 @@ fun MomentCardOperationItem(@DrawableRes drawable: Int, number: String, modifier
|
|||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
modifier = Modifier.padding(start = 16.dp, end = 8.dp),
|
modifier = Modifier.padding(start = 16.dp, end = 8.dp),
|
||||||
painter = painterResource(id = drawable), contentDescription = ""
|
painter = painterResource(id = drawable), contentDescription = "",
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
Text(text = number)
|
Text(text = number, color = AppColors.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -19,11 +19,13 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
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.graphics.ColorFilter
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.res.stringResource
|
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.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.entity.AccountProfileEntity
|
import com.aiosman.riderpro.entity.AccountProfileEntity
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
@@ -43,7 +45,7 @@ fun OtherProfileAction(
|
|||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(32.dp))
|
.clip(RoundedCornerShape(32.dp))
|
||||||
.background(if (profile.isFollowing) Color(0xffebebeb) else Color(0xffda3833))
|
.background(if (profile.isFollowing) AppColors.main else AppColors.basicMain)
|
||||||
.padding(horizontal = 16.dp, vertical = 4.dp)
|
.padding(horizontal = 16.dp, vertical = 4.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
onFollow?.invoke()
|
onFollow?.invoke()
|
||||||
@@ -54,14 +56,14 @@ fun OtherProfileAction(
|
|||||||
Icons.Default.Clear,
|
Icons.Default.Clear,
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier.size(24.dp),
|
modifier = Modifier.size(24.dp),
|
||||||
tint = Color.Black
|
tint = AppColors.mainText
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Icon(
|
Icon(
|
||||||
Icons.Default.Add,
|
Icons.Default.Add,
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier.size(24.dp),
|
modifier = Modifier.size(24.dp),
|
||||||
tint = Color.White
|
tint = AppColors.mainText
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
@@ -69,7 +71,7 @@ fun OtherProfileAction(
|
|||||||
text = stringResource(if (profile.isFollowing) R.string.unfollow_upper else R.string.follow_upper),
|
text = stringResource(if (profile.isFollowing) R.string.unfollow_upper else R.string.follow_upper),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
color = if (profile.isFollowing) Color.Black else Color.White,
|
color = if (profile.isFollowing) AppColors.text else AppColors.mainText,
|
||||||
modifier = Modifier.padding(8.dp),
|
modifier = Modifier.padding(8.dp),
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -80,7 +82,7 @@ fun OtherProfileAction(
|
|||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(32.dp))
|
.clip(RoundedCornerShape(32.dp))
|
||||||
.background(Color(0xffebebeb))
|
.background(AppColors.basicMain)
|
||||||
.padding(horizontal = 16.dp, vertical = 4.dp)
|
.padding(horizontal = 16.dp, vertical = 4.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
onChat?.invoke()
|
onChat?.invoke()
|
||||||
@@ -90,13 +92,14 @@ fun OtherProfileAction(
|
|||||||
painter = painterResource(id = R.drawable.rider_pro_comment),
|
painter = painterResource(id = R.drawable.rider_pro_comment),
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier.size(24.dp),
|
modifier = Modifier.size(24.dp),
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.chat_upper),
|
text = stringResource(R.string.chat_upper),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
modifier = Modifier.padding(8.dp),
|
modifier = Modifier.padding(8.dp),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,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.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
|
|
||||||
@@ -34,7 +35,9 @@ fun SelfProfileAction(
|
|||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(32.dp))
|
.clip(RoundedCornerShape(32.dp))
|
||||||
.background(Color(0xffebebeb))
|
.background(
|
||||||
|
AppColors.basicMain
|
||||||
|
)
|
||||||
.padding(horizontal = 16.dp, vertical = 4.dp)
|
.padding(horizontal = 16.dp, vertical = 4.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
onEditProfile()
|
onEditProfile()
|
||||||
@@ -43,14 +46,15 @@ fun SelfProfileAction(
|
|||||||
Icon(
|
Icon(
|
||||||
Icons.Default.Edit,
|
Icons.Default.Edit,
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp),
|
||||||
|
tint = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.edit_profile),
|
text = stringResource(R.string.edit_profile),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
modifier = Modifier.padding(8.dp)
|
modifier = Modifier.padding(8.dp)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,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.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
import com.aiosman.riderpro.ui.modifiers.noRippleClickable
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@@ -44,7 +45,7 @@ fun UserContentPageIndicator(
|
|||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(32.dp))
|
.clip(RoundedCornerShape(32.dp))
|
||||||
.background(if (pagerState.currentPage == 0) Color(0xFFFFFFFF) else Color.Transparent)
|
.background(if (pagerState.currentPage == 0) AppColors.background else Color.Transparent)
|
||||||
.padding(horizontal = 16.dp, vertical = 4.dp)
|
.padding(horizontal = 16.dp, vertical = 4.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
// switch to gallery
|
// switch to gallery
|
||||||
@@ -57,8 +58,8 @@ fun UserContentPageIndicator(
|
|||||||
text = stringResource(R.string.gallery),
|
text = stringResource(R.string.gallery),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
modifier = Modifier.padding(8.dp)
|
modifier = Modifier.padding(8.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
@@ -67,7 +68,7 @@ fun UserContentPageIndicator(
|
|||||||
horizontalArrangement = Arrangement.Center,
|
horizontalArrangement = Arrangement.Center,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(32.dp))
|
.clip(RoundedCornerShape(32.dp))
|
||||||
.background(if (pagerState.currentPage == 1) Color(0xFFFFFFFF) else Color.Transparent)
|
.background(if (pagerState.currentPage == 1) AppColors.background else Color.Transparent)
|
||||||
.padding(horizontal = 16.dp, vertical = 4.dp)
|
.padding(horizontal = 16.dp, vertical = 4.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
// switch to moments
|
// switch to moments
|
||||||
@@ -80,7 +81,7 @@ fun UserContentPageIndicator(
|
|||||||
text = stringResource(R.string.moment),
|
text = stringResource(R.string.moment),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
modifier = Modifier.padding(8.dp)
|
modifier = Modifier.padding(8.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,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.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
import com.aiosman.riderpro.entity.AccountProfileEntity
|
import com.aiosman.riderpro.entity.AccountProfileEntity
|
||||||
@@ -71,11 +72,13 @@ fun UserItem(accountProfileEntity: AccountProfileEntity) {
|
|||||||
Text(
|
Text(
|
||||||
text = accountProfileEntity.followerCount.toString(),
|
text = accountProfileEntity.followerCount.toString(),
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.followers_upper),
|
text = stringResource(R.string.followers_upper),
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
@@ -95,11 +98,13 @@ fun UserItem(accountProfileEntity: AccountProfileEntity) {
|
|||||||
Text(
|
Text(
|
||||||
text = accountProfileEntity.followingCount.toString(),
|
text = accountProfileEntity.followingCount.toString(),
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.following_upper),
|
text = stringResource(R.string.following_upper),
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Column(
|
Column(
|
||||||
@@ -117,6 +122,7 @@ fun UserItem(accountProfileEntity: AccountProfileEntity) {
|
|||||||
text = accountProfileEntity.nickName,
|
text = accountProfileEntity.nickName,
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
// 个人简介
|
// 个人简介
|
||||||
@@ -124,13 +130,13 @@ fun UserItem(accountProfileEntity: AccountProfileEntity) {
|
|||||||
Text(
|
Text(
|
||||||
text = accountProfileEntity.bio,
|
text = accountProfileEntity.bio,
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = Color.Gray
|
color = AppColors.secondaryText
|
||||||
)
|
)
|
||||||
}else{
|
}else{
|
||||||
Text(
|
Text(
|
||||||
text = "No bio here.",
|
text = "No bio here.",
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
color = Color.Gray
|
color = AppColors.secondaryText
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ 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 androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
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
|
||||||
@@ -69,12 +70,12 @@ fun DiscoverScreen() {
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color(0xFFF4F5F6))
|
|
||||||
.pullRefresh(state)
|
.pullRefresh(state)
|
||||||
.padding(bottom = navigationBarPaddings)
|
.padding(bottom = navigationBarPaddings)
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth().background(Color.White).padding(bottom = 10.dp)
|
modifier = Modifier.fillMaxWidth().background(
|
||||||
|
AppColors.background).padding(bottom = 10.dp)
|
||||||
) {
|
) {
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
SearchButton(
|
SearchButton(
|
||||||
@@ -107,7 +108,8 @@ fun SearchButton(
|
|||||||
Box(
|
Box(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.clip(shape = RoundedCornerShape(8.dp))
|
.clip(shape = RoundedCornerShape(8.dp))
|
||||||
.background(Color(0xFFF4F5F6))
|
.background(
|
||||||
|
AppColors.inputBackground)
|
||||||
.padding(horizontal = 16.dp, vertical = 12.dp)
|
.padding(horizontal = 16.dp, vertical = 12.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
clickAction()
|
clickAction()
|
||||||
@@ -119,13 +121,13 @@ fun SearchButton(
|
|||||||
Icon(
|
Icon(
|
||||||
Icons.Default.Search,
|
Icons.Default.Search,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
tint = Color(0xFF9E9E9E)
|
tint = AppColors.inputHint
|
||||||
)
|
)
|
||||||
Box {
|
Box {
|
||||||
Text(
|
Text(
|
||||||
text = context.getString(R.string.search),
|
text = context.getString(R.string.search),
|
||||||
modifier = Modifier.padding(start = 8.dp),
|
modifier = Modifier.padding(start = 8.dp),
|
||||||
color = Color(0xFF9E9E9E),
|
color = AppColors.inputHint,
|
||||||
fontSize = 18.sp
|
fontSize = 18.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.focus.FocusRequester
|
import androidx.compose.ui.focus.FocusRequester
|
||||||
import androidx.compose.ui.focus.focusRequester
|
import androidx.compose.ui.focus.focusRequester
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.SolidColor
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
@@ -54,6 +55,7 @@ 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 androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.AppState
|
import com.aiosman.riderpro.AppState
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
@@ -84,7 +86,7 @@ fun SearchScreen() {
|
|||||||
val focusRequester = remember { FocusRequester() }
|
val focusRequester = remember { FocusRequester() }
|
||||||
val navController = LocalNavController.current
|
val navController = LocalNavController.current
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = true)
|
systemUiController.setStatusBarColor(Color.Transparent, darkIcons = !AppState.darkMode)
|
||||||
}
|
}
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
if (model.requestFocus) {
|
if (model.requestFocus) {
|
||||||
@@ -96,13 +98,15 @@ fun SearchScreen() {
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color(0xFFF0F2F5))
|
.background(AppColors.background)
|
||||||
.padding(bottom = navigationBarPaddings)
|
.padding(bottom = navigationBarPaddings)
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.background(Color.White)
|
.background(
|
||||||
|
AppColors.background
|
||||||
|
)
|
||||||
.padding(bottom = 10.dp)
|
.padding(bottom = 10.dp)
|
||||||
) {
|
) {
|
||||||
Spacer(modifier = Modifier.height(statusBarPaddingValues.calculateTopPadding()))
|
Spacer(modifier = Modifier.height(statusBarPaddingValues.calculateTopPadding()))
|
||||||
@@ -130,7 +134,9 @@ fun SearchScreen() {
|
|||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
modifier = Modifier.noRippleClickable {
|
modifier = Modifier.noRippleClickable {
|
||||||
navController.popBackStack()
|
navController.popBackStack()
|
||||||
})
|
},
|
||||||
|
color = AppColors.text
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -138,7 +144,8 @@ fun SearchScreen() {
|
|||||||
if (model.showResult) {
|
if (model.showResult) {
|
||||||
TabRow(
|
TabRow(
|
||||||
selectedTabIndex = selectedTabIndex.value,
|
selectedTabIndex = selectedTabIndex.value,
|
||||||
backgroundColor = Color.White,
|
backgroundColor = AppColors.background,
|
||||||
|
contentColor = AppColors.text,
|
||||||
) {
|
) {
|
||||||
categories.forEachIndexed { index, category ->
|
categories.forEachIndexed { index, category ->
|
||||||
Tab(
|
Tab(
|
||||||
@@ -148,7 +155,7 @@ fun SearchScreen() {
|
|||||||
pagerState.animateScrollToPage(index)
|
pagerState.animateScrollToPage(index)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
text = { Text(category) }
|
text = { Text(category, color = AppColors.text) }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -171,7 +178,9 @@ fun SearchInput(
|
|||||||
Box(
|
Box(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.clip(shape = RoundedCornerShape(8.dp))
|
.clip(shape = RoundedCornerShape(8.dp))
|
||||||
.background(Color(0xFFF4F5F6))
|
.background(
|
||||||
|
AppColors.inputBackground
|
||||||
|
)
|
||||||
.padding(horizontal = 16.dp, vertical = 12.dp)
|
.padding(horizontal = 16.dp, vertical = 12.dp)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
@@ -180,14 +189,14 @@ fun SearchInput(
|
|||||||
Icon(
|
Icon(
|
||||||
Icons.Default.Search,
|
Icons.Default.Search,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
tint = Color(0xFF9E9E9E)
|
tint = AppColors.inputHint
|
||||||
)
|
)
|
||||||
Box {
|
Box {
|
||||||
if (text.isEmpty()) {
|
if (text.isEmpty()) {
|
||||||
Text(
|
Text(
|
||||||
text = context.getString(R.string.search),
|
text = context.getString(R.string.search),
|
||||||
modifier = Modifier.padding(start = 8.dp),
|
modifier = Modifier.padding(start = 8.dp),
|
||||||
color = Color(0xFF9E9E9E),
|
color = AppColors.inputHint,
|
||||||
fontSize = 18.sp
|
fontSize = 18.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -202,7 +211,8 @@ fun SearchInput(
|
|||||||
.focusRequester(focusRequester),
|
.focusRequester(focusRequester),
|
||||||
singleLine = true,
|
singleLine = true,
|
||||||
textStyle = TextStyle(
|
textStyle = TextStyle(
|
||||||
fontSize = 18.sp
|
fontSize = 18.sp,
|
||||||
|
color = AppColors.text
|
||||||
),
|
),
|
||||||
keyboardOptions = KeyboardOptions.Default.copy(
|
keyboardOptions = KeyboardOptions.Default.copy(
|
||||||
imeAction = ImeAction.Search
|
imeAction = ImeAction.Search
|
||||||
@@ -211,7 +221,8 @@ fun SearchInput(
|
|||||||
onSearch = {
|
onSearch = {
|
||||||
onSearch()
|
onSearch()
|
||||||
}
|
}
|
||||||
)
|
),
|
||||||
|
cursorBrush = SolidColor(AppColors.text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,7 +238,7 @@ fun SearchPager(
|
|||||||
) {
|
) {
|
||||||
HorizontalPager(
|
HorizontalPager(
|
||||||
state = pagerState,
|
state = pagerState,
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize().background(AppColors.background),
|
||||||
|
|
||||||
) { page ->
|
) { page ->
|
||||||
when (page) {
|
when (page) {
|
||||||
@@ -245,7 +256,7 @@ fun MomentResultTab() {
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color(0xFFF0F2F5))
|
.background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
@@ -323,13 +334,18 @@ fun UserItem(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
) {
|
) {
|
||||||
Text(text = accountProfile.nickName, fontSize = 16.sp, fontWeight = FontWeight.Bold)
|
Text(
|
||||||
|
text = accountProfile.nickName,
|
||||||
|
fontSize = 16.sp,
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
color = AppColors.text
|
||||||
|
)
|
||||||
Spacer(modifier = Modifier.width(2.dp))
|
Spacer(modifier = Modifier.width(2.dp))
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(
|
text = stringResource(
|
||||||
R.string.search_user_item_follower_count,
|
R.string.search_user_item_follower_count,
|
||||||
accountProfile.followerCount
|
accountProfile.followerCount
|
||||||
), fontSize = 14.sp, color = Color(0xFF9E9E9E)
|
), fontSize = 14.sp, color = AppColors.secondaryText
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.width(16.dp))
|
Spacer(modifier = Modifier.width(16.dp))
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ 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 androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.AppState
|
import com.aiosman.riderpro.AppState
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
import com.aiosman.riderpro.R
|
import com.aiosman.riderpro.R
|
||||||
@@ -63,13 +64,13 @@ fun LikeNoticeScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StatusBarMaskLayout(
|
StatusBarMaskLayout(
|
||||||
darkIcons = true,
|
darkIcons = !AppState.darkMode,
|
||||||
maskBoxBackgroundColor = Color(0xFFFFFFFF)
|
maskBoxBackgroundColor = AppColors.background
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.background(color = Color(0xFFFFFFFF))
|
.background(color = AppColors.background)
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
@@ -162,15 +163,15 @@ fun ActionPostNoticeItem(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Text(nickName, fontWeight = FontWeight.Bold, fontSize = 16.sp)
|
Text(nickName, fontWeight = FontWeight.Bold, fontSize = 16.sp, color = AppColors.text)
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
when (action) {
|
when (action) {
|
||||||
"like" -> Text(stringResource(R.string.like_your_post))
|
"like" -> Text(stringResource(R.string.like_your_post), color = AppColors.text)
|
||||||
"favourite" -> Text(stringResource(R.string.favourite_your_post))
|
"favourite" -> Text(stringResource(R.string.favourite_your_post), color = AppColors.text)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
Row {
|
Row {
|
||||||
Text(likeTime.timeAgo(context), fontSize = 12.sp, color = Color(0x99000000))
|
Text(likeTime.timeAgo(context), fontSize = 12.sp, color = AppColors.secondaryText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CustomAsyncImage(
|
CustomAsyncImage(
|
||||||
@@ -224,15 +225,15 @@ fun LikeCommentNoticeItem(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
) {
|
) {
|
||||||
Text(item.user.nickName, fontWeight = FontWeight.Bold, fontSize = 16.sp)
|
Text(item.user.nickName, fontWeight = FontWeight.Bold, fontSize = 16.sp, color = AppColors.text)
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
Text(stringResource(R.string.like_your_comment))
|
Text(stringResource(R.string.like_your_comment), color = AppColors.text)
|
||||||
Spacer(modifier = Modifier.height(2.dp))
|
Spacer(modifier = Modifier.height(2.dp))
|
||||||
Row {
|
Row {
|
||||||
Text(
|
Text(
|
||||||
item.likeTime.timeAgo(context),
|
item.likeTime.timeAgo(context),
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color = Color(0x99000000)
|
color = AppColors.secondaryText
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -263,12 +264,13 @@ fun LikeCommentNoticeItem(
|
|||||||
Text(
|
Text(
|
||||||
text = MyProfileViewModel.nickName,
|
text = MyProfileViewModel.nickName,
|
||||||
fontWeight = FontWeight.W600,
|
fontWeight = FontWeight.W600,
|
||||||
fontSize = 14.sp
|
fontSize = 14.sp,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Text(
|
Text(
|
||||||
text = item.comment?.content ?: "",
|
text = item.comment?.content ?: "",
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color = Color(0x99000000),
|
color = AppColors.secondaryText,
|
||||||
maxLines = 2
|
maxLines = 2
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ fun LoginPage() {
|
|||||||
val accountService = AccountServiceImpl()
|
val accountService = AccountServiceImpl()
|
||||||
val statusBarController = rememberSystemUiController()
|
val statusBarController = rememberSystemUiController()
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
statusBarController.setStatusBarColor(Color.Transparent, darkIcons = true)
|
statusBarController.setStatusBarColor(Color.Transparent, darkIcons = !AppState.darkMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun googleLogin() {
|
fun googleLogin() {
|
||||||
|
|||||||
@@ -45,17 +45,22 @@ import androidx.compose.ui.draw.drawBehind
|
|||||||
import androidx.compose.ui.draw.shadow
|
import androidx.compose.ui.draw.shadow
|
||||||
import androidx.compose.ui.geometry.CornerRadius
|
import androidx.compose.ui.geometry.CornerRadius
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.ColorFilter
|
||||||
import androidx.compose.ui.graphics.PathEffect
|
import androidx.compose.ui.graphics.PathEffect
|
||||||
|
import androidx.compose.ui.graphics.SolidColor
|
||||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
|
import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
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.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.content.FileProvider
|
import androidx.core.content.FileProvider
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
|
import com.aiosman.riderpro.AppState
|
||||||
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
|
||||||
@@ -69,14 +74,11 @@ import kotlinx.coroutines.launch
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
|
||||||
@Preview
|
@Preview
|
||||||
@Composable
|
@Composable
|
||||||
fun NewPostScreen() {
|
fun NewPostScreen() {
|
||||||
val model = NewPostViewModel
|
val model = NewPostViewModel
|
||||||
val systemUiController = rememberSystemUiController()
|
val systemUiController = rememberSystemUiController()
|
||||||
val navController = LocalNavController.current
|
|
||||||
val context = LocalContext.current
|
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
systemUiController.setNavigationBarColor(color = Color.Transparent)
|
systemUiController.setNavigationBarColor(color = Color.Transparent)
|
||||||
model.init()
|
model.init()
|
||||||
@@ -84,14 +86,17 @@ fun NewPostScreen() {
|
|||||||
|
|
||||||
|
|
||||||
StatusBarMaskLayout(
|
StatusBarMaskLayout(
|
||||||
darkIcons = true,
|
darkIcons = !AppState.darkMode,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color.White)
|
.background(
|
||||||
|
AppColors.background
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
|
.background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
NewPostTopBar {
|
NewPostTopBar {
|
||||||
}
|
}
|
||||||
@@ -139,16 +144,15 @@ fun NewPostTopBar(onSendClick: () -> Unit = {}) {
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(64.dp)).shadow(elevation = 4.dp)
|
.clip(RoundedCornerShape(64.dp)).shadow(elevation = 4.dp)
|
||||||
.background(Color.White).padding(16.dp),
|
.background(AppColors.background).padding(16.dp),
|
||||||
contentAlignment = Alignment.CenterStart
|
contentAlignment = Alignment.CenterStart
|
||||||
) {
|
) {
|
||||||
|
|
||||||
CircularProgressIndicator(
|
CircularProgressIndicator(
|
||||||
modifier = Modifier.size(24.dp),
|
modifier = Modifier.size(24.dp),
|
||||||
color = Color(0xffda3832)
|
color = AppColors.main
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
Text("Uploading", modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center)
|
Text("Uploading", modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center, color = AppColors.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,12 +174,13 @@ fun NewPostTopBar(onSendClick: () -> Unit = {}) {
|
|||||||
.size(24.dp)
|
.size(24.dp)
|
||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
navController.popBackStack()
|
navController.popBackStack()
|
||||||
}
|
},
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
Icon(
|
Icon(
|
||||||
painter = painterResource(id = R.drawable.rider_pro_video_share),
|
painter = painterResource(id = R.drawable.rider_pro_video_share),
|
||||||
tint = Color.Black,
|
tint = AppColors.text,
|
||||||
contentDescription = "Send",
|
contentDescription = "Send",
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(32.dp)
|
.size(32.dp)
|
||||||
@@ -219,13 +224,17 @@ fun NewPostTextField(hint: String, value: String, onValueChange: (String) -> Uni
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.heightIn(200.dp)
|
.heightIn(200.dp)
|
||||||
.padding(horizontal = 18.dp, vertical = 10.dp)
|
.padding(horizontal = 18.dp, vertical = 10.dp),
|
||||||
|
cursorBrush = SolidColor(AppColors.text),
|
||||||
|
textStyle = TextStyle(
|
||||||
|
color = AppColors.text,
|
||||||
|
)
|
||||||
|
|
||||||
)
|
)
|
||||||
if (value.isEmpty()) {
|
if (value.isEmpty()) {
|
||||||
Text(
|
Text(
|
||||||
text = hint,
|
text = hint,
|
||||||
color = Color.Gray,
|
color = AppColors.inputHint,
|
||||||
modifier = Modifier.padding(horizontal = 18.dp, vertical = 10.dp)
|
modifier = Modifier.padding(horizontal = 18.dp, vertical = 10.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ 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
|
||||||
@@ -51,6 +50,7 @@ import androidx.compose.ui.Alignment
|
|||||||
import androidx.compose.ui.Modifier
|
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.graphics.ColorFilter
|
||||||
import androidx.compose.ui.graphics.vector.ImageVector
|
import androidx.compose.ui.graphics.vector.ImageVector
|
||||||
import androidx.compose.ui.layout.ContentScale
|
import androidx.compose.ui.layout.ContentScale
|
||||||
import androidx.compose.ui.platform.LocalClipboardManager
|
import androidx.compose.ui.platform.LocalClipboardManager
|
||||||
@@ -73,6 +73,7 @@ import androidx.lifecycle.viewModelScope
|
|||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import androidx.paging.LoadState
|
import androidx.paging.LoadState
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
|
import com.aiosman.riderpro.AppColors
|
||||||
import com.aiosman.riderpro.AppState
|
import com.aiosman.riderpro.AppState
|
||||||
import com.aiosman.riderpro.LocalAnimatedContentScope
|
import com.aiosman.riderpro.LocalAnimatedContentScope
|
||||||
import com.aiosman.riderpro.LocalNavController
|
import com.aiosman.riderpro.LocalNavController
|
||||||
@@ -85,7 +86,6 @@ 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
|
||||||
@@ -137,7 +137,7 @@ fun PostScreen(
|
|||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
showCommentMenu = false
|
showCommentMenu = false
|
||||||
},
|
},
|
||||||
containerColor = Color.White,
|
containerColor = AppColors.background,
|
||||||
sheetState = commentModalState,
|
sheetState = commentModalState,
|
||||||
dragHandle = {},
|
dragHandle = {},
|
||||||
shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp),
|
shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp),
|
||||||
@@ -193,7 +193,7 @@ fun PostScreen(
|
|||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
showCommentModal = false
|
showCommentModal = false
|
||||||
},
|
},
|
||||||
containerColor = Color.White,
|
containerColor = AppColors.background,
|
||||||
sheetState = rememberModalBottomSheetState(
|
sheetState = rememberModalBottomSheetState(
|
||||||
skipPartiallyExpanded = true
|
skipPartiallyExpanded = true
|
||||||
),
|
),
|
||||||
@@ -271,7 +271,7 @@ fun PostScreen(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(Color.White)
|
.background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
StatusBarSpacer()
|
StatusBarSpacer()
|
||||||
if (viewModel.isError) {
|
if (viewModel.isError) {
|
||||||
@@ -293,7 +293,8 @@ fun PostScreen(
|
|||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp
|
||||||
)
|
),
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -337,7 +338,6 @@ fun PostScreen(
|
|||||||
viewModel.moment?.images ?: emptyList(),
|
viewModel.moment?.images ?: emptyList(),
|
||||||
initialPage = initImagePagerIndex
|
initialPage = initImagePagerIndex
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
PostDetails(
|
PostDetails(
|
||||||
viewModel.moment
|
viewModel.moment
|
||||||
@@ -348,7 +348,9 @@ fun PostScreen(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
.height(1.dp)
|
.height(1.dp)
|
||||||
.background(Color(0xFFF7F7F7))
|
.background(
|
||||||
|
AppColors.divider
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -364,7 +366,8 @@ fun PostScreen(
|
|||||||
text = stringResource(
|
text = stringResource(
|
||||||
R.string.comment_count,
|
R.string.comment_count,
|
||||||
(viewModel.moment?.commentCount ?: 0)
|
(viewModel.moment?.commentCount ?: 0)
|
||||||
), fontSize = 14.sp
|
), fontSize = 14.sp,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.weight(1f))
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
OrderSelectionComponent() {
|
OrderSelectionComponent() {
|
||||||
@@ -553,7 +556,7 @@ fun CommentContent(
|
|||||||
) {
|
) {
|
||||||
LinearProgressIndicator(
|
LinearProgressIndicator(
|
||||||
modifier = Modifier.width(160.dp),
|
modifier = Modifier.width(160.dp),
|
||||||
color = Color(0xFFDA3832)
|
color = AppColors.main
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
Text(
|
Text(
|
||||||
@@ -573,7 +576,7 @@ fun CommentContent(
|
|||||||
) {
|
) {
|
||||||
LinearProgressIndicator(
|
LinearProgressIndicator(
|
||||||
modifier = Modifier.width(160.dp),
|
modifier = Modifier.width(160.dp),
|
||||||
color = Color(0xFFDA3832)
|
color = AppColors.main
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -629,7 +632,7 @@ fun Header(
|
|||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
expanded = false
|
expanded = false
|
||||||
},
|
},
|
||||||
containerColor = Color.White,
|
containerColor = AppColors.background,
|
||||||
sheetState = rememberModalBottomSheetState(
|
sheetState = rememberModalBottomSheetState(
|
||||||
skipPartiallyExpanded = true
|
skipPartiallyExpanded = true
|
||||||
),
|
),
|
||||||
@@ -658,14 +661,15 @@ fun Header(
|
|||||||
.noRippleClickable {
|
.noRippleClickable {
|
||||||
navController.popBackStack()
|
navController.popBackStack()
|
||||||
}
|
}
|
||||||
.size(32.dp)
|
.size(32.dp),
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(40.dp)
|
.size(40.dp)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.background(Color.Gray.copy(alpha = 0.1f))
|
.background(AppColors.secondaryText.copy(alpha = 0.1f))
|
||||||
) {
|
) {
|
||||||
CustomAsyncImage(
|
CustomAsyncImage(
|
||||||
context,
|
context,
|
||||||
@@ -692,7 +696,8 @@ fun Header(
|
|||||||
Text(
|
Text(
|
||||||
text = nickname ?: "",
|
text = nickname ?: "",
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f),
|
||||||
|
color = AppColors.text,
|
||||||
)
|
)
|
||||||
if (AppState.UserId != userId) {
|
if (AppState.UserId != userId) {
|
||||||
FollowButton(
|
FollowButton(
|
||||||
@@ -712,7 +717,8 @@ fun Header(
|
|||||||
expanded = true
|
expanded = true
|
||||||
},
|
},
|
||||||
painter = painterResource(id = R.drawable.rider_pro_more_horizon),
|
painter = painterResource(id = R.drawable.rider_pro_more_horizon),
|
||||||
contentDescription = ""
|
contentDescription = "",
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -809,9 +815,10 @@ fun PostDetails(
|
|||||||
text = momentEntity?.momentTextContent ?: "",
|
text = momentEntity?.momentTextContent ?: "",
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
|
color = AppColors.text,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Text(text = "${momentEntity?.time?.formatPostTime()}")
|
Text(text = "${momentEntity?.time?.formatPostTime()}", color = AppColors.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -871,7 +878,7 @@ fun CommentItem(
|
|||||||
}
|
}
|
||||||
) {}
|
) {}
|
||||||
) {
|
) {
|
||||||
Text(text = commentEntity.name, fontWeight = FontWeight.W600, fontSize = 14.sp)
|
Text(text = commentEntity.name, fontWeight = FontWeight.W600, fontSize = 14.sp, color = AppColors.text)
|
||||||
Row {
|
Row {
|
||||||
if (isChild) {
|
if (isChild) {
|
||||||
val annotatedText = buildAnnotatedString {
|
val annotatedText = buildAnnotatedString {
|
||||||
@@ -910,7 +917,7 @@ fun CommentItem(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
style = TextStyle(fontSize = 14.sp),
|
style = TextStyle(fontSize = 14.sp, color = AppColors.text),
|
||||||
onLongPress = {
|
onLongPress = {
|
||||||
onLongClick(commentEntity)
|
onLongClick(commentEntity)
|
||||||
},
|
},
|
||||||
@@ -923,6 +930,7 @@ fun CommentItem(
|
|||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
maxLines = Int.MAX_VALUE,
|
maxLines = Int.MAX_VALUE,
|
||||||
softWrap = true,
|
softWrap = true,
|
||||||
|
color = AppColors.text,
|
||||||
modifier = Modifier.combinedClickable(
|
modifier = Modifier.combinedClickable(
|
||||||
interactionSource = remember { MutableInteractionSource() },
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
indication = null,
|
indication = null,
|
||||||
@@ -948,7 +956,7 @@ fun CommentItem(
|
|||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.reply),
|
text = stringResource(R.string.reply),
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color = Color.Gray,
|
color = AppColors.secondaryText,
|
||||||
modifier = Modifier.noRippleClickable {
|
modifier = Modifier.noRippleClickable {
|
||||||
onReply(
|
onReply(
|
||||||
commentEntity,
|
commentEntity,
|
||||||
@@ -956,7 +964,7 @@ fun CommentItem(
|
|||||||
commentEntity.replyUserNickname,
|
commentEntity.replyUserNickname,
|
||||||
commentEntity.replyUserAvatar
|
commentEntity.replyUserAvatar
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,7 +982,7 @@ fun CommentItem(
|
|||||||
},
|
},
|
||||||
modifier = Modifier.size(20.dp)
|
modifier = Modifier.size(20.dp)
|
||||||
)
|
)
|
||||||
Text(text = commentEntity.likes.toString(), fontSize = 12.sp)
|
Text(text = commentEntity.likes.toString(), fontSize = 12.sp, color = AppColors.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
@@ -1034,13 +1042,15 @@ fun PostBottomBar(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.background(Color.White)
|
modifier = Modifier.background(
|
||||||
|
AppColors.background
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(1.dp)
|
.height(1.dp)
|
||||||
.background(Color(0xFFF7F7F7))
|
.background(AppColors.inputBackground)
|
||||||
) {
|
) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1048,13 +1058,13 @@ fun PostBottomBar(
|
|||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 16.dp, vertical = 13.dp)
|
.padding(horizontal = 16.dp, vertical = 13.dp)
|
||||||
.background(Color.White)
|
.background(AppColors.background)
|
||||||
) {
|
) {
|
||||||
// grey round box
|
// grey round box
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(16.dp))
|
.clip(RoundedCornerShape(16.dp))
|
||||||
.background(Color(0xFFF5F5F5))
|
.background(AppColors.inputBackground)
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.height(31.dp)
|
.height(31.dp)
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
@@ -1067,13 +1077,14 @@ fun PostBottomBar(
|
|||||||
) {
|
) {
|
||||||
Image(
|
Image(
|
||||||
ImageVector.vectorResource(R.drawable.rider_pro_new_comment),
|
ImageVector.vectorResource(R.drawable.rider_pro_new_comment),
|
||||||
contentDescription = "Send"
|
contentDescription = "Send",
|
||||||
|
colorFilter = ColorFilter.tint(AppColors.text),
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.post_comment_hint),
|
text = stringResource(R.string.post_comment_hint),
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
color = Color(0xFFCCCCCC)
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1084,7 +1095,7 @@ fun PostBottomBar(
|
|||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
Text(text = momentEntity?.likeCount.toString())
|
Text(text = momentEntity?.likeCount.toString(),color = AppColors.text)
|
||||||
Spacer(modifier = Modifier.width(16.dp))
|
Spacer(modifier = Modifier.width(16.dp))
|
||||||
AnimatedFavouriteIcon(
|
AnimatedFavouriteIcon(
|
||||||
isFavourite = momentEntity?.isFavorite == true,
|
isFavourite = momentEntity?.isFavorite == true,
|
||||||
@@ -1092,11 +1103,11 @@ fun PostBottomBar(
|
|||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.width(4.dp))
|
Spacer(modifier = Modifier.width(4.dp))
|
||||||
Text(text = momentEntity?.favoriteCount.toString())
|
Text(text = momentEntity?.favoriteCount.toString(),color = AppColors.text)
|
||||||
|
|
||||||
}
|
}
|
||||||
BottomNavigationPlaceholder(
|
BottomNavigationPlaceholder(
|
||||||
color = Color.White
|
color = AppColors.background
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1110,6 +1121,7 @@ fun PostMenuModal(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(160.dp)
|
.height(160.dp)
|
||||||
|
.background(AppColors.background)
|
||||||
.padding(vertical = 47.dp, horizontal = 20.dp)
|
.padding(vertical = 47.dp, horizontal = 20.dp)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
@@ -1132,7 +1144,10 @@ fun PostMenuModal(
|
|||||||
Image(
|
Image(
|
||||||
painter = painterResource(id = R.drawable.rider_pro_moment_delete),
|
painter = painterResource(id = R.drawable.rider_pro_moment_delete),
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier.size(24.dp)
|
modifier = Modifier.size(24.dp),
|
||||||
|
colorFilter = ColorFilter.tint(
|
||||||
|
AppColors.text
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1140,7 +1155,8 @@ fun PostMenuModal(
|
|||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.delete),
|
text = stringResource(R.string.delete),
|
||||||
fontSize = 11.sp,
|
fontSize = 11.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1172,7 +1188,7 @@ fun MenuActionItem(
|
|||||||
painter = painterResource(id = icon),
|
painter = painterResource(id = icon),
|
||||||
contentDescription = "",
|
contentDescription = "",
|
||||||
modifier = Modifier.size(24.dp),
|
modifier = Modifier.size(24.dp),
|
||||||
tint = Color.Black
|
tint = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1181,7 +1197,8 @@ fun MenuActionItem(
|
|||||||
Text(
|
Text(
|
||||||
text = text,
|
text = text,
|
||||||
fontSize = 11.sp,
|
fontSize = 11.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1212,15 +1229,17 @@ fun CommentMenuModal(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
.background(AppColors.background)
|
||||||
.padding(vertical = 24.dp, horizontal = 20.dp)
|
.padding(vertical = 24.dp, horizontal = 20.dp)
|
||||||
) {
|
) {
|
||||||
Text(stringResource(R.string.comment), fontSize = 18.sp, fontWeight = FontWeight.Bold)
|
Text(stringResource(R.string.comment), fontSize = 18.sp, fontWeight = FontWeight.Bold, color = AppColors.text)
|
||||||
Spacer(modifier = Modifier.height(24.dp))
|
Spacer(modifier = Modifier.height(24.dp))
|
||||||
commentEntity?.let {
|
commentEntity?.let {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(8.dp))
|
.clip(RoundedCornerShape(8.dp))
|
||||||
.background(Color(0xffeeeeee))
|
.background(
|
||||||
|
AppColors.nonActive)
|
||||||
|
|
||||||
.padding(8.dp)
|
.padding(8.dp)
|
||||||
) {
|
) {
|
||||||
@@ -1243,7 +1262,8 @@ fun CommentMenuModal(
|
|||||||
androidx.compose.material.Text(
|
androidx.compose.material.Text(
|
||||||
it.name,
|
it.name,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
fontSize = 16.sp
|
fontSize = 16.sp,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
@@ -1253,7 +1273,8 @@ fun CommentMenuModal(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.padding(start = 32.dp),
|
.padding(start = 32.dp),
|
||||||
overflow = TextOverflow.Ellipsis
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
color = AppColors.text
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer(modifier = Modifier.height(32.dp))
|
Spacer(modifier = Modifier.height(32.dp))
|
||||||
@@ -1323,7 +1344,7 @@ fun OrderSelectionComponent(
|
|||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.clip(RoundedCornerShape(8.dp))
|
.clip(RoundedCornerShape(8.dp))
|
||||||
.background(Color(0xFFEEEEEE))
|
.background(AppColors.nonActive)
|
||||||
|
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
@@ -1342,13 +1363,13 @@ fun OrderSelectionComponent(
|
|||||||
.background(
|
.background(
|
||||||
if (
|
if (
|
||||||
selectedOrder == order.first
|
selectedOrder == order.first
|
||||||
) Color.White else Color.Transparent
|
) AppColors.background else Color.Transparent
|
||||||
)
|
)
|
||||||
.padding(vertical = 2.dp, horizontal = 8.dp),
|
.padding(vertical = 2.dp, horizontal = 8.dp),
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
text = order.second,
|
text = order.second,
|
||||||
color = Color.Black,
|
color = AppColors.text,
|
||||||
fontSize = 12.sp
|
fontSize = 12.sp
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user