调整布局和边距

This commit is contained in:
2024-10-13 02:44:22 +08:00
parent 7ec5abe362
commit f6e763cb3f
11 changed files with 121 additions and 50 deletions

View File

@@ -5,9 +5,9 @@ import android.content.Context
object ConstVars {
// api 地址
// const val BASE_SERVER = "http://192.168.31.130: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://rider-pro.aiosman.com/beta_api"
const val BASE_SERVER = "https://rider-pro.aiosman.com/beta_api"
const val MOMENT_LIKE_CHANNEL_ID = "moment_like"
const val MOMENT_LIKE_CHANNEL_NAME = "Moment Like"

View File

@@ -109,17 +109,17 @@ fun AccountEditScreen2() {
)
}
}
Spacer(modifier = Modifier.height(32.dp))
Spacer(modifier = Modifier.height(44.dp))
model.profile?.let {
Box(
modifier = Modifier.size(112.dp),
modifier = Modifier.size(88.dp),
contentAlignment = Alignment.Center
) {
CustomAsyncImage(
context,
model.croppedBitmap ?: it.avatar,
modifier = Modifier
.size(112.dp)
.size(88.dp)
.clip(
RoundedCornerShape(88.dp)
),
@@ -145,7 +145,7 @@ fun AccountEditScreen2() {
}
}
Spacer(modifier = Modifier.height(46.dp))
Spacer(modifier = Modifier.height(58.dp))
Column(
modifier = Modifier
.weight(1f)
@@ -160,7 +160,7 @@ fun AccountEditScreen2() {
) { value ->
onNicknameChange(value)
}
Spacer(modifier = Modifier.height(16.dp))
// Spacer(modifier = Modifier.height(16.dp))
FormTextInput(
value = model.bio,
label = stringResource(R.string.bio),

View File

@@ -45,7 +45,7 @@ fun FormTextInput(
) {
Row(
modifier = Modifier.fillMaxWidth()
.clip(RoundedCornerShape(24.dp))
.clip(RoundedCornerShape(16.dp))
.background(Color(0xfff8f8f8))
.let {
if (error != null) {
@@ -54,7 +54,7 @@ fun FormTextInput(
it
}
}
.padding(16.dp),
.padding(17.dp),
verticalAlignment = Alignment.CenterVertically
) {
label?.let {

View File

@@ -1,5 +1,6 @@
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -73,14 +74,17 @@ fun ImageViewer() {
StatusBarMaskLayout(
modifier = Modifier.background(Color.Black),
) {
Box(
Column(
modifier = Modifier
.fillMaxSize()
.background(Color.Black)
.background(Color.Black),
horizontalAlignment = Alignment.CenterHorizontally
) {
HorizontalPager(
state = pagerState,
modifier = Modifier.fillMaxSize(),
modifier = Modifier
.fillMaxWidth()
.weight(0.8f),
) { page ->
val zoomState = rememberZoomState()
CustomAsyncImage(
@@ -94,32 +98,30 @@ fun ImageViewer() {
onTap = {
navController.popBackStack()
}
),
)
,
contentScale = ContentScale.Fit,
)
}
if (images.size > 1) {
Box(
modifier = Modifier
.align(Alignment.TopCenter)
.clip(RoundedCornerShape(16.dp))
.background(Color(0xff333333).copy(alpha = 0.6f))
.padding(vertical = 4.dp, horizontal = 24.dp)
) {
Text(
text = "${pagerState.currentPage + 1}/${images.size}",
color = Color.White,
Box(modifier = Modifier.padding(top = 10.dp, bottom = 10.dp)){
if (images.size > 1) {
Box(
modifier = Modifier
.clip(RoundedCornerShape(16.dp))
.background(Color(0xff333333).copy(alpha = 0.6f))
.padding(vertical = 4.dp, horizontal = 24.dp)
) {
Text(
text = "${pagerState.currentPage + 1}/${images.size}",
color = Color.White,
)
}
}
}
Box(
modifier = Modifier
.fillMaxWidth()
.align(Alignment.BottomCenter)
.weight(0.2f)
.background(
Brush.verticalGradient(
colors = listOf(
@@ -133,13 +135,15 @@ fun ImageViewer() {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(start = 72.dp, end = 72.dp)
.padding(top = 16.dp),
horizontalArrangement = Arrangement.Center
) {
Column(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.noRippleClickable {
modifier = Modifier
.noRippleClickable {
if (isDownloading) {
return@noRippleClickable
}
@@ -157,7 +161,7 @@ fun ImageViewer() {
)
} else {
Icon(
painter = painterResource(id = R.drawable.rider_pro_download),
painter = painterResource(id = R.drawable.rider_pro_download_icon),
contentDescription = "",
modifier = Modifier.size(32.dp),
tint = Color.White
@@ -171,7 +175,9 @@ fun ImageViewer() {
)
}
if (!showRawImageStates[pagerState.currentPage]) {
Spacer(modifier = Modifier.width(32.dp))
Spacer(modifier = Modifier.weight(1f))
}
if (!showRawImageStates[pagerState.currentPage]) {
Column(
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
@@ -180,7 +186,7 @@ fun ImageViewer() {
}
) {
Icon(
painter = painterResource(id = R.drawable.rider_pro_raw),
painter = painterResource(id = R.drawable.rider_pro_original_raw),
contentDescription = "",
modifier = Modifier.size(32.dp),
tint = Color.White

View File

@@ -5,6 +5,7 @@ import androidx.compose.animation.ExperimentalSharedTransitionApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
@@ -30,6 +31,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.rememberPagerState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Build
@@ -52,6 +54,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
@@ -142,12 +145,12 @@ fun MomentsList() {
}
}
)
Box(
modifier = Modifier
.height(4.dp)
.fillMaxWidth()
.background(Color(0xFFF0F2F5))
)
// Box(
// modifier = Modifier
// .height(4.dp)
// .fillMaxWidth()
// .background(Color(0xFFF0F2F5))
// )
}
}
PullRefreshIndicator(model.refreshing, state, Modifier.align(Alignment.TopCenter))
@@ -169,7 +172,7 @@ fun MomentCard(
modifier = Modifier.fillMaxWidth()
) {
Box(
modifier = Modifier.padding(start = 24.dp, end = 24.dp, top = 16.dp, bottom = 8.dp)
modifier = Modifier.padding(start = 16.dp, end = 16.dp, top = 16.dp, bottom = 8.dp)
) {
MomentTopRowGroup(momentEntity = momentEntity)
}
@@ -322,6 +325,7 @@ fun MomentTopRowGroup(momentEntity: MomentEntity) {
contentDescription = "",
modifier = Modifier
.size(40.dp)
.clip(RoundedCornerShape(40.dp))
.noRippleClickable {
navController.navigate(
NavigationRoute.AccountProfile.route.replace(
@@ -408,7 +412,7 @@ fun MomentContentGroup(
text = momentEntity.momentTextContent,
modifier = Modifier
.fillMaxWidth()
.padding(start = 24.dp, end = 24.dp, bottom = 8.dp),
.padding(start = 16.dp, end = 16.dp, bottom = 8.dp),
fontSize = 16.sp
)
}
@@ -511,7 +515,7 @@ fun MomentBottomOperateRowGroup(
modifier = Modifier
.fillMaxWidth()
.height(56.dp)
.padding(horizontal = 16.dp)
.padding(start = 16.dp, end = 0.dp)
) {
Row(
modifier = Modifier.fillMaxSize()
@@ -544,14 +548,15 @@ fun MomentBottomOperateRowGroup(
count = momentEntity.commentCount.toString()
)
}
Spacer(modifier = Modifier.weight(1f))
Box(
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight()
.noRippleClickable {
onFavoriteClick()
},
contentAlignment = Alignment.Center
contentAlignment = Alignment.CenterEnd
) {
MomentOperateBtn(count = momentEntity.favoriteCount.toString()) {
AnimatedFavouriteIcon(

View File

@@ -305,7 +305,7 @@ fun ProfileV3(
UserItem(it)
}
}
Spacer(modifier = Modifier.height(16.dp))
Spacer(modifier = Modifier.height(20.dp))
profile?.let {
Box(
modifier = Modifier.padding(horizontal = 16.dp)

View File

@@ -79,7 +79,7 @@ fun DiscoverScreen() {
SearchButton(
modifier = Modifier
.fillMaxWidth()
.padding(top = 16.dp, start = 24.dp, end = 24.dp),
.padding(top = 16.dp, start = 16.dp, end = 16.dp),
) {
SearchViewModel.requestFocus = true
navController.navigate(NavigationRoute.Search.route)
@@ -106,7 +106,7 @@ fun SearchButton(
Box(
modifier = modifier
.clip(shape = RoundedCornerShape(8.dp))
.background(Color(0xFFEEEEEE))
.background(Color(0xFFF4F5F6))
.padding(horizontal = 16.dp, vertical = 12.dp)
.noRippleClickable {
clickAction()
@@ -150,6 +150,7 @@ fun DiscoverView() {
.fillMaxWidth()
.aspectRatio(1f)
.padding(2.dp)
.clip(RoundedCornerShape(8.dp))
.noRippleClickable {
navController.navigateToPost(
id = momentItem.id,

View File

@@ -2,6 +2,7 @@ package com.aiosman.riderpro.ui.index.tabs.search
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
@@ -106,7 +107,7 @@ fun SearchScreen() {
) {
Spacer(modifier = Modifier.height(statusBarPaddingValues.calculateTopPadding()))
Row(
modifier = Modifier.padding(top = 16.dp, start = 24.dp, end = 24.dp),
modifier = Modifier.padding(top = 16.dp, start = 16.dp, end = 16.dp),
verticalAlignment = Alignment.CenterVertically
) {
SearchInput(
@@ -169,7 +170,7 @@ fun SearchInput(
val context = LocalContext.current
Box(
modifier = modifier
.clip(shape = RoundedCornerShape(16.dp))
.clip(shape = RoundedCornerShape(8.dp))
.background(Color(0xFFF4F5F6))
.padding(horizontal = 16.dp, vertical = 12.dp)
) {

View File

@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12.003,3L12.003,17.25"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeLineCap="round"/>
<path
android:pathData="M5.25,10.5l6.75,6.75l6.75,-6.75"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeLineCap="round"/>
<path
android:pathData="M3.75,20.253L20.25,20.253"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeLineCap="round"/>
</vector>

View File

@@ -0,0 +1,28 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M15,15C15.552,15 16,15.448 16,16L16,21C16,21.552 15.552,22 15,22L3,22C2.448,22 2,21.552 2,21L2,16C2,15.448 2.448,15 3,15L15,15ZM5.321,17L4,17L4,20.555L4.732,20.555L4.732,19.253L5.316,19.253L5.982,20.555L6.769,20.555L6.769,20.521L6,19.068C6.213,18.972 6.372,18.843 6.477,18.681C6.582,18.519 6.634,18.317 6.634,18.074C6.634,17.732 6.52,17.468 6.292,17.281C6.065,17.094 5.741,17 5.321,17ZM8.893,17L8.214,17L6.891,20.555L7.669,20.555L7.914,19.822L9.198,19.822L9.444,20.555L10.223,20.555L8.893,17ZM10.958,17L10.228,17L11.017,20.555L11.754,20.555L12.333,18.177L12.911,20.555L13.648,20.555L14.437,17L13.707,17L13.229,19.529L12.645,17L12.025,17L11.439,19.524L10.958,17ZM8.553,17.898L9,19.229L8.111,19.229L8.553,17.898ZM5.321,17.593C5.518,17.593 5.664,17.641 5.759,17.737C5.854,17.833 5.902,17.965 5.902,18.133C5.902,18.297 5.851,18.426 5.75,18.52C5.65,18.613 5.507,18.66 5.323,18.66L4.732,18.66L4.732,17.593Z"
android:strokeWidth="1"
android:fillColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeColor="#00000000"/>
<path
android:pathData="M14.25,3l0,5.25l5.25,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeLineCap="round"/>
<path
android:pathData="M18,21L18.75,21C19.164,21 19.5,20.664 19.5,20.25L19.5,8.25L14.25,3L5.25,3C4.836,3 4.5,3.336 4.5,3.75L4.5,12.75"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="#FFFFFF"
android:fillType="evenOdd"
android:strokeLineCap="round"/>
</vector>

View File

@@ -19,7 +19,7 @@
<string name="follow_upper">FOLLOW</string>
<string name="login_upper">Log in</string>
<string name="lets_ride_upper">Let\'s Ride</string>
<string name="or_login_with">or login with</string>
<string name="or_login_with">or</string>
<string name="remember_me">Remember me.</string>
<string name="forgot_password">Forgot password?</string>
<string name="login_password_label">What\'s your password</string>