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:
parent
bd7247d06d
commit
262a9c141d
3 changed files with 9 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 -> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue