Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/square/android-times-square
Standalone Android widget for picking a single date from a calendar view.
https://github.com/square/android-times-square
Last synced: 21 days ago
JSON representation
Standalone Android widget for picking a single date from a calendar view.
- Host: GitHub
- URL: https://github.com/square/android-times-square
- Owner: square
- License: apache-2.0
- Created: 2013-01-30T20:28:27.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2023-05-28T01:46:37.000Z (over 1 year ago)
- Last Synced: 2024-04-13T17:52:10.773Z (7 months ago)
- Language: Java
- Homepage:
- Size: 1.47 MB
- Stars: 4,433
- Watchers: 227
- Forks: 1,186
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
- -awesome-android-ui - android-times-square - 2.0) | <img src="/art/android-times-square.png" width="49%"> (Index `(light-weight pages)`)
- awesome-android-ui - android-times-square - 2.0) | <img src="/art/android-times-square.png" width="49%"> (Index `(light-weight pages)`)
- awesome-github-android-ui - android-times-square - 从日历视图选择一个单独日期 (日历时间)
- awesome-android-ui - android-times-square - 2.0) | <img src="/art/android-times-square.png" width="49%"> (Index)
README
TimesSquare for Android
==========================Standalone Android widget for picking a single date from a calendar view.
![Screenshot](timesSquareScreenshot.png)
Usage
-----Include `CalendarPickerView` in your layout XML.
```xml
```
This is a fairly large control so it is wise to give it ample space in your layout. On small
devices it is recommended to use a dialog, full-screen fragment, or dedicated activity. On larger
devices like tablets, displaying full-screen is not recommended. A fragment occupying part of the
layout or a dialog is a better choice.In the `onCreate` of your activity/dialog or the `onCreateView` of your fragment, initialize the
view with a range of valid dates as well as the currently selected date.```java
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);
```The default mode of the view is to have one selectable date. If you want the user to be able to
select multiple dates or a date range, use the inMode() method:```java
calendar.init(today, nextYear.getTime())
.inMode(RANGE);
```Download
--------The latest version can be downloaded in [zip][zip] and referenced by your application as a library
project.You can also depend on the library through Maven:
```xmlcom.squareup
android-times-square
1.6.5
apklib```
or Gradle:
```groovy
compile 'com.squareup:android-times-square:1.6.5@aar'
```Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].
License
-------Copyright 2012 Square, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.[zip]: https://github.com/square/android-times-square/archive/master.zip
[snap]: https://oss.sonatype.org/content/repositories/snapshots/