I've tried to look for an answer to this, but no one seems to have asked it; and I find that strange, and makes me a little worried.
I've added the DatePicker widget to a layout. The screen I'm seeing it on is large enough for the calendar to show up to the right of it. The calendar's title is, for example, "July 2013". If I use the spinner to change the year, the calendar adjusts itself to the appropriate year.... but the label doesn't change. So, you could be looking at July of 2020, but the label would still read "July 2013". The only time that label/title/whatever seems to update is if you manually drag through the calendar, or change the month via the month spinner.
I've done virtually nothing so far besides adding it to the layout, so I'm not sure what I could be doing wrong, but this seems like a big enough bug (if it's NOT just me) that I should have been able to find SOMETHING else out about it.
Any help would be appreciated.
I had the same issue with the widget. It seems like the year on the label doesn't update unless you changed the year AND the month. There's probably some code in the widget's design that doesn't refresh the text of the label unless the month is changed, so if you change the year without the month, the label never refreshes (despite the rest of the widget being updated).
This seems to be a pretty glaring bug with the widget, so I'm a little surprised they haven't fixed it, unless we're missing something obvious here?
I actually got around the issue with my own code. I just needed the calender view, not the spinners, but the issue remains with the label if you only update the widget's year without the month. I basically just forced a +1 month increment regardless of if the situation called for it, refreshed the widget, then immediately decremented the month and refreshed the widget again. This way, your month remains the what it should have been, and the label refreshes the year if that was changed.
Related
I've been looking for a while how to try to make a calendar composable, since from what I've seen they haven't currently developed a calendar component like there used to be with XML.
In principle, the idea is to have a calendar that shows a month with all its days, and when clicking on an arrow, it shows the rest of the months, and with a list of days that comes from the service, the corresponding days are marked in one colour, and the current day in another colour.
I want to change if it is possible, only the background color/tint of all Sundays of the current month
like this pic, thank you for your time
This documentation should help you out. Using the getFirstDayofWeek() should get your Sunday and then using setWeekDayTextAppearance I'm assuming would allow you to change it. I haven't personally used CalendarView before but the documentation looks pretty straightforward.
I want to display a DatePicker, that contains only a calendar, but i get this kind of bug:
Screen with error
I found some people had this kind of problem too, but have somebody found a solution for this?
It occurs on Api > 21, most of resolutions.
Found out that this can be easily reproduced after we set the Setting->Display->Display Size to Large. And then go to a month that needs to show 6 rows. The Google Calendar app have the same problem.
So it should be a bug in the DatePicker. The only easy solution is to change the datepicker to the spinner style.
I am having some UI problems with the DatePicker. Setting dates in my app relies on the day of the week, which the DatePicker lacks without the calendar, so I am using the calendar so the user can see the day of the week. The only problem is, it displays them side to side like this:
Which makes the calendar appear very cramped, especially because this is on a mobile device, so the numbers are very small. Is there a way to make the orientation change, where the slider is on the top and the calendar is on the bottom? The calendar looks much better when it doesn't have the slider next to it as it is bigger, but I need both the slider and calendar.
When i display a Datepicker in most api versions of android the month is displayed like this:
But in api level 10 the month is displayed like this:
So i want to know if there is a way to force the month to be displayed with only 3 letters and remove the backslash
A quick study of every method for DatePicker has revealed that there is no way to do it through code. I suspect that if the size of it is chosen correctly, the 3 letters might still appear, but I don't have the time to do a trial/error on that hypothesis.