I'm trying to build a custom datepicker dialog. I used CalendarView instead of DatePicker since I didn't want the header used in DatePicker. This is how it looks now.
And this is what I want to achieve.
The future and previous dates should be visible. If clicked on future month's date, calendar should scroll to next month.
I couldn't find any properties/functions in CalendarView class to achieve this. Is there any other way to achieve this? Is there any 3rd party open-source library that does this?
Related
I want to show a user with a calendar where multiple dates are selected.
While this could be easily achieved using Material Calendar View but I prefer not to use dependency for this simple task.
How could I achieve this by extending android CalendarView?
Please help
I would refer you to a comment on How to highlight multiple dates in Android CalendarView.
It basically says CalendarView does not support this, and that the point of CalendarView is to allow the user to choose a date.
Good luck!
I created a view that has CalendarView added programatically.
Code:
CalendarView calendarView = new CalendarView(context);
calendarView.setDate(new Date().getTime());
cardInner.addView(calendarView);
http://www.screencast.com/t/ugGKqI2V0EH
The current set up is the one on the screenshot. I was wondering if there is a way to make it look this way?
http://screencast.com/t/Q1kwyib0hOv
This is not possible using the CalendarView widget from AOSP. See https://developer.android.com/reference/android/widget/CalendarView.html
It is however possible to prevent the user from picking any date other than a date inside a certain week. You can achieve this by using the setMinDate and setMaxDate methods: https://developer.android.com/reference/android/widget/CalendarView.html#setMaxDate(long)
A third option would be extending the CalendarView widget and altering the onDraw method to only draw one row.
Also, try and search around on google. There might be a 3rd party library that can already do this.
I have to program in Android a calendar that shows a month, that I can slide horizontally to show other months. I tried with the calendarview but it's an infinite scrollable calendar, I need to show a month at once.
One more thing: how can I change the color and the style of a single day in the calendar? For example, to show in which days there are events and in which not.
Thank you very much in advance!
I need to select more than once date from a CalenderView of android. Can any one help me to do the same.
Example!
Let's look attached image. If we consider the calender in image as CalenderView of android I need to select all date raging from 16th to 20th.
As far as I know the CalendarView only supports selecting single dates.
I would suggest calling it twice to get the start and end dates (for the end date, you could call setMinDate() beforehand to make sure it's greater than the start date).
I am sure,I think my question is something different in android.I goggled 100s of sites i saw the date picker in android, all are same type, no one give the different date picker.
My Task is to design custom date picker. Please find this below screen shot.
https://docs.google.com/file/d/0B_c-SDSO63obZzVreHpmdnZBYzg/edit?usp=sharing
For that I goggled, I didn't find any solution. I think, For android solutions this is the best site.
coming to my date picker it is totally dialog box. In that red symbol,name,close mark,submit i can do it. But i want that sun,man,tue,web In red color and on the top month and year. In below dates with green color picker. so Please tell me how can I do that task.
All advices are accepted.
Thanks&Regards
Shankar
Clite
I can only suggest how I would have gone for such a calendar. By the UI it is clear that it has to come as a pop-up or to better say a dialog. Now you have to google the opensource calendars if any or just using the calendar API provided by java you can get the calendar for a month year etc. and move it across previous month by normal java function calls.
Now that you have got the data to populate in your calendar. You have to design a custom layout xml create ~30-40 boxes or a grid with dynamic textviews or a webview with <table>, <tr>, <td> the choice is completely yours.
AFAIK
If you can't find anything opensource then I would suggest you should do these things by the suggested approach.