|
|
@ -44,6 +44,8 @@ public class HistoryChart extends ScrollableChart
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private int[] checkmarks;
|
|
|
|
private int[] checkmarks;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean[] activeDays;
|
|
|
|
|
|
|
|
|
|
|
|
private int target;
|
|
|
|
private int target;
|
|
|
|
|
|
|
|
|
|
|
|
private Paint pSquareBg, pSquareFg, pTextHeader;
|
|
|
|
private Paint pSquareBg, pSquareFg, pTextHeader;
|
|
|
@ -181,9 +183,10 @@ public class HistoryChart extends ScrollableChart
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setCheckmarks(int[] checkmarks)
|
|
|
|
public void updateState(int[] checkmarks, boolean[] activeDays)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.checkmarks = checkmarks;
|
|
|
|
this.checkmarks = checkmarks;
|
|
|
|
|
|
|
|
this.activeDays = activeDays;
|
|
|
|
postInvalidate();
|
|
|
|
postInvalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -370,7 +373,7 @@ public class HistoryChart extends ScrollableChart
|
|
|
|
GregorianCalendar date,
|
|
|
|
GregorianCalendar date,
|
|
|
|
int checkmarkOffset)
|
|
|
|
int checkmarkOffset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
int realWeekday = date.get(Calendar.DAY_OF_WEEK) % 7;
|
|
|
|
int checkmark = 0;
|
|
|
|
int checkmark = 0;
|
|
|
|
if (checkmarkOffset >= checkmarks.length)
|
|
|
|
if (checkmarkOffset >= checkmarks.length)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -400,7 +403,7 @@ public class HistoryChart extends ScrollableChart
|
|
|
|
float round = dpToPixels(getContext(), 2);
|
|
|
|
float round = dpToPixels(getContext(), 2);
|
|
|
|
canvas.drawRoundRect(location, round, round, pSquareBg);
|
|
|
|
canvas.drawRoundRect(location, round, round, pSquareBg);
|
|
|
|
|
|
|
|
|
|
|
|
if (!isNumerical && (checkmark == SKIP_MANUAL || checkmark == SKIP_AUTO))
|
|
|
|
if (!isNumerical && (checkmark == SKIP_MANUAL || !activeDays[realWeekday]))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
pSquareBg.setColor(backgroundColor);
|
|
|
|
pSquareBg.setColor(backgroundColor);
|
|
|
|
pSquareBg.setStrokeWidth(columnWidth * 0.025f);
|
|
|
|
pSquareBg.setStrokeWidth(columnWidth * 0.025f);
|
|
|
@ -439,6 +442,7 @@ public class HistoryChart extends ScrollableChart
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isEditable = false;
|
|
|
|
isEditable = false;
|
|
|
|
checkmarks = new int[0];
|
|
|
|
checkmarks = new int[0];
|
|
|
|
|
|
|
|
activeDays = WeekdayList.EVERY_DAY.toArray();
|
|
|
|
controller = new Controller() {};
|
|
|
|
controller = new Controller() {};
|
|
|
|
target = 2;
|
|
|
|
target = 2;
|
|
|
|
|
|
|
|
|
|
|
|