1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-1886 Multispaces | Fix | Remote storage, colors (#559)

This commit is contained in:
Konstantin Ivanov 2023-11-16 14:11:22 +01:00 committed by uburoiubu
parent bd7247d06d
commit 262a9c141d
No known key found for this signature in database
GPG key ID: C8FB80E0A595FBB6
3 changed files with 9 additions and 4 deletions

View file

@ -290,10 +290,11 @@ class SpacesStorageViewModel(
otherSpaces.forEach { spaceUsage ->
otherSpacesUsages += spaceUsage.bytesUsage
}
val currentBytesUsage = currentSpace?.bytesUsage ?: 0L
result.add(
SegmentLegendItem.Active(
name = activeSpace?.name.orEmpty(),
usage = currentSpace?.bytesUsage?.readableFileSize().orEmpty(),
usage = currentBytesUsage.readableFileSize()
)
)
result.add(
@ -326,7 +327,11 @@ class SpacesStorageViewModel(
val items = allSpaces.map { s ->
val space = nodeSpaces.firstOrNull { it.space == s.targetSpaceId }
if (space == null) {
SegmentLineItem.Other(0F)
if (s.targetSpaceId == activeSpace.targetSpaceId) {
SegmentLineItem.Active(0F)
} else {
SegmentLineItem.Other(0F)
}
} else {
val value = space.bytesUsage.toFloat() / bytesLimit
if (space.space == activeSpace.targetSpaceId) {

View file

@ -52,7 +52,7 @@ fun SegmentLine(items: List<SpacesStorageViewModel.SegmentLineItem>) {
colorResource(id = R.color.palette_system_amber_125)
}
is SpacesStorageViewModel.SegmentLineItem.Free -> {
colorResource(id = R.color.shape_tertiary)
colorResource(id = R.color.shape_secondary)
}
is SpacesStorageViewModel.SegmentLineItem.Other -> {
colorResource(id = R.color.palette_system_amber_50)

View file

@ -154,7 +154,7 @@ private fun SegmentLegend(
}
is Free -> {
colorResource(id = R.color.shape_tertiary) to "Free | ${item.legend}"
colorResource(id = R.color.shape_secondary) to "Free | ${item.legend}"
}
is Other -> {