Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
philliphsu committed Dec 14, 2016
1 parent 24dbe56 commit e92aadd
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 7 deletions.
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ supporting API level 14 and up.

## Date Picker

<img src="screenshots/date-picker-light.png" width="180" height="320">
<img src="screenshots/paging-date-picker-light.png" width="180" height="320">
<img src="screenshots/month-picker-light.png" width="180" height="320">
<img src="screenshots/year-picker-light.png" width="180" height="320">
<img src="screenshots/date-picker-dark.png" width="180" height="320">

<img src="screenshots/paging-date-picker-dark.png" width="180" height="320">
<img src="screenshots/month-picker-dark.png" width="180" height="320">
<img src="screenshots/year-picker-dark.png" width="180" height="320">

## Time Pickers
Expand All @@ -35,7 +38,7 @@ supporting API level 14 and up.
Add the following dependency to your module's `build.gradle`:
```groovy
dependencies {
compile 'com.philliphsu:bottomsheetpickers:2.0.3'
compile 'com.philliphsu:bottomsheetpickers:2.1.0'
}
```

Expand Down Expand Up @@ -118,10 +121,35 @@ You can specify whether to use a light (default) or dark theme:
> **NOTE:** `setThemeDark(boolean dark)` overwrites the value specified in XML.
### Additional Options
`NumberPadTimePickerDialog` exposes the following additional APIs:
* `setHint(String hint)` or `setHint(@StringRes int resid)`: Sets the hint of the input time TextView.
* `setInputTextSize(int textSize)`: Sets the text size in px of the input time TextView.
* `getInputTextView()`: Returns the `TextView` that stores the inputted time.
Certain pickers expose additional APIs that can be used to customize their appearance.

#### `NumberPadTimePickerDialog`
* `setHint(String hint)` or `setHint(@StringRes int resid)`
Sets the hint of the input time TextView.

* `setInputTextSize(int textSize)`
Sets the text size in px of the input time TextView.

* `getInputTextView()`
Returns the `TextView` that stores the inputted time.

#### `BottomSheetDatePickerDialog`
* `setFirstDayOfWeek(int startOfWeek)`
Use this to set the day (`Calendar.SUNDAY` through `Calendar.SATURDAY`) that a week should start on.

* `setYearRange(int startYear, int endYear)`
Sets the range of years to be displayed by this date picker. If a minimal date and/or maximal date
were set using `setMinDate(Calendar)` or `setMaxDate(Calendar)`, dates in the specified range of
years that lie outside of the minimal and maximal dates will be disallowed from being selected.
_This does NOT change the minimal date's year or the maximal date's year._

* `setMinDate(Calendar calendar)`
Sets the minimal date that can be selected in this date picker. Dates before (but not including)
the specified date will be disallowed from being selected.

* `setMaxDate(Calendar calendar)`
Sets the maximal date that can be selected in this date picker. Dates after (but not including)
the specified date will be disallowed from being selected.

## Attribution

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ private static String formatDateTime(Calendar calendar, int flags) {
return DateUtils.formatDateTime(null, calendar.getTimeInMillis(), flags);
}

/**
* Use this to set the day that a week should start on.
* @param startOfWeek A value from {@link Calendar#SUNDAY SUNDAY}
* through {@link Calendar#SATURDAY SATURDAY}
*/
public void setFirstDayOfWeek(int startOfWeek) {
if (startOfWeek < Calendar.SUNDAY || startOfWeek > Calendar.SATURDAY) {
throw new IllegalArgumentException("Value must be between Calendar.SUNDAY and " +
Expand Down
Binary file added screenshots/month-picker-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/month-picker-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/paging-date-picker-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/paging-date-picker-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e92aadd

Please sign in to comment.