Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Set new theme for date picker/calendar
It is necessary to create a custom theme for the date picker/calendar available from the Post Settings screen. This is because 'Theme.AppCompat.DayNight.Dialog.Alert' needs to be set as the theme's parent in order to inherit the other styles from that theme.
  • Loading branch information
SiobhyB committed Aug 3, 2022
commit b74d21d58b73ea299b4e4cc0c3ecff5348f26b41
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class PostDatePickerDialogFragment : DialogFragment() {

val datePickerDialog = DatePickerDialog(
requireContext(),
R.style.PostSettingsCalendar,
null,
viewModel.year ?: 0,
viewModel.month ?: 0,
Expand Down
5 changes: 5 additions & 0 deletions WordPress/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,11 @@
<item name="colorControlActivated">@color/colorPrimaryEditor</item>
</style>

<style name="PostSettingsCalendar" parent="Theme.AppCompat.DayNight.Dialog.Alert">
<item name="colorAccent">@color/colorPrimaryEditor</item>
<item name="colorControlActivated">@color/colorPrimaryEditor</item>
</style>

<style name="PostSettingsCardViewInnerLayout">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
Expand Down