I'm using Caldroid library https://github.com/roomorama/Caldroid. I want to disable all dates earlier than today. How can I do that? There is method setDisableDates, but it requires passing as argument list of dates to disable.
I found solution - use method setMinDate.
This will work for you:
setMinDateTime(getToday());
use in customizeTextView() in CaldroidGridAdapter class
Related
I want to implement android WeekView in my calendar application.For that i used this https://github.com/alamkanak/Android-Week-View library. Now the problem is i cant set date in that WeekView .
Never tried it because I never used this lib, but looking at the code, it seems this does what you want :
public void goToDate(Calendar date)
There is also a convenience method to go straight to today :
public void goToToday()
goToDate is deprecated use scrollToDate
I started working with CalendarView today, and to my surprise, class is very inflexible.
Only methods that CalendarView allos me to override are:
getDate()
getFirstDayOfWeek()
getMaxDate()
getMinDate()
getShowWeekNumber()
isEnabled()
setDate(long, boolean, boolean)
setDate(long)
setEnabled(boolean)
setFirstDayOfWeek(int)
setMaxDate(long)
setMinDate(long)
setOnDateChangeListener(OnDateChangeListener)
setShowWeekNumber(boolean)
However, i need to customize how certain days are displayed. For example, in my database i have events for dates 2013-10-02 and 2013-12-02 and i want to highlight these days in my calendar. How would i go about that.
You need to build your own CustomCalenderView.
Extends the Native CalendarView and build the behaviour that you want to color the background.
Or you can use this library : TimesSquare for Android.
And think it provide what you are looking for .
i need to display a calendar control in my app.I can not use google calender and other third party calendars.i want to display the selected date on the calender in a textview. i have searched for documents about calender view in net.but did not get anything.can anybody help me to do this?
If you want the full-activity implementation, you can try this post;
http://w2davids.wordpress.com/android-simple-calendar/
To display a calendar not using Google Calendar you could try android-calendar-view
Download Calendar v0.5.0
and follow that howto : How To Use
I made this Calendar Library for Android as part of my side project. Below is the link to the github and it has all the instructions on how to use it. If you still come across any difficulty implementing it let me know. Happy to help.
https://github.com/ik024/CalendarLibrary
Hope it helps.
How exactly do we use Android's MonthDisplayHelper? Ive been searching for possible widgets/views that would help me simplify my work as I would need to create a calendar. but it is just so hard. at least for me. So i saw this MonthDisplayHelper. from its members, i think i know what it can do..but what i don't get is how are we going to use it as i dont see it extending the view class nor is it an adapter. i know the question might be confusing. im heck confused right now. i hope somebody could help.
enlighten the confused :D
im sorry this came late..i have figured it out myself that MonthDisplayHelper will not make a Calendar for me. Well i hope it did. Creating a calendar functionality is not an easy task. we are faced with relatively complex algorithm.
so MonthDispalyHelper, again, will not make a calendar for you. Rather, it provides utility functionalities that would help you build your own calendar. a very good example of that is
MonthDisplayHelper mdh = new MonthDisplayHelper(viewedYear, viewedMonth);
int temp[] = mdh.getDigitsForRow(countRows);
which basically gives us as an integer array representation of which dates(digits) should go to each cell of the calendar. say for example, the first rows of the calendar of the supplied month and year(July 2011), would be {26,27,28,29,30,1,2}. from there, the job to position those digits to your layouts would be yours.
it also provides methods such as getting the number of days that the month specified have, the day of the week that the month starts, among other things.
i hope this helps.
This project uses MonthDisplayHelper, which might help understand how it works.
I'm looking to create something EXACTLY like TimePickerDialog (look and feel) in Android, but it would be for MINUTES/SECONDS, not HOURS/MINUTES. Therefore AM/PM would not be relevant and would therefore allow MINUTE to be greater than 24 (making the max 59).
Is it possible to change the TimePickerDialog instance in any way to reflect this?
Any and all suggestions would be greatly appreciated. :-)
Is it possible to change the TimePickerDialog instance in any way to reflect this?
No, but the layout and source code to TimePickerDialog are both available as a starting point for implementing your own dialog.
This might help:
TimePicker with seconds:
https://github.com/IvanKovac/TimePickerWithSeconds
Have a look.
As the links in CommonsWare's answer are now dead, you might want to know that the source for TimePickerDialog is probably already on your local machine - it is included in the SDK. Try looking in the following locations:
[SDK_HOME]/sources/android-23/android/app/TimePickerDialog.java
or
[SDK_HOME]/sources/android-23/com/android/datetimepicker/time/TimePickerDialog.java
[SDK_HOME]/platforms/android-23/data/res/layout/time_picker_dialog.xml
Of course, choose the Android version that you want to borrow from. References to R. should be to android.R. Unfortunately, there seem to be some visibility issues with ValidationCallback - even on recent SDK levels.