Skip to content

Commit

Permalink
finish show percentage on filetransfers
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Oct 29, 2024
1 parent 8dfd2e4 commit db03279
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/kotlin/com/zoffcc/applications/trifa2/ChatMessage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ fun outgoing_filetransfer(message: UIMessage, ui_scale: Float)
// filetransfer finished (either because of CANCEL or OK) ------------
} else // TOX_FILE_CONTROL_RESUME
{
Row(modifier = Modifier.fillMaxWidth())
Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically)
{
LinearProgressIndicator(
modifier = Modifier.weight(10.0f),
modifier = Modifier.weight(10.0f).height(8.dp),
progress = (message.currentfilepos.toFloat() / message.filesize.toFloat())
)
Text(modifier = Modifier.width(70.dp),
Text(modifier = Modifier.width(70.dp).padding(start = 15.dp),
text = "" + ((message.currentfilepos.toFloat() / message.filesize.toFloat()) * 100.0f).toLong() + "%")
}
Column(modifier = Modifier.fillMaxWidth()) {
Expand All @@ -402,13 +402,13 @@ fun incoming_filetransfer(message: UIMessage, ui_scale: Float)
{
if (is_filetransfer_in_progress(message))
{
Row(modifier = Modifier.fillMaxWidth())
Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically)
{
LinearProgressIndicator(
modifier = Modifier.weight(10.0f),
modifier = Modifier.weight(10.0f).height(8.dp),
progress = (message.currentfilepos.toFloat() / message.filesize.toFloat())
)
Text(modifier = Modifier.width(70.dp),
Text(modifier = Modifier.width(70.dp).padding(start = 15.dp),
text = "" + ((message.currentfilepos.toFloat() / message.filesize.toFloat()) * 100.0f).toLong() + "%")
}

Expand Down

0 comments on commit db03279

Please sign in to comment.