Skip to content

Commit

Permalink
Update sample app
Browse files Browse the repository at this point in the history
Add custom style for the Calendar.
  • Loading branch information
Alexander Surinov committed Aug 30, 2018
1 parent 075887d commit b8e86d8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
14 changes: 2 additions & 12 deletions sample/src/main/res/layout/fragment_custom_style_sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,9 @@

<ru.cleverpumpkin.calendar.CalendarView
android:id="@+id/calendar_view"
style="@style/CalendarViewCustomStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"
android:background="@android:color/white"
app:calendar_date_background="@drawable/custom_date_bg_selector"
app:calendar_date_text_color="@color/custom_date_text_selector"
app:calendar_day_bar_background="@color/custom_calendar_days_bar_background"
app:calendar_day_bar_text_color="@color/custom_calendar_days_bar_text_color"
app:calendar_grid_color="@color/custom_calendar_grid_color"
app:calendar_grid_on_selected_dates="false"
app:calendar_month_text_color="@color/custom_calendar_month_text_color"
app:calendar_year_selection_arrows_color="@color/custom_calendar_year_selection_arrows_color"
app:calendar_year_selection_background="@color/custom_calendar_year_selection_background"
app:calendar_year_selection_text_color="@color/custom_calendar_year_selection_text_color" />
android:layout_marginTop="?attr/actionBarSize" />

</FrameLayout>
2 changes: 1 addition & 1 deletion sample/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<color name="custom_calendar_year_selection_background">#0f6c52</color>
<color name="custom_calendar_year_selection_arrows_color">#f2e81a</color>
<color name="custom_calendar_year_selection_text_color">#FFFFFF</color>
<color name="custom_calendar_year_selection_text_color">#f2e81a</color>

<color name="custom_calendar_days_bar_background">#0f6c52</color>
<color name="custom_calendar_days_bar_text_color">#f2e81a</color>
Expand Down
22 changes: 21 additions & 1 deletion sample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,31 @@

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="CalendarViewCustomStyle">
<item name="android:background">@android:color/white</item>
<item name="calendar_date_background">@drawable/custom_date_bg_selector</item>
<item name="calendar_date_text_color">@color/custom_date_text_selector</item>
<item name="calendar_day_bar_background">@color/custom_calendar_days_bar_background</item>
<item name="calendar_day_bar_text_color">@color/custom_calendar_days_bar_text_color</item>
<item name="calendar_grid_color">@color/custom_calendar_grid_color</item>
<item name="calendar_grid_on_selected_dates">false</item>
<item name="calendar_month_text_color">@color/custom_calendar_month_text_color</item>
<item name="calendar_year_selection_arrows_color">
@color/custom_calendar_year_selection_arrows_color
</item>
<item name="calendar_year_selection_background">
@color/custom_calendar_year_selection_background
</item>
<item name="calendar_year_selection_text_color">
@color/custom_calendar_year_selection_text_color
</item>
</style>

</resources>

0 comments on commit b8e86d8

Please sign in to comment.