1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-26 22:31:16 +00:00

Also use Math.round() for folder percentage.

This commit is contained in:
Felix Ableitner 2016-02-08 21:36:53 +01:00
parent 89c3be2280
commit 3779b311fd

View file

@ -61,7 +61,7 @@ public class FoldersAdapter extends ArrayAdapter<RestApi.Folder>
directory.setText((folder.path));
if (model != null) {
int percentage = (model.globalBytes != 0)
? (int) Math.floor(100 * model.inSyncBytes / model.globalBytes)
? Math.round(100 * model.inSyncBytes / model.globalBytes)
: 100;
state.setText(getLocalizedState(getContext(), model.state, percentage));
items.setVisibility(VISIBLE);