From: Damyan Ivanov Date: Tue, 19 May 2020 20:03:14 +0000 (+0300) Subject: dynamic count of swipe circle colours X-Git-Tag: v0.14.0~76 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;ds=sidebyside;h=ea97a791974860cc03069903dffbcaca45330635;hp=898bf5932a1bdb2a7b197d9e0981f722111295b6;p=mobile-ledger.git dynamic count of swipe circle colours --- diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/Colors.java b/app/src/main/java/net/ktnx/mobileledger/utils/Colors.java index 80ec58ab..845cda36 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/Colors.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/Colors.java @@ -58,6 +58,7 @@ public class Colors { public static int profileThemeId = -1; public static MutableLiveData themeWatch = new MutableLiveData<>(0); public static int errorTextColor; + private static int SWIPE_COLOR_COUNT = 6; private static int[] themeIDs = {R.style.AppTheme_000, R.style.AppTheme_005, R.style.AppTheme_010, R.style.AppTheme_015, @@ -243,8 +244,8 @@ public class Colors { return getSwipeCircleColors(profileThemeId); } public static int[] getSwipeCircleColors(int hue) { - int[] colors = new int[]{0, 0, 0, 0, 0, 0}; - for (int i = 0; i < 6; i++, hue = (hue + 60) % 360) { + int[] colors = new int[SWIPE_COLOR_COUNT]; + for (int i = 0; i < SWIPE_COLOR_COUNT; i++, hue = (hue + 360 / SWIPE_COLOR_COUNT) % 360) { colors[i] = getPrimaryColorForHue(hue); } return colors;