Skip to content

Instantly share code, notes, and snippets.

@ankushg
Last active January 4, 2016 14:09
Show Gist options
  • Save ankushg/8632729 to your computer and use it in GitHub Desktop.
Save ankushg/8632729 to your computer and use it in GitHub Desktop.
TimesSquare for Android: A standalone Android widget for picking a single date from a calendar view.
protected void onCreate (Bundle savedInstanceState){
Calendar nextYear = Calendar.getInstance();
nextYear.add(Calendar.YEAR, 1);
CalendarPickerView calendar = (CalendarPickerView) findViewById(R.id.calendar_view);
Date today = new Date();
calendar.init(today, nextYear.getTime())
.withSelectedDate(today);
}
<com.squareup.timessquare.CalendarPickerView
android:id="@+id/calendar_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>android-times-square</artifactId>
<version>1.0.3</version>
<type>apklib</type>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment