Skip to content

Commit f8af49f

Browse files
authored
fix(groups): inset Requests headers and lead Join Requests with the key note (#1766)
The Requests screen's "Waiting on you" and "Sent" headers sat flush with the screen edge: SectionHeader sets only vertical padding. They now take the rows' inset. Join Requests showed "Approving shares the group key with them from this device." under the list. iOS shows it above the rows, so it is read before Approve; Android now does the same, with iOS's 4/12 spacing.
1 parent dd1f565 commit f8af49f

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

‎apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/profile/JoinRequestsScreen.kt‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@ internal fun JoinRequestsScreen(viewModel: ChatViewModel) {
104104
.padding(innerPadding),
105105
contentPadding = PaddingValues(vertical = CodeTheme.dimens.grid.x2),
106106
) {
107+
// Above the rows, as on iOS, so it's read before Approve and scrolls away with the list.
108+
item {
109+
Text(
110+
modifier = Modifier
111+
.fillMaxWidth()
112+
.padding(horizontal = CodeTheme.dimens.inset)
113+
.padding(top = CodeTheme.dimens.grid.x1, bottom = CodeTheme.dimens.grid.x3),
114+
text = stringResource(R.string.subtitle_joinRequestsFooter),
115+
style = CodeTheme.typography.caption,
116+
color = CodeTheme.colors.textSecondary,
117+
textAlign = TextAlign.Center,
118+
)
119+
}
107120
items(state.joinRequests, key = { it.publicKey.byteArray.toList() }) { member ->
108121
val userId = member.userProfile.userId
109122
JoinRequestRow(
@@ -124,18 +137,6 @@ internal fun JoinRequestsScreen(viewModel: ChatViewModel) {
124137
onApprove = { viewModel.dispatchEvent(ChatViewModel.Event.ApproveJoinRequest(member)) },
125138
)
126139
}
127-
item {
128-
Text(
129-
modifier = Modifier
130-
.fillMaxWidth()
131-
.padding(horizontal = CodeTheme.dimens.inset)
132-
.padding(top = CodeTheme.dimens.grid.x10),
133-
text = stringResource(R.string.subtitle_joinRequestsFooter),
134-
style = CodeTheme.typography.caption,
135-
color = CodeTheme.colors.textSecondary,
136-
textAlign = TextAlign.Center,
137-
)
138-
}
139140
}
140141
}
141142
}

‎apps/flipcash/features/tipping/src/main/kotlin/com/flipcash/app/tipping/RequestsScreen.kt‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ fun RequestsScreen() {
113113
if (state.hosted.isNotEmpty()) {
114114
item(key = "hosted_header") {
115115
SectionHeader(
116-
modifier = Modifier.animateItem(),
116+
// The rows' inset: SectionHeader sets only vertical padding.
117+
modifier = Modifier
118+
.animateItem()
119+
.padding(horizontal = CodeTheme.dimens.inset),
117120
title = stringResource(R.string.header_waitingOnYou),
118121
)
119122
}
@@ -136,7 +139,10 @@ fun RequestsScreen() {
136139
if (state.sent.isNotEmpty()) {
137140
item(key = "sent_header") {
138141
SectionHeader(
139-
modifier = Modifier.animateItem(),
142+
// The rows' inset: SectionHeader sets only vertical padding.
143+
modifier = Modifier
144+
.animateItem()
145+
.padding(horizontal = CodeTheme.dimens.inset),
140146
title = stringResource(R.string.header_sentRequests),
141147
)
142148
}

0 commit comments

Comments
 (0)