Merge branch 'dev' of https://github.com/austil/uhabits into pull/austil

pull/87/merge
Alinson S. Xavier 8 years ago
commit c34f9f9e9f

@ -11,7 +11,7 @@ android {
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 25 targetSdkVersion 25
buildConfigField "Integer", "databaseVersion", "20" buildConfigField "Integer", "databaseVersion", "21"
buildConfigField "String", "databaseFilename", "\"uhabits.db\"" buildConfigField "String", "databaseFilename", "\"uhabits.db\""
buildConfigField "int", "roboSdk", (System.getenv("ROBO_SDK") ?: "25") buildConfigField "int", "roboSdk", (System.getenv("ROBO_SDK") ?: "25")

@ -180,8 +180,8 @@ public class HabitListTest extends BaseAndroidTest
String expectedCSV = String expectedCSV =
"Position,Name,Description,NumRepetitions,Interval,Color\n" + "Position,Name,Description,NumRepetitions,Interval,Color\n" +
"001,Meditate,Did you meditate this morning?,1,1,#AFB42B\n" + "001,Meditate,Did you meditate this morning?,1,1,#F9A825\n" +
"002,Wake up early,Did you wake up before 6am?,2,3,#00897B\n"; "002,Wake up early,Did you wake up before 6am?,2,3,#388E3C\n";
StringWriter writer = new StringWriter(); StringWriter writer = new StringWriter();
habitList.writeCSV(writer); habitList.writeCSV(writer);

@ -0,0 +1,12 @@
update habits set color=19 where color=12;
update habits set color=17 where color=11;
update habits set color=15 where color=10;
update habits set color=14 where color=9;
update habits set color=13 where color=8;
update habits set color=10 where color=7;
update habits set color=9 where color=6;
update habits set color=8 where color=5;
update habits set color=7 where color=4;
update habits set color=5 where color=3;
update habits set color=4 where color=2;
update habits set color=0 where color<0 or color>19;

@ -40,18 +40,25 @@ public abstract class ColorUtils
{ {
int palette[] = { int palette[] = {
Color.parseColor("#D32F2F"), // 0 red Color.parseColor("#D32F2F"), // 0 red
Color.parseColor("#E64A19"), // 1 orange Color.parseColor("#E64A19"), // 1 deep orange
Color.parseColor("#F9A825"), // 2 yellow Color.parseColor("#F57C00"), // 2 orange
Color.parseColor("#AFB42B"), // 3 light green Color.parseColor("#FF8F00"), // 3 amber
Color.parseColor("#388E3C"), // 4 dark green Color.parseColor("#F9A825"), // 4 yellow
Color.parseColor("#00897B"), // 5 teal Color.parseColor("#AFB42B"), // 5 lime
Color.parseColor("#00ACC1"), // 6 cyan Color.parseColor("#7CB342"), // 6 light green
Color.parseColor("#039BE5"), // 7 blue Color.parseColor("#388E3C"), // 7 green
Color.parseColor("#5E35B1"), // 8 deep purple Color.parseColor("#00897B"), // 8 teal
Color.parseColor("#8E24AA"), // 9 purple Color.parseColor("#00ACC1"), // 9 cyan
Color.parseColor("#D81B60"), // 10 pink Color.parseColor("#039BE5"), // 10 light blue
Color.parseColor("#303030"), // 11 dark grey Color.parseColor("#1976D2"), // 11 blue
Color.parseColor("#aaaaaa") // 12 light grey Color.parseColor("#303F9F"), // 12 indigo
Color.parseColor("#5E35B1"), // 13 deep purple
Color.parseColor("#8E24AA"), // 14 purple
Color.parseColor("#D81B60"), // 15 pink
Color.parseColor("#5D4037"), // 16 brown
Color.parseColor("#303030"), // 17 dark grey
Color.parseColor("#757575"), // 18 grey
Color.parseColor("#aaaaaa") // 19 light grey
}; };
return palette[index]; return palette[index];

@ -19,47 +19,68 @@
<array name="lightPalette"> <array name="lightPalette">
<item>@color/red_700</item> <item>@color/red_700</item>
<item>@color/deep_orange_700</item> <item>@color/deep_orange_700</item>
<item>@color/orange_700</item>
<item>@color/amber_800</item>
<item>@color/yellow_800</item> <item>@color/yellow_800</item>
<item>@color/lime_700</item> <item>@color/lime_700</item>
<item>@color/light_green_600</item>
<item>@color/green_700</item> <item>@color/green_700</item>
<item>@color/teal_600</item> <item>@color/teal_600</item>
<item>@color/cyan_600</item> <item>@color/cyan_600</item>
<item>@color/light_blue_600</item> <item>@color/light_blue_600</item>
<item>@color/blue_700</item>
<item>@color/indigo_700</item>
<item>@color/deep_purple_600</item> <item>@color/deep_purple_600</item>
<item>@color/purple_600</item> <item>@color/purple_600</item>
<item>@color/pink_600</item> <item>@color/pink_600</item>
<item>@color/brown_700</item>
<item>@color/grey_800</item> <item>@color/grey_800</item>
<item>@color/grey_600</item>
<item>@color/grey_500</item> <item>@color/grey_500</item>
</array> </array>
<array name="darkPalette"> <array name="darkPalette">
<item>@color/red_200</item> <item>@color/red_200</item>
<item>@color/deep_orange_200</item> <item>@color/deep_orange_200</item>
<item>@color/orange_200</item>
<item>@color/amber_100</item>
<item>@color/yellow_200</item> <item>@color/yellow_200</item>
<item>@color/lime_200</item> <item>@color/lime_200</item>
<item>@color/light_green_200</item>
<item>@color/green_A200</item> <item>@color/green_A200</item>
<item>@color/teal_200</item> <item>@color/teal_200</item>
<item>@color/cyan_200</item> <item>@color/cyan_200</item>
<item>@color/light_blue_200</item> <item>@color/light_blue_200</item>
<item>@color/blue_300</item>
<item>@color/indigo_200</item>
<item>@color/deep_purple_200</item> <item>@color/deep_purple_200</item>
<item>@color/purple_200</item> <item>@color/purple_200</item>
<item>@color/pink_200</item> <item>@color/pink_200</item>
<item>@color/brown_200</item>
<item>@color/grey_100</item> <item>@color/grey_100</item>
<item>@color/grey_300</item>
<item>@color/grey_500</item> <item>@color/grey_500</item>
</array> </array>
<array name="transparentWidgetPalette"> <array name="transparentWidgetPalette">
<item>@color/red_800</item> <item>@color/red_800</item>
<item>@color/deep_orange_800</item> <item>@color/deep_orange_800</item>
<item>@color/orange_800</item>
<item>@color/amber_800</item>
<item>@color/yellow_800</item> <item>@color/yellow_800</item>
<item>@color/lime_800</item> <item>@color/lime_800</item>
<item>@color/light_green_600</item>
<item>@color/green_700</item> <item>@color/green_700</item>
<item>@color/teal_700</item> <item>@color/teal_700</item>
<item>@color/cyan_700</item> <item>@color/cyan_700</item>
<item>@color/light_blue_700</item> <item>@color/light_blue_700</item>
<item>@color/blue_800</item>
<item>@color/indigo_800</item>
<item>@color/deep_purple_700</item> <item>@color/deep_purple_700</item>
<item>@color/purple_700</item> <item>@color/purple_700</item>
<item>@color/pink_700</item> <item>@color/pink_700</item>
<item>@color/brown_800</item>
<item>@color/black_aa</item>
<item>@color/black_aa</item> <item>@color/black_aa</item>
<item>@color/black_aa</item> <item>@color/black_aa</item>
</array> </array>

@ -2,19 +2,26 @@ package org.isoron.uhabits.core.utils;
public class ColorConstants public class ColorConstants
{ {
public static String[] CSV_PALETTE = { public static String CSV_PALETTE[] = {
"#D32F2F", // 0 red "#D32F2F", // 0 red
"#E64A19", // 1 orange "#E64A19", // 1 deep orange
"#F9A825", // 2 yellow "#F57C00", // 2 orange
"#AFB42B", // 3 light green "#FF8F00", // 3 amber
"#388E3C", // 4 dark green "#F9A825", // 4 yellow
"#00897B", // 5 teal "#AFB42B", // 5 lime
"#00ACC1", // 6 cyan "#7CB342", // 6 light green
"#039BE5", // 7 blue "#388E3C", // 7 green
"#5E35B1", // 8 deep purple "#00897B", // 8 teal
"#8E24AA", // 9 purple "#00ACC1", // 9 cyan
"#D81B60", // 10 pink "#039BE5", // 10 light blue
"#303030", // 11 dark grey "#1976D2", // 11 blue
"#aaaaaa" // 12 light grey "#303F9F", // 12 indigo
"#5E35B1", // 13 deep purple
"#8E24AA", // 14 purple
"#D81B60", // 15 pink
"#5D4037", // 16 brown
"#303030", // 17 dark grey
"#757575", // 18 grey
"#aaaaaa" // 19 light grey
}; };
} }

@ -218,8 +218,8 @@ public class HabitListTest extends BaseUnitTest
String expectedCSV = String expectedCSV =
"Position,Name,Description,NumRepetitions,Interval,Color\n" + "Position,Name,Description,NumRepetitions,Interval,Color\n" +
"001,Meditate,Did you meditate this morning?,1,1,#AFB42B\n" + "001,Meditate,Did you meditate this morning?,1,1,#FF8F00\n" +
"002,Wake up early,Did you wake up before 6am?,2,3,#00897B\n"; "002,Wake up early,Did you wake up before 6am?,2,3,#AFB42B\n";
StringWriter writer = new StringWriter(); StringWriter writer = new StringWriter();
list.writeCSV(writer); list.writeCSV(writer);

Loading…
Cancel
Save