8

I'm looking for a good datepicker that looks like this enter image description here

rather than

enter image description here

or

enter image description here

any ideas?

Mike Bryant
  • 2,455
  • 9
  • 39
  • 60

4 Answers4

3

As i have made comment about to create your calendar view by using GridView, check this tutorial where exact example is given with custom adapter for GridView.

Example - 2 to create a calendar as below:

enter image description here

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
  • this was the best one I found searching but It doesn't use the date to fill the months => It doesn't take into account the leap years, it says that there are only 28 days in feb this year rather than 29 which then of course messes up the rest – Mike Bryant Feb 07 '12 at 10:00
  • @MikeBryant dear all example may not be going to be full and suits our requirement, we have to make some changes to make exact example as per our requirement. The change you have mentioned is the minor one, you should try it yourself. – Paresh Mayani Feb 07 '12 at 10:06
  • yeah I know it wouldn't be hard to do, it's just that it's not a very "clean" way of programming not using an actual calendar but I will do that anyway seeing as it's probably the best one out there – Mike Bryant Feb 07 '12 at 10:10
  • 1
    the updated code actually corrects this problem it's just the downloadable project that is out of date :) – Mike Bryant Feb 07 '12 at 10:17
  • Glad that finally you reached at destination :) – Paresh Mayani Feb 07 '12 at 10:24
0

Create your own custom view or use this

Dmytro Danylyk
  • 19,684
  • 11
  • 62
  • 68
0

You may need to build this yourself, however, it should be pretty simple. Just extend a gridView, line up your weekdays along the top, and then loop through Dates setting them into the appropriate Grid view item. You set a date to be the first of a given month, look at what day of the week it is, and then go from there.

If you want to get fancy you can work backwards into the previous month to set the first few days of the month (for those that don't begin on the 1st) and similarly for the end of the month (exactly as illustrated in your desired example).

Each Grid item should hold on to its own Date object so that you can capture clicks and pass them along to some calling class.

If you want to get REALLY snazzy with it, do some animation where the dates animate in (maybe set a timer and wait 20 milliseconds per square as you draw them in). That makes it easier for the user to see that they're moving from month to month.

Yevgeny Simkin
  • 27,946
  • 39
  • 137
  • 236
  • ok thanks, I was just wondering if there were any examples already done, because I don't have sufficient knowledge yet programming in android to try something like that nor the time either – Mike Bryant Feb 07 '12 at 09:54
0

What I've found so far:

The tutorial's looking awesome.

Community
  • 1
  • 1
Romain Piel
  • 11,017
  • 15
  • 71
  • 106