mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Merge branch 'dev' of https://github.com/austil/uhabits into pull/austil
This commit is contained in:
@@ -11,7 +11,7 @@ android {
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 25
|
||||
|
||||
buildConfigField "Integer", "databaseVersion", "20"
|
||||
buildConfigField "Integer", "databaseVersion", "21"
|
||||
buildConfigField "String", "databaseFilename", "\"uhabits.db\""
|
||||
buildConfigField "int", "roboSdk", (System.getenv("ROBO_SDK") ?: "25")
|
||||
|
||||
|
||||
@@ -180,8 +180,8 @@ public class HabitListTest extends BaseAndroidTest
|
||||
|
||||
String expectedCSV =
|
||||
"Position,Name,Description,NumRepetitions,Interval,Color\n" +
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#AFB42B\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#00897B\n";
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#F9A825\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#388E3C\n";
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
habitList.writeCSV(writer);
|
||||
|
||||
12
uhabits-android/src/main/assets/migrations/21.sql
Normal file
12
uhabits-android/src/main/assets/migrations/21.sql
Normal file
@@ -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[] = {
|
||||
Color.parseColor("#D32F2F"), // 0 red
|
||||
Color.parseColor("#E64A19"), // 1 orange
|
||||
Color.parseColor("#F9A825"), // 2 yellow
|
||||
Color.parseColor("#AFB42B"), // 3 light green
|
||||
Color.parseColor("#388E3C"), // 4 dark green
|
||||
Color.parseColor("#00897B"), // 5 teal
|
||||
Color.parseColor("#00ACC1"), // 6 cyan
|
||||
Color.parseColor("#039BE5"), // 7 blue
|
||||
Color.parseColor("#5E35B1"), // 8 deep purple
|
||||
Color.parseColor("#8E24AA"), // 9 purple
|
||||
Color.parseColor("#D81B60"), // 10 pink
|
||||
Color.parseColor("#303030"), // 11 dark grey
|
||||
Color.parseColor("#aaaaaa") // 12 light grey
|
||||
Color.parseColor("#E64A19"), // 1 deep orange
|
||||
Color.parseColor("#F57C00"), // 2 orange
|
||||
Color.parseColor("#FF8F00"), // 3 amber
|
||||
Color.parseColor("#F9A825"), // 4 yellow
|
||||
Color.parseColor("#AFB42B"), // 5 lime
|
||||
Color.parseColor("#7CB342"), // 6 light green
|
||||
Color.parseColor("#388E3C"), // 7 green
|
||||
Color.parseColor("#00897B"), // 8 teal
|
||||
Color.parseColor("#00ACC1"), // 9 cyan
|
||||
Color.parseColor("#039BE5"), // 10 light blue
|
||||
Color.parseColor("#1976D2"), // 11 blue
|
||||
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];
|
||||
|
||||
@@ -19,47 +19,68 @@
|
||||
<array name="lightPalette">
|
||||
<item>@color/red_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/lime_700</item>
|
||||
<item>@color/light_green_600</item>
|
||||
<item>@color/green_700</item>
|
||||
<item>@color/teal_600</item>
|
||||
<item>@color/cyan_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/purple_600</item>
|
||||
<item>@color/pink_600</item>
|
||||
<item>@color/brown_700</item>
|
||||
<item>@color/grey_800</item>
|
||||
<item>@color/grey_600</item>
|
||||
<item>@color/grey_500</item>
|
||||
</array>
|
||||
|
||||
<array name="darkPalette">
|
||||
<item>@color/red_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/lime_200</item>
|
||||
<item>@color/light_green_200</item>
|
||||
<item>@color/green_A200</item>
|
||||
<item>@color/teal_200</item>
|
||||
<item>@color/cyan_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/purple_200</item>
|
||||
<item>@color/pink_200</item>
|
||||
<item>@color/brown_200</item>
|
||||
<item>@color/grey_100</item>
|
||||
<item>@color/grey_300</item>
|
||||
<item>@color/grey_500</item>
|
||||
</array>
|
||||
|
||||
<array name="transparentWidgetPalette">
|
||||
<item>@color/red_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/lime_800</item>
|
||||
<item>@color/light_green_600</item>
|
||||
<item>@color/green_700</item>
|
||||
<item>@color/teal_700</item>
|
||||
<item>@color/cyan_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/purple_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>
|
||||
</array>
|
||||
|
||||
@@ -2,19 +2,26 @@ package org.isoron.uhabits.core.utils;
|
||||
|
||||
public class ColorConstants
|
||||
{
|
||||
public static String[] CSV_PALETTE = {
|
||||
public static String CSV_PALETTE[] = {
|
||||
"#D32F2F", // 0 red
|
||||
"#E64A19", // 1 orange
|
||||
"#F9A825", // 2 yellow
|
||||
"#AFB42B", // 3 light green
|
||||
"#388E3C", // 4 dark green
|
||||
"#00897B", // 5 teal
|
||||
"#00ACC1", // 6 cyan
|
||||
"#039BE5", // 7 blue
|
||||
"#5E35B1", // 8 deep purple
|
||||
"#8E24AA", // 9 purple
|
||||
"#D81B60", // 10 pink
|
||||
"#303030", // 11 dark grey
|
||||
"#aaaaaa" // 12 light grey
|
||||
"#E64A19", // 1 deep orange
|
||||
"#F57C00", // 2 orange
|
||||
"#FF8F00", // 3 amber
|
||||
"#F9A825", // 4 yellow
|
||||
"#AFB42B", // 5 lime
|
||||
"#7CB342", // 6 light green
|
||||
"#388E3C", // 7 green
|
||||
"#00897B", // 8 teal
|
||||
"#00ACC1", // 9 cyan
|
||||
"#039BE5", // 10 light blue
|
||||
"#1976D2", // 11 blue
|
||||
"#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 =
|
||||
"Position,Name,Description,NumRepetitions,Interval,Color\n" +
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#AFB42B\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#00897B\n";
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#FF8F00\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#AFB42B\n";
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
list.writeCSV(writer);
|
||||
|
||||
Reference in New Issue
Block a user