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

Don't show "0%" at the beginning when being added as second device #3409

Merged
merged 1 commit into from
Nov 5, 2024
Merged
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 @@ -84,7 +84,8 @@ public void handleEvent(@NonNull DcEvent event) {
} else if (permille < 1000) {
percent = permille/10;
percentMax = 100;
statusLineText = getString(R.string.transferring) + String.format(Util.getLocale(), " %d%%", percent);
String formattedPercent = percent > 0 ? String.format(Util.getLocale(), " %d%%", percent) : "";
statusLineText = getString(R.string.transferring) + formattedPercent;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, not related to this PR but this string concatenation is not good, for RTL languages it will not be mirrored properly 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The good news is that it's not a sentence, so that it's not that bad if the order is wrong for RTL messages. I.e. "10% Transferring..." and "Transferring... 10%" is both right.

hideSameNetworkHint = true;
} else if (permille == 1000) {
getTransferActivity().setTransferState(BackupTransferActivity.TransferState.TRANSFER_SUCCESS);
Expand Down
Loading