@@ -753,61 +753,62 @@ class WeekView @JvmOverloads constructor(
753753 }
754754
755755 /* *
756- * Returns the background color of the current date.
756+ * Returns the background color of the current date. If not explicitly set, WeekView will use
757+ * [dayBackgroundColor].
757758 */
758759 @PublicApi
759760 var todayBackgroundColor: Int
760- get() = viewState.todayBackgroundPaint.color
761+ get() = viewState.todayBackgroundPaint? .color ? : dayBackgroundColor
761762 set(value) {
762- viewState.todayBackgroundPaint.color = value
763+ viewState.todayBackgroundPaint = value.toPaint()
763764 invalidate()
764765 }
765766
766767 /* *
767- * Returns the background color for past dates. If not explicitly set, WeekView will used
768+ * Returns the background color for past dates. If not explicitly set, WeekView will use
768769 * [dayBackgroundColor].
769770 */
770771 @PublicApi
771772 var pastBackgroundColor: Int
772- get() = viewState.pastBackgroundPaint.color
773+ get() = viewState.pastBackgroundPaint? .color ? : dayBackgroundColor
773774 set(value) {
774- viewState.pastBackgroundPaint.color = value
775+ viewState.pastBackgroundPaint = value.toPaint()
775776 invalidate()
776777 }
777778
778779 /* *
779- * Returns the background color for past weekend dates. If not explicitly set, WeekView will
780- * used [pastBackgroundColor ].
780+ * Returns the background color for past weekend dates. If not explicitly set, WeekView will use
781+ * [dayBackgroundColor ].
781782 */
782783 @PublicApi
783784 var pastWeekendBackgroundColor: Int
784- get() = viewState.pastWeekendBackgroundPaint.color
785+ get() = viewState.pastWeekendBackgroundPaint? .color ? : dayBackgroundColor
785786 set(value) {
786- viewState.pastWeekendBackgroundPaint.color = value
787+ viewState.pastWeekendBackgroundPaint = value.toPaint()
787788 invalidate()
788789 }
789790
790791 /* *
791- * Returns the background color for future dates. If not explicitly set, WeekView will used
792+ * Returns the background color for future dates. If not explicitly set, WeekView will use
792793 * [dayBackgroundColor].
793794 */
794795 @PublicApi
795796 var futureBackgroundColor: Int
796- get() = viewState.futureBackgroundPaint.color
797+ get() = viewState.futureBackgroundPaint? .color ? : dayBackgroundColor
797798 set(value) {
798- viewState.futureBackgroundPaint.color = value
799+ viewState.futureBackgroundPaint = value.toPaint()
799800 invalidate()
800801 }
801802
802803 /* *
803804 * Returns the background color for future weekend dates. If not explicitly set, WeekView will
804- * used [futureBackgroundColor ].
805+ * use [dayBackgroundColor ].
805806 */
806807 @PublicApi
807808 var futureWeekendBackgroundColor: Int
808- get() = viewState.futureWeekendBackgroundPaint.color
809+ get() = viewState.futureWeekendBackgroundPaint? .color ? : dayBackgroundColor
809810 set(value) {
810- viewState.futureWeekendBackgroundPaint.color = value
811+ viewState.futureWeekendBackgroundPaint = value.toPaint()
811812 invalidate()
812813 }
813814
0 commit comments