Skip to content

Commit 71a27c4

Browse files
authored
Merge pull request #1095 from Daily-DAYO/qa/setting-block
Blocked Users screen UI based on Design QA
2 parents 2b8da49 + 172ddbd commit 71a27c4

4 files changed

Lines changed: 73 additions & 88 deletions

File tree

presentation/src/main/java/daily/dayo/presentation/screen/settings/BlockedUsersScreen.kt

Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.content.Context
44
import androidx.compose.foundation.Image
55
import androidx.compose.foundation.background
66
import androidx.compose.foundation.layout.Arrangement
7+
import androidx.compose.foundation.layout.Box
78
import androidx.compose.foundation.layout.Column
89
import androidx.compose.foundation.layout.PaddingValues
910
import androidx.compose.foundation.layout.Row
@@ -49,6 +50,7 @@ import daily.dayo.presentation.view.FilledRoundedCornerButton
4950
import daily.dayo.presentation.view.NoRippleIconButton
5051
import daily.dayo.presentation.view.RoundImageView
5152
import daily.dayo.presentation.view.TopNavigation
53+
import daily.dayo.presentation.view.TopNavigationAlign
5254
import daily.dayo.presentation.viewmodel.ProfileSettingViewModel
5355
import daily.dayo.presentation.viewmodel.ProfileViewModel
5456
import kotlinx.coroutines.launch
@@ -96,19 +98,25 @@ fun BlockedUsersScreen(
9698
topBar = { BlockedUsersActionbarLayout(onBackClick = onBackClick) },
9799
snackbarHost = { SnackbarHost(snackBarHostState) },
98100
content = { innerPadding ->
99-
Column(
101+
Box(
100102
modifier = Modifier
101103
.background(DayoTheme.colorScheme.background)
102104
.padding(innerPadding)
103105
.fillMaxSize()
104-
.padding(top = 12.dp, start = 20.dp, end = 20.dp)
106+
.padding(top = 12.dp)
105107
) {
106-
LazyColumn(
107-
modifier = Modifier.fillMaxSize(),
108-
verticalArrangement = Arrangement.spacedBy(16.dp),
109-
contentPadding = PaddingValues(vertical = 16.dp)
110-
) {
111-
if (blockedUsers.status != Status.ERROR) {
108+
if (blockedUsers.status == Status.ERROR) {
109+
BlockedUsersErrorLayout(
110+
onRetry = { profileSettingViewModel.requestBlockList() },
111+
)
112+
} else {
113+
LazyColumn(
114+
modifier = Modifier
115+
.fillMaxSize()
116+
.padding(start = 20.dp, end = 20.dp),
117+
verticalArrangement = Arrangement.spacedBy(16.dp),
118+
contentPadding = PaddingValues(vertical = 16.dp)
119+
) {
112120
blockedUsers.data.orEmpty().let { blockedUsers ->
113121
if (blockedUsers.isEmpty()) {
114122
item {
@@ -159,48 +167,57 @@ fun BlockedUsersScreen(
159167
}
160168
}
161169
}
162-
} else {
163-
item {
164-
Column(
165-
modifier = Modifier
166-
.fillMaxSize()
167-
.padding(top = 164.dp),
168-
horizontalAlignment = Alignment.CenterHorizontally,
169-
verticalArrangement = Arrangement.Center
170-
) {
171-
Image(
172-
painter = painterResource(id = R.drawable.ic_blocked_users_empty),
173-
contentDescription = null,
174-
modifier = Modifier
175-
.width(136.dp)
176-
.wrapContentHeight()
177-
.padding(6.5.dp)
178-
)
179-
Spacer(modifier = Modifier.height(20.dp))
180-
Text(
181-
text = stringResource(R.string.blocked_users_error_description),
182-
color = Gray3_9FA5AE,
183-
style = DayoTheme.typography.b3,
184-
modifier = Modifier
185-
.wrapContentSize()
186-
)
187-
Spacer(modifier = Modifier.height(20.dp))
188-
FilledRoundedCornerButton(
189-
modifier = Modifier
190-
.padding(horizontal = 20.dp)
191-
.wrapContentSize(),
192-
onClick = { profileSettingViewModel.requestBlockList() },
193-
label = stringResource(R.string.re_try)
194-
)
195-
}
196-
}
197170
}
198171
}
199172
}
200173
}
201174
)
202175
}
203176

177+
@Composable
178+
private fun BlockedUsersErrorLayout(
179+
onRetry: () -> Unit,
180+
) {
181+
Column(
182+
modifier = Modifier
183+
.fillMaxSize()
184+
.padding(horizontal = 20.dp),
185+
horizontalAlignment = Alignment.CenterHorizontally,
186+
) {
187+
Spacer(modifier = Modifier.weight(176f))
188+
189+
Column(
190+
modifier = Modifier.wrapContentHeight(),
191+
horizontalAlignment = Alignment.CenterHorizontally,
192+
) {
193+
Image(
194+
painter = painterResource(id = R.drawable.ic_blocked_users_empty),
195+
contentDescription = null,
196+
modifier = Modifier
197+
.width(136.dp)
198+
.height(100.dp)
199+
)
200+
Spacer(modifier = Modifier.height(20.dp))
201+
Text(
202+
text = stringResource(R.string.blocked_users_error_description),
203+
style = DayoTheme.typography.h3.copy(color = Gray3_9FA5AE),
204+
modifier = Modifier.wrapContentSize()
205+
)
206+
}
207+
208+
Spacer(modifier = Modifier.weight(336f))
209+
210+
FilledRoundedCornerButton(
211+
modifier = Modifier
212+
.fillMaxWidth()
213+
.height(52.dp)
214+
.padding(bottom = 20.dp),
215+
onClick = onRetry,
216+
label = stringResource(R.string.re_try),
217+
)
218+
}
219+
}
220+
204221
@Preview
205222
@Composable
206223
fun BlockedUser(
@@ -261,5 +278,6 @@ fun BlockedUsersActionbarLayout(
261278
)
262279
},
263280
title = stringResource(R.string.blocked_users_title),
281+
titleAlignment = TopNavigationAlign.CENTER,
264282
)
265-
}
283+
}

presentation/src/main/java/daily/dayo/presentation/view/TopNavigation.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fun TopNavigation(
4040
navigationIcon = leftIcon,
4141
actions = { rightIcon() },
4242
title = {
43-
Text(text = title, maxLines = 1, style = DayoTheme.typography.h3)
43+
Text(text = title, maxLines = 1, style = DayoTheme.typography.b3)
4444
}
4545
)
4646
}
@@ -55,7 +55,7 @@ fun TopNavigation(
5555
navigationIcon = leftIcon,
5656
actions = { rightIcon() },
5757
title = {
58-
Text(text = title, maxLines = 1, style = DayoTheme.typography.h3)
58+
Text(text = title, maxLines = 1, style = DayoTheme.typography.b3)
5959
}
6060
)
6161
}
Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,9 @@
1-
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2-
android:width="137dp"
3-
android:height="100dp"
4-
android:autoMirrored="true"
5-
android:viewportWidth="137"
6-
android:viewportHeight="100">
7-
8-
<group>
9-
10-
<clip-path android:pathData="M20.5,6h96.91v88.3h-96.91z" />
11-
12-
<path
13-
android:fillColor="#F6F6F7"
14-
android:pathData="M68.95,94.31C95.71,94.31 117.4,91.57 117.4,88.18C117.4,84.8 95.71,82.05 68.95,82.05C42.19,82.05 20.5,84.8 20.5,88.18C20.5,91.57 42.19,94.31 68.95,94.31Z" />
15-
16-
<path
17-
android:fillColor="#ffffff"
18-
android:pathData="M57.12,63.96C70.36,63.96 81.1,53.22 81.1,39.98C81.1,26.74 70.36,16 57.12,16C43.88,16 33.14,26.74 33.14,39.98C33.14,53.22 43.88,63.96 57.12,63.96Z" />
19-
20-
<path
21-
android:fillColor="#E8EAEE"
22-
android:pathData="M106.02,80.38L94.58,68.94C90.4,64.76 85.73,61.05 80.7,57.93L80.03,57.51L74.67,62.88L75.09,63.55C78.21,68.57 81.92,73.24 86.1,77.43L97.54,88.87C98.23,89.56 99.15,89.94 100.13,89.94C101.11,89.94 102.03,89.56 102.72,88.87L106.03,85.56C107.46,84.13 107.46,81.81 106.03,80.38H106.02Z" />
23-
24-
<path
25-
android:fillColor="#F6F6F7"
26-
android:pathData="M94.58,68.94C90.4,64.76 85.73,61.05 80.7,57.93L80.03,57.51L74.67,62.88L75.09,63.55C78.21,68.57 81.92,73.24 86.1,77.43L94.58,68.95V68.94Z" />
27-
28-
<path
29-
android:fillColor="#F6F6F7"
30-
android:pathData="M57.12,73.97C38.38,73.97 23.13,58.72 23.13,39.99C23.13,21.26 38.38,6 57.12,6C75.86,6 91.1,21.25 91.1,39.99C91.1,49.07 87.56,57.6 81.15,64.02C74.74,70.44 66.2,73.97 57.12,73.97ZM57.12,16C43.89,16 33.13,26.76 33.13,39.99C33.13,53.22 43.89,63.97 57.12,63.97C63.53,63.97 69.55,61.48 74.08,56.95C78.61,52.42 81.1,46.4 81.1,39.99C81.1,26.76 70.34,16 57.12,16Z" />
31-
32-
<path
33-
android:fillColor="#E8EAEE"
34-
android:pathData="M50.23,28.59L45.99,32.83L64.54,51.39L68.79,47.15L50.23,28.59Z" />
35-
36-
<path
37-
android:fillColor="#E8EAEE"
38-
android:pathData="M64.54,28.59L45.99,47.15L50.23,51.39L68.79,32.83L64.54,28.59Z" />
39-
40-
</group>
41-
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="100dp" android:viewportHeight="100" android:viewportWidth="136" android:width="136dp">
2+
3+
<path android:fillColor="#F6F6F7" android:pathData="M100.33,50.42C100.33,32.58 85.88,18.13 68.04,18.13C50.21,18.13 35.75,32.58 35.75,50.42C35.75,68.25 50.21,82.71 68.04,82.71C85.88,82.71 100.33,68.25 100.33,50.42ZM106.58,50.42C106.58,71.7 89.33,88.96 68.04,88.96C46.76,88.96 29.5,71.7 29.5,50.42C29.5,29.13 46.76,11.88 68.04,11.88C89.33,11.88 106.58,29.13 106.58,50.42Z" android:strokeColor="#F6F6F7" android:strokeWidth="3"/>
4+
5+
<path android:fillColor="#E8EAEE" android:pathData="M68.12,72.25C70.61,72.25 72.62,70.23 72.62,67.75C72.62,65.26 70.61,63.25 68.12,63.25C65.64,63.25 63.63,65.26 63.63,67.75C63.63,70.23 65.64,72.25 68.12,72.25Z" android:strokeColor="#E8EAEE" android:strokeWidth="1"/>
6+
7+
<path android:fillColor="#E8EAEE" android:pathData="M65,54V33C65,31.27 66.39,29.88 68.12,29.88C69.85,29.88 71.25,31.27 71.25,33V54L71.24,54.16C71.16,55.81 69.79,57.13 68.12,57.13C66.45,57.13 65.08,55.81 65,54.16L65,54Z" android:strokeColor="#E8EAEE" android:strokeLineCap="round" android:strokeWidth="2"/>
8+
429
</vector>

presentation/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<string name="loading_default_message">잠시만 기다려 주세요</string>
2929
<string name="network_error_dialog_default_message">인터넷 연결 상태를 확인해주세요</string>
3030
<string name="close_sign">닫기</string>
31-
<string name="re_try">재시도</string>
31+
<string name="re_try">다시 시도</string>
3232

3333
<!-- Time -->
3434
<string name="time_now">방금 전</string>

0 commit comments

Comments
 (0)