From e649a2de13400a749460614588c824c414bf01ad Mon Sep 17 00:00:00 2001 From: SapuSeven Date: Wed, 14 Nov 2018 22:53:28 +0100 Subject: [PATCH] Fixed daySeparatorColor and hourSeparatorColor --- .../alamkanak/weekview/BackgroundGridDrawer.java | 2 +- .../main/java/com/alamkanak/weekview/WeekView.java | 1 + .../alamkanak/weekview/WeekViewDrawingConfig.java | 13 ++++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/library/src/main/java/com/alamkanak/weekview/BackgroundGridDrawer.java b/library/src/main/java/com/alamkanak/weekview/BackgroundGridDrawer.java index 81a3fcf80..8bb82cedf 100644 --- a/library/src/main/java/com/alamkanak/weekview/BackgroundGridDrawer.java +++ b/library/src/main/java/com/alamkanak/weekview/BackgroundGridDrawer.java @@ -66,7 +66,7 @@ private void drawDaySeparators(float startPixel, Canvas canvas) { for (int i = 0; i < days; i++) { final float start = startPixel + widthPerDay * (i + 1); - canvas.drawLine(start, top, start, top + height, drawConfig.hourSeparatorPaint); + canvas.drawLine(start, top, start, top + height, drawConfig.daySeparatorPaint); } } diff --git a/library/src/main/java/com/alamkanak/weekview/WeekView.java b/library/src/main/java/com/alamkanak/weekview/WeekView.java index a5910abfa..395b8b113 100755 --- a/library/src/main/java/com/alamkanak/weekview/WeekView.java +++ b/library/src/main/java/com/alamkanak/weekview/WeekView.java @@ -831,6 +831,7 @@ public int getDaySeparatorColor() { public void setDaySeparatorColor(int daySeparatorColor) { config.daySeparatorColor = daySeparatorColor; + config.drawingConfig.daySeparatorPaint.setColor(daySeparatorColor); invalidate(); } diff --git a/library/src/main/java/com/alamkanak/weekview/WeekViewDrawingConfig.java b/library/src/main/java/com/alamkanak/weekview/WeekViewDrawingConfig.java index 310dbd8cd..b51c52665 100644 --- a/library/src/main/java/com/alamkanak/weekview/WeekViewDrawingConfig.java +++ b/library/src/main/java/com/alamkanak/weekview/WeekViewDrawingConfig.java @@ -17,7 +17,7 @@ import static java.util.Calendar.HOUR_OF_DAY; class WeekViewDrawingConfig { - + Paint timeTextPaint; float timeTextWidth; float timeTextHeight; @@ -31,6 +31,7 @@ class WeekViewDrawingConfig { float widthPerDay; Paint dayBackgroundPaint; Paint hourSeparatorPaint; + Paint daySeparatorPaint; float headerMarginBottom; Paint todayBackgroundPaint; @@ -52,7 +53,7 @@ class WeekViewDrawingConfig { int newHourHeight = -1; DateTimeInterpreter dateTimeInterpreter; - + WeekViewDrawingConfig(Context context, WeekViewConfig config) { // Measure settings for time column. timeTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG); @@ -101,6 +102,12 @@ class WeekViewDrawingConfig { hourSeparatorPaint.setStrokeWidth(config.hourSeparatorStrokeWidth); hourSeparatorPaint.setColor(config.hourSeparatorColor); + // Prepare day separator color paint. + daySeparatorPaint = new Paint(); + daySeparatorPaint.setStyle(Paint.Style.STROKE); + daySeparatorPaint.setStrokeWidth(config.daySeparatorStrokeWidth); + daySeparatorPaint.setColor(config.daySeparatorColor); + // Prepare the "now" line color paint nowLinePaint = new Paint(); nowLinePaint.setStrokeWidth(config.nowLineStrokeWidth); @@ -263,5 +270,5 @@ public String interpretTime(int hour) { } }; } - + }