Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update Progress UI #196

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ private fun UploadProgressScreen(
horizontalAlignment = Alignment.CenterHorizontally,
) {
AdHeader(adScreenType)

Spacer(Modifier.height(Margin.Medium))
Text(stringResource(R.string.uploadProgressIndication))
Text(text = stringResource(R.string.uploadProgressIndication), style = SwissTransferTheme.typography.h2)
Spacer(Modifier.height(Margin.Mini))
Progress(progressState, totalSizeInBytes)
Spacer(Modifier.height(Margin.Huge))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.HumanReadableSizeUtils
import com.infomaniak.swisstransfer.workers.UploadWorker
import java.util.Locale
Expand All @@ -34,10 +35,23 @@ fun Progress(
totalSizeInBytes: Long,
) {
Row {

Percentage({ progressState().uploadedSize }, totalSizeInBytes)
Text(" - ")
UploadedSize({ progressState().uploadedSize })
Text(" / ")

Text(
text = " - ",
style = SwissTransferTheme.typography.labelRegular,
color = SwissTransferTheme.colors.secondaryTextColor,
)

UploadedSize { progressState().uploadedSize }

Text(
text = " / ",
style = SwissTransferTheme.typography.labelRegular,
color = SwissTransferTheme.colors.secondaryTextColor,
)

TotalSize(totalSizeInBytes)
}
}
Expand All @@ -51,7 +65,11 @@ private fun Percentage(uploadedSizeInBytes: () -> Long, totalSizeInBytes: Long)
}
}

Text("$percentageNoDecimals%")
Text(
text = "$percentageNoDecimals%",
style = SwissTransferTheme.typography.labelRegular,
color = SwissTransferTheme.colors.secondaryTextColor,
)
}

@Composable
Expand All @@ -61,7 +79,11 @@ private fun UploadedSize(uploadedSizeInBytes: () -> Long) {
derivedStateOf { HumanReadableSizeUtils.getHumanReadableSize(context, uploadedSizeInBytes()) }
}

Text(humanReadableSize)
Text(
text = humanReadableSize,
style = SwissTransferTheme.typography.labelRegular,
color = SwissTransferTheme.colors.secondaryTextColor,
)
}

@Composable
Expand All @@ -71,5 +93,9 @@ private fun TotalSize(totalSizeInBytes: Long) {
derivedStateOf { HumanReadableSizeUtils.getHumanReadableSize(context, totalSizeInBytes) }
}

Text(humanReadableTotalSize)
Text(
text = humanReadableTotalSize,
style = SwissTransferTheme.typography.labelRegular,
color = SwissTransferTheme.colors.secondaryTextColor,
)
}
Loading