compose: details: Add back download speed and time remaining text
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -316,7 +316,9 @@ private fun ScreenContentApp(
|
||||
inProgress = state.inProgress(),
|
||||
progress = state.progress(),
|
||||
onNavigateToDetailsDevProfile = { showExtraPane(Screen.DevProfile(it)) },
|
||||
isUpdatable = state is AppState.Updatable
|
||||
isUpdatable = state is AppState.Updatable,
|
||||
speed = if (state is AppState.Downloading) state.speed else 0,
|
||||
timeRemaining = if (state is AppState.Downloading) state.timeRemaining else 0
|
||||
)
|
||||
|
||||
SetupAppActions()
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.aurora.store.R
|
||||
import com.aurora.store.compose.composables.app.AnimatedAppIconComposable
|
||||
import com.aurora.store.compose.preview.AppPreviewProvider
|
||||
import com.aurora.store.compose.preview.coilPreviewProvider
|
||||
import com.aurora.store.util.CommonUtil
|
||||
import com.aurora.store.util.PackageUtil
|
||||
|
||||
/**
|
||||
@@ -47,6 +48,8 @@ fun AppDetails(
|
||||
inProgress: Boolean = false,
|
||||
onNavigateToDetailsDevProfile: (developerName: String) -> Unit = {},
|
||||
isUpdatable: Boolean = false,
|
||||
speed: Long = 0,
|
||||
timeRemaining: Long = 0
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
||||
@@ -87,6 +90,15 @@ fun AppDetails(
|
||||
},
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
Text(
|
||||
text = if (inProgress) {
|
||||
CommonUtil.getDownloadSpeedString(context, speed) +
|
||||
", " + CommonUtil.getETAString(context, timeRemaining)
|
||||
} else {
|
||||
""
|
||||
},
|
||||
style = MaterialTheme.typography.bodySmall
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user