diff --git a/WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListFragment.kt b/WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListFragment.kt index 8fa784870b3f..8fb2f5e83daa 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListFragment.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/activitylog/list/ActivityLogListFragment.kt @@ -10,6 +10,8 @@ import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProvider import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.google.android.material.datepicker.CalendarConstraints +import com.google.android.material.datepicker.DateValidatorPointBackward import com.google.android.material.datepicker.MaterialDatePicker import com.google.android.material.snackbar.Snackbar import kotlinx.android.synthetic.main.activity_log_list_fragment.* @@ -185,6 +187,13 @@ class ActivityLogListFragment : Fragment() { private fun showDateRangePicker(initialDateRange: DateRange?) { val picker = MaterialDatePicker.Builder .dateRangePicker() + .setTheme(R.style.WordPress_MaterialCalendarFullscreenTheme) + .setCalendarConstraints( + CalendarConstraints.Builder() + .setValidator(DateValidatorPointBackward.now()) + .setEnd(MaterialDatePicker.todayInUtcMilliseconds()) + .build() + ) .setSelection(initialDateRange) .build() initDateRangePickerButtonClickListener(picker) diff --git a/WordPress/src/main/res/values/styles.xml b/WordPress/src/main/res/values/styles.xml index 2c9760cf3239..b438d2907852 100644 --- a/WordPress/src/main/res/values/styles.xml +++ b/WordPress/src/main/res/values/styles.xml @@ -95,23 +95,31 @@ @color/white - @style/WordPress.MaterialCalendarStyle + @style/Widget.MaterialComponents.MaterialCalendar @style/WordPress.MaterialCalendarFullscreenTheme @style/WordPress.MaterialCalendarTheme - - + + + + + + + +