Improve rendering of cache size (and fix compilation issue)

This commit is contained in:
Benoit Marty 2023-06-20 15:26:16 +02:00 committed by Benoit Marty
parent c847ac3a98
commit 573de1c168
10 changed files with 22 additions and 17 deletions

View file

@ -26,7 +26,9 @@ import io.element.android.libraries.di.ApplicationContext
import javax.inject.Inject
@ContributesBinding(AppScope::class)
class AndroidFileSizeFormatter @Inject constructor(@ApplicationContext private val context: Context) : FileSizeFormatter {
class AndroidFileSizeFormatter @Inject constructor(
@ApplicationContext private val context: Context,
) : FileSizeFormatter {
override fun format(fileSize: Long, useShortFormat: Boolean): String {
// Since Android O, the system considers that 1ko = 1000 bytes instead of 1024 bytes.
// We want to avoid that.