Add the (Admin) info.
This commit is contained in:
parent
04e4316c3e
commit
4b60475821
3 changed files with 20 additions and 5 deletions
|
|
@ -30,6 +30,7 @@ class LeaveSpaceStateProvider : PreviewParameterProvider<LeaveSpaceState> {
|
||||||
persistentListOf(
|
persistentListOf(
|
||||||
aSelectableSpaceRoom(
|
aSelectableSpaceRoom(
|
||||||
spaceRoom = aSpaceRoom(
|
spaceRoom = aSpaceRoom(
|
||||||
|
name = "A long space name that should be truncated",
|
||||||
worldReadable = true,
|
worldReadable = true,
|
||||||
),
|
),
|
||||||
isLastAdmin = true,
|
isLastAdmin = true,
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.res.pluralStringResource
|
import androidx.compose.ui.res.pluralStringResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.semantics.Role
|
import androidx.compose.ui.semantics.Role
|
||||||
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import io.element.android.compound.theme.ElementTheme
|
import io.element.android.compound.theme.ElementTheme
|
||||||
|
|
@ -254,6 +255,7 @@ private fun SpaceItem(
|
||||||
color = ElementTheme.colors.textPrimary,
|
color = ElementTheme.colors.textPrimary,
|
||||||
style = ElementTheme.typography.fontBodyLgMedium,
|
style = ElementTheme.typography.fontBodyLgMedium,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
|
@ -280,15 +282,26 @@ private fun SpaceItem(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// Number of members
|
// Number of members
|
||||||
|
val subTitle = buildString {
|
||||||
|
append(
|
||||||
|
pluralStringResource(
|
||||||
|
CommonPlurals.common_member_count,
|
||||||
|
room.numJoinedMembers,
|
||||||
|
room.numJoinedMembers
|
||||||
|
)
|
||||||
|
)
|
||||||
|
if (selectableSpaceRoom.isLastAdmin) {
|
||||||
|
append(" ")
|
||||||
|
append(stringResource(R.string.screen_leave_space_last_admin_info))
|
||||||
|
}
|
||||||
|
}
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.padding(end = 16.dp),
|
modifier = Modifier.padding(end = 16.dp),
|
||||||
text = pluralStringResource(
|
text = subTitle,
|
||||||
CommonPlurals.common_member_count,
|
|
||||||
room.numJoinedMembers,
|
|
||||||
room.numJoinedMembers
|
|
||||||
),
|
|
||||||
color = ElementTheme.colors.textSecondary,
|
color = ElementTheme.colors.textSecondary,
|
||||||
style = ElementTheme.typography.fontBodyMdRegular,
|
style = ElementTheme.typography.fontBodyMdRegular,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
<string name="screen_leave_space_last_admin_info">"(Admin)"</string>
|
||||||
<plurals name="screen_leave_space_submit">
|
<plurals name="screen_leave_space_submit">
|
||||||
<item quantity="one">"Leave %1$d room and space"</item>
|
<item quantity="one">"Leave %1$d room and space"</item>
|
||||||
<item quantity="other">"Leave %1$d rooms and space"</item>
|
<item quantity="other">"Leave %1$d rooms and space"</item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue