Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
Add CalendarView Theme with the `calendarViewStyle` attribute to be able
to define default style for all calendars from the app theme.

Change visibility of `GridDividerItemDecoration` class.
  • Loading branch information
Alexander Surinov committed Aug 30, 2018
1 parent 04e7b18 commit 075887d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import java.util.*
class CalendarView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
@AttrRes defStyleAttr: Int = 0
@AttrRes defStyleAttr: Int = R.attr.calendarViewStyle

) : FrameLayout(context, attrs, defStyleAttr) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ru.cleverpumpkin.calendar.R
import ru.cleverpumpkin.calendar.utils.dpToPix
import ru.cleverpumpkin.calendar.utils.getColorInt

class GridDividerItemDecoration(
internal class GridDividerItemDecoration(
context: Context,
@ColorInt dividerColor: Int = context.getColorInt(R.color.calendar_grid_color),
private val drawGridOnSelectedDates: Boolean
Expand Down
11 changes: 8 additions & 3 deletions crunchycalendar/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<!-- Default CalendarView style -->
<declare-styleable name="CalendarViewTheme">
<attr name="calendarViewStyle" format="reference" />
</declare-styleable>

<declare-styleable name="CalendarView">
<attr name="calendar_grid_on_selected_dates" format="boolean" />
<attr name="calendar_grid_color" format="color" />
<attr name="calendar_day_bar_background" format="color" />
<attr name="calendar_day_bar_text_color" format="color" />
<attr name="calendar_year_selection_background" format="color"/>
<attr name="calendar_year_selection_arrows_color" format="color"/>
<attr name="calendar_year_selection_text_color" format="color"/>
<attr name="calendar_year_selection_background" format="color" />
<attr name="calendar_year_selection_arrows_color" format="color" />
<attr name="calendar_year_selection_text_color" format="color" />
<attr name="calendar_month_text_color" format="color" />
<attr name="calendar_date_background" format="reference" />
<attr name="calendar_date_text_color" format="color" />
Expand Down

0 comments on commit 075887d

Please sign in to comment.