From 5733d95fa589ecd56e69f03daab33401a4ad6096 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 8 Feb 2016 21:54:55 +0100 Subject: [PATCH] Fixed string formatting warnings. --- .../com/nutomic/syncthingandroid/util/DevicesAdapter.java | 4 ++-- .../com/nutomic/syncthingandroid/util/FoldersAdapter.java | 5 +++-- src/main/res/values/strings.xml | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/nutomic/syncthingandroid/util/DevicesAdapter.java b/src/main/java/com/nutomic/syncthingandroid/util/DevicesAdapter.java index 241b4c15..72045356 100644 --- a/src/main/java/com/nutomic/syncthingandroid/util/DevicesAdapter.java +++ b/src/main/java/com/nutomic/syncthingandroid/util/DevicesAdapter.java @@ -69,8 +69,8 @@ public class DevicesAdapter extends ArrayAdapter upload.setText(RestApi.readableTransferRate(getContext(), conn.outBits)); } else { - download.setText("0 " + r.getStringArray(R.array.transfer_rate_units)[0]); - upload.setText("0 " + r.getStringArray(R.array.transfer_rate_units)[0]); + download.setText(RestApi.readableTransferRate(getContext(), 0)); + upload.setText(RestApi.readableTransferRate(getContext(), 0)); status.setText(r.getString(R.string.device_disconnected)); status.setTextColor(r.getColor(R.color.text_red)); } diff --git a/src/main/java/com/nutomic/syncthingandroid/util/FoldersAdapter.java b/src/main/java/com/nutomic/syncthingandroid/util/FoldersAdapter.java index c14ae24f..c0ec3df1 100644 --- a/src/main/java/com/nutomic/syncthingandroid/util/FoldersAdapter.java +++ b/src/main/java/com/nutomic/syncthingandroid/util/FoldersAdapter.java @@ -68,8 +68,9 @@ public class FoldersAdapter extends ArrayAdapter items.setText(getContext() .getString(R.string.files, model.inSyncFiles, model.globalFiles)); size.setVisibility(VISIBLE); - size.setText(readableFileSize(getContext(), model.inSyncBytes) + " / " + - readableFileSize(getContext(), model.globalBytes)); + size.setText(getContext().getString(R.string.folder_size_format, + readableFileSize(getContext(), model.inSyncBytes), + readableFileSize(getContext(), model.globalBytes))); if (TextUtils.isEmpty(folder.invalid)) { setTextOrHide(invalid, model.invalid); } diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 94384214..d59c7f16 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -463,4 +463,7 @@ Please report any problems you encounter via Github. Error Unknown + + %1$s / %2$s +