修正展示用户搜索结果时的布局错误
This commit is contained in:
@@ -44,6 +44,7 @@ fun ActionButton(
|
||||
loadingBackgroundColor: Color = Color(0xFFD95757),
|
||||
disabledBackgroundColor: Color = Color(0xFFD0D0D0),
|
||||
enabled: Boolean = true,
|
||||
fullWidth:Boolean = false,
|
||||
click: () -> Unit = {}
|
||||
) {
|
||||
val animatedBackgroundColor by animateColorAsState(
|
||||
@@ -76,7 +77,13 @@ fun ActionButton(
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.align(Alignment.Center)
|
||||
.fillMaxWidth(),
|
||||
.let {
|
||||
if(fullWidth){
|
||||
it.fillMaxWidth()
|
||||
}else{
|
||||
it
|
||||
}
|
||||
},
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Box(modifier = Modifier.align(Alignment.CenterStart)){
|
||||
@@ -93,7 +100,13 @@ fun ActionButton(
|
||||
}else{
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.let {
|
||||
if(fullWidth){
|
||||
it.fillMaxWidth()
|
||||
}else{
|
||||
it
|
||||
}
|
||||
}
|
||||
.padding(horizontal = 16.dp),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.navigationBars
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.systemBars
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.pager.HorizontalPager
|
||||
import androidx.compose.foundation.pager.PagerState
|
||||
@@ -322,7 +323,7 @@ fun UserItem(
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Text(text = accountProfile.nickName, fontSize = 16.sp, fontWeight = FontWeight.Bold)
|
||||
Spacer(modifier = Modifier.padding(2.dp))
|
||||
Spacer(modifier = Modifier.width(2.dp))
|
||||
Text(
|
||||
text = stringResource(
|
||||
R.string.search_user_item_follower_count,
|
||||
@@ -330,32 +331,34 @@ fun UserItem(
|
||||
), fontSize = 14.sp, color = Color(0xFF9E9E9E)
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.padding(8.dp))
|
||||
if (accountProfile.id != AppState.UserId) {
|
||||
if (accountProfile.isFollowing) {
|
||||
ActionButton(
|
||||
text = stringResource(R.string.following_upper),
|
||||
backgroundColor = Color(0xFF9E9E9E),
|
||||
contentPadding = PaddingValues(vertical = 4.dp, horizontal = 8.dp),
|
||||
color = Color.White
|
||||
) {
|
||||
onFollow(accountProfile)
|
||||
}
|
||||
} else {
|
||||
ActionButton(
|
||||
text = stringResource(R.string.follow_upper),
|
||||
backgroundColor = Color(0xffda3832),
|
||||
contentPadding = PaddingValues(vertical = 4.dp, horizontal = 8.dp),
|
||||
color = Color.White
|
||||
) {
|
||||
onFollow(accountProfile)
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
Box(
|
||||
modifier = Modifier
|
||||
) {
|
||||
if (accountProfile.id != AppState.UserId) {
|
||||
if (accountProfile.isFollowing) {
|
||||
ActionButton(
|
||||
text = stringResource(R.string.following_upper),
|
||||
backgroundColor = Color(0xFF9E9E9E),
|
||||
contentPadding = PaddingValues(vertical = 4.dp, horizontal = 8.dp),
|
||||
color = Color.White,
|
||||
fullWidth = false
|
||||
) {
|
||||
onFollow(accountProfile)
|
||||
}
|
||||
} else {
|
||||
ActionButton(
|
||||
text = stringResource(R.string.follow_upper),
|
||||
backgroundColor = Color(0xffda3832),
|
||||
contentPadding = PaddingValues(vertical = 4.dp, horizontal = 8.dp),
|
||||
color = Color.White,
|
||||
fullWidth = false
|
||||
) {
|
||||
onFollow(accountProfile)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user