diff --git a/src/main/java/com/owncloud/android/ui/TextDrawable.java b/src/main/java/com/owncloud/android/ui/TextDrawable.java index 903a7b3e0195..878d61d0042c 100644 --- a/src/main/java/com/owncloud/android/ui/TextDrawable.java +++ b/src/main/java/com/owncloud/android/ui/TextDrawable.java @@ -95,7 +95,7 @@ public TextDrawable(String text, int r, int g, int b, float radius) { * @throws NoSuchAlgorithmException if the specified algorithm is not available when calculating the color values */ @NonNull - @NextcloudServer(min = -1, max = 12) + @NextcloudServer(max = 12) public static TextDrawable createAvatar(String accountName, float radiusInDp) throws UnsupportedEncodingException, NoSuchAlgorithmException { String username = AccountUtils.getAccountUsername(accountName); diff --git a/src/main/java/com/owncloud/android/utils/NextcloudServer.java b/src/main/java/com/owncloud/android/utils/NextcloudServer.java index 79998ba2bc76..cf72c345af1b 100644 --- a/src/main/java/com/owncloud/android/utils/NextcloudServer.java +++ b/src/main/java/com/owncloud/android/utils/NextcloudServer.java @@ -6,13 +6,14 @@ import java.lang.annotation.Target; /** - * Created by tobi on 21.12.17. + * Defines min and max server version. Useful to find not needed code, e.g. if annotated max=12 and last supported + * version is 13 the code can be removed. */ @Retention(RetentionPolicy.SOURCE) @Target(ElementType.METHOD) public @interface NextcloudServer { - int min(); + int min() default -1; int max(); } \ No newline at end of file diff --git a/src/main/java/com/owncloud/android/utils/ThemeUtils.java b/src/main/java/com/owncloud/android/utils/ThemeUtils.java index 5f95a875a6d1..fa849ae97cca 100644 --- a/src/main/java/com/owncloud/android/utils/ThemeUtils.java +++ b/src/main/java/com/owncloud/android/utils/ThemeUtils.java @@ -107,6 +107,7 @@ public static int elementColor() { return elementColor(null); } + @NextcloudServer(max = 12) public static int elementColor(Account account) { OCCapability capability = getCapability(account);