From 8d31d9c4696c7a71b24dde9db30c894ba129dfe2 Mon Sep 17 00:00:00 2001 From: Don Cung Date: Tue, 18 Jul 2017 17:53:15 -0700 Subject: [PATCH 1/2] Update version number. --- box-content-sdk/build.gradle | 6 +++--- .../src/main/java/com/box/androidsdk/content/BoxConfig.java | 2 +- .../java/com/box/androidsdk/content/utils/SdkUtils.java | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/box-content-sdk/build.gradle b/box-content-sdk/build.gradle index 6f7250d9..b37cb5b1 100644 --- a/box-content-sdk/build.gradle +++ b/box-content-sdk/build.gradle @@ -7,9 +7,9 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 23 - versionCode 40008 - versionName "4.0.8" /* Update in BoxConfig.SDK_VERSION as well */ - version "4.0.8" + versionCode 40009 + versionName "4.0.9" /* Update in BoxConfig.SDK_VERSION as well */ + version "4.0.9" group "com.box" } diff --git a/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxConfig.java b/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxConfig.java index bcbb7ba9..5dc62b9a 100644 --- a/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxConfig.java +++ b/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxConfig.java @@ -74,7 +74,7 @@ public static BoxCache getCache() { /** * Version string */ - public static String SDK_VERSION = "4.0.8"; + public static String SDK_VERSION = "4.0.9"; /** * Optional paramater for whether authentication should use diff --git a/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java b/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java index dfd18d4a..821f34c9 100644 --- a/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java +++ b/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java @@ -657,7 +657,7 @@ public static int calculateInSampleSize(BitmapFactory.Options options, int reqWi /** * Java version of routine to turn a long into a short user readable string. - *

+ * * This routine is used if the JNI native C version is not available. * * @param numSize the number of bytes in the file. From 20373531d0d9622e74175f9ce62efd20ae8e88b3 Mon Sep 17 00:00:00 2001 From: Don Cung Date: Tue, 18 Jul 2017 18:50:26 -0700 Subject: [PATCH 2/2] Update localized file size util method to handle under 1 kb sizes and GB sizes. --- .../java/com/box/androidsdk/content/utils/SdkUtils.java | 6 +++--- box-content-sdk/src/main/res/values/strings.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java b/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java index 821f34c9..b74c55f5 100644 --- a/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java +++ b/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/SdkUtils.java @@ -636,7 +636,7 @@ public static int calculateInSampleSize(BitmapFactory.Options options, int reqWi - private static String SIZE_BYTES = "%4f B"; + private static String SIZE_BYTES = "%4.0f B"; private static String SIZE_KILOBYTES = "%4.1f KB"; private static String SIZE_MEGABYTES = "%4.1f MB"; private static String SIZE_GIGABYTES = "%4.1f GB"; @@ -647,8 +647,8 @@ public static int calculateInSampleSize(BitmapFactory.Options options, int reqWi private static final int constKB = 1024; private static final int constMB = constKB * constKB; - private static final int constGB = constMB * constKB; - private static final int constTB = constGB * constKB; + private static final double constGB = constMB * constKB; + private static final double constTB = constGB * constKB; private static final double floatKB = 1024.0f; private static final double floatMB = floatKB * floatKB; diff --git a/box-content-sdk/src/main/res/values/strings.xml b/box-content-sdk/src/main/res/values/strings.xml index bf1009bd..28d0db79 100644 --- a/box-content-sdk/src/main/res/values/strings.xml +++ b/box-content-sdk/src/main/res/values/strings.xml @@ -75,7 +75,7 @@ - %4f B + %4.0f B %4.1f KB %4.1f MB %4.1f GB