Home > Software design >  Android Material Date Range Picker - How to change the text color of only the selected range dates?
Android Material Date Range Picker - How to change the text color of only the selected range dates?

Time:07-22

I am attempting to reproduce this style with the RangeDateSelector

You can change the logic to include all the dates between the two selected dates.

For example, you can add this code in between the two if statements :

if (selectedStartItem != null && selectedEndItem != null) {
  Long l = selectedStartItem   86401000;
  for (; l < selectedEndItem;) {
    selections.add(l);
    l = l   86401000;
  }
}

The function will look like this :

VScode

The coloring part is executed in the ScreenShot

  • Related