mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
More Colors - requested changes
This commit is contained in:
@@ -12,7 +12,7 @@ android {
|
|||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
|
|
||||||
buildConfigField "Integer", "databaseVersion", "19"
|
buildConfigField "Integer", "databaseVersion", "20"
|
||||||
buildConfigField "String", "databaseFilename", "\"uhabits.db\""
|
buildConfigField "String", "databaseFilename", "\"uhabits.db\""
|
||||||
|
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
|||||||
12
app/src/main/assets/migrations/20.sql
Normal file
12
app/src/main/assets/migrations/20.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;
|
||||||
@@ -29,19 +29,23 @@ public abstract class ColorUtils
|
|||||||
"#D32F2F", // 0 red
|
"#D32F2F", // 0 red
|
||||||
"#E64A19", // 1 deep orange
|
"#E64A19", // 1 deep orange
|
||||||
"#F57C00", // 2 orange
|
"#F57C00", // 2 orange
|
||||||
"#F9A825", // 3 yellow
|
"#FF8F00", // 3 amber
|
||||||
"#AFB42B", // 4 light green
|
"#F9A825", // 4 yellow
|
||||||
"#388E3C", // 5 dark green
|
"#AFB42B", // 5 lime
|
||||||
"#00897B", // 6 teal
|
"#7CB342", // 6 light green
|
||||||
"#00ACC1", // 7 cyan
|
"#388E3C", // 7 green
|
||||||
"#039BE5", // 8 blue
|
"#00897B", // 8 teal
|
||||||
"#5E35B1", // 9 deep purple
|
"#00ACC1", // 9 cyan
|
||||||
"#8E24AA", // 10 purple
|
"#039BE5", // 10 light blue
|
||||||
"#D81B60", // 11 pink
|
"#1976D2", // 11 blue
|
||||||
"#5D4037", // 12 brown
|
"#303F9F", // 12 indigo
|
||||||
"#303030", // 13 dark grey
|
"#5E35B1", // 13 deep purple
|
||||||
"#757575", // 14 grey
|
"#8E24AA", // 14 purple
|
||||||
"#aaaaaa" // 15 light grey
|
"#D81B60", // 15 pink
|
||||||
|
"#5D4037", // 16 brown
|
||||||
|
"#303030", // 17 dark grey
|
||||||
|
"#757575", // 18 grey
|
||||||
|
"#aaaaaa" // 19 light grey
|
||||||
};
|
};
|
||||||
|
|
||||||
public static int colorToPaletteIndex(Context context, int color)
|
public static int colorToPaletteIndex(Context context, int color)
|
||||||
@@ -61,19 +65,23 @@ public abstract class ColorUtils
|
|||||||
Color.parseColor("#D32F2F"), // 0 red
|
Color.parseColor("#D32F2F"), // 0 red
|
||||||
Color.parseColor("#E64A19"), // 1 deep orange
|
Color.parseColor("#E64A19"), // 1 deep orange
|
||||||
Color.parseColor("#F57C00"), // 2 orange
|
Color.parseColor("#F57C00"), // 2 orange
|
||||||
Color.parseColor("#F9A825"), // 3 yellow
|
Color.parseColor("#FF8F00"), // 3 amber
|
||||||
Color.parseColor("#AFB42B"), // 4 light green
|
Color.parseColor("#F9A825"), // 4 yellow
|
||||||
Color.parseColor("#388E3C"), // 5 dark green
|
Color.parseColor("#AFB42B"), // 5 lime
|
||||||
Color.parseColor("#00897B"), // 6 teal
|
Color.parseColor("#7CB342"), // 6 light green
|
||||||
Color.parseColor("#00ACC1"), // 7 cyan
|
Color.parseColor("#388E3C"), // 7 green
|
||||||
Color.parseColor("#039BE5"), // 8 blue
|
Color.parseColor("#00897B"), // 8 teal
|
||||||
Color.parseColor("#5E35B1"), // 9 deep purple
|
Color.parseColor("#00ACC1"), // 9 cyan
|
||||||
Color.parseColor("#8E24AA"), // 10 purple
|
Color.parseColor("#039BE5"), // 10 light blue
|
||||||
Color.parseColor("#D81B60"), // 11 pink
|
Color.parseColor("#1976D2"), // 11 blue
|
||||||
Color.parseColor("#5D4037"), // 12 brown
|
Color.parseColor("#303F9F"), // 12 indigo
|
||||||
Color.parseColor("#303030"), // 13 dark grey
|
Color.parseColor("#5E35B1"), // 13 deep purple
|
||||||
Color.parseColor("#757575"), // 14 grey
|
Color.parseColor("#8E24AA"), // 14 purple
|
||||||
Color.parseColor("#aaaaaa") // 15 light grey
|
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];
|
||||||
|
|||||||
@@ -20,12 +20,16 @@
|
|||||||
<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/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>
|
||||||
@@ -39,12 +43,16 @@
|
|||||||
<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/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>
|
||||||
@@ -58,12 +66,16 @@
|
|||||||
<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/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>
|
||||||
|
|||||||
@@ -172,8 +172,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,#F9A825\n" +
|
"001,Meditate,Did you meditate this morning?,1,1,#FF8F00\n" +
|
||||||
"002,Wake up early,Did you wake up before 6am?,2,3,#388E3C\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);
|
||||||
|
|||||||
Reference in New Issue
Block a user