diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..d325b6dd --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: Publish + +on: + release: + # We'll run this workflow when a new GitHub release is created + types: [released] + +jobs: + publish: + name: Release build and publish + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + distribution: adopt + java-version: 11 + + # Builds the release artifacts of the library + - name: Release build + run: ./gradlew assembleRelease -x :sample-app:assembleRelease -x :sample-app-java:assembleRelease + + # Generates other artifacts (javadocJar is optional) + - name: Source jar and dokka + run: ./gradlew androidSourcesJar javadocJar + + # Runs upload, and then closes & releases the repository + - name: Publish to MavenCentral + run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_KEY: ${{ secrets.SIGNING_KEY }} + SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} diff --git a/README.md b/README.md index dbaec97f..f2823287 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # `PrimeDatePicker` :zap: [](https://android-arsenal.com/details/1/7743) [](http://androidweekly.net/issues/issue-367) -[](https://bintray.com/aminography/maven/PrimeDatePicker/_latestVersion) + [](https://app.codacy.com/manual/aminography/PrimeDatePicker?utm_source=github.com&utm_medium=referral&utm_content=aminography/PrimeDatePicker&utm_campaign=Badge_Grade_Dashboard) [](https://android-arsenal.com/api?level=13) -First, **`PrimeDatePicker`** is a tool which provides picking a single day, multiple days, and a range of days. Second, you can use its `MonthView` and `CalendarView` as stand-alone views in your projects. +Firstly, **`PrimeDatePicker`** is a tool that provides picking a single day, multiple days, and a range of days. Secondly, you can use internal elements like `MonthView` and `CalendarView` as stand-alone views in your projects. 
| Picking Multiple Days Example for Civil |
- Picking a Range of Days Example for Persian |
- Picking a Single Day Example for Hijri |
- Goto View Example for Japanese |
+ Multiple Days | Civil BottomSheet | Dark |
+ Range of Days | Persian BottomSheet | Light |
+ Single Day | Hijri Dialog | Light |
+ Goto Feature | Japanese Dialog | Dark |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Result: | -
![]() |
-
| Attribute | -Type | -||
| • calendarType | -enum | -||
| Specifies the calendar type which is shown by this view. Its possible values are: civil, persian, hijri, and japanese. | +Function | +Picking Strategy | |
| • monthLabelTextColor | -color | -||
| Specifies the text color of month name label. | -|||
| • weekLabelTextColor | -color | -||
| Specifies the text color of week day name labels. | -|||
| • dayLabelTextColor | -color | -||
| Specifies the text color of day number labels. | -|||
| • todayLabelTextColor | -color | -||
| Specifies the text color of day number label which belongs to today. | -|||
| • pickedDayLabelTextColor | -color | -||
| Specifies the text color of day number labels when they are picked. | -|||
| • pickedDayBackgroundColor | -color | -||
| Specifies the background color of day numbers when they are picked. | -|||
| • disabledDayLabelTextColor | -color | -||
| Specifies the text color of day number labels when they are disabled. | -|||
| • monthLabelTextSize | -dimension | -||
| Specifies the text size of month name label. | -|||
| • weekLabelTextSize | -dimension | -||
| Specifies the text size of week day name labels. | -|||
| • dayLabelTextSize | -dimension | +• minPossibleDate(minDate: PrimeCalendar) | +ALL |
| Specifies the text size of day number labels. | +Specifies the minimum feasible date to be shown in date picker, which is selectable. | ||
| • monthLabelTopPadding | -dimension | +• maxPossibleDate(maxDate: PrimeCalendar) | +ALL |
| Specifies the top padding of month name label. | +Specifies the maximum feasible date to be shown in date picker, which is selectable. | ||
| • monthLabelBottomPadding | -dimension | +• firstDayOfWeek(firstDayOfWeek: Int) | +ALL |
| Specifies the bottom padding of month name label. | +Specifies the day that should be considered as the start of the week. Possible values are: Calendar.SUNDAY, Calendar.MONDAY, etc. | ||
| • weekLabelTopPadding | -dimension | +• disabledDays(disabledDays: List<PrimeCalendar>) | +ALL |
| Specifies the top padding of week day name labels. | +Specifies the list of disabled days, which aren't selectable. | ||
| • weekLabelBottomPadding | -dimension | +• applyTheme(themeFactory: ThemeFactory) | +ALL |
| Specifies the bottom padding of week day name labels. | +Specifies the theme. | ||
| • dayLabelVerticalPadding | -dimension | +• initiallyPickedSingleDay(pickedDay: PrimeCalendar) | +SingleDay |
| Specifies the vertical padding (top and bottom) of day number labels. | +Specifies initially picked day when the date picker has just shown. | ||
| • showTwoWeeksInLandscape | -boolean | +• initiallyPickedRangeDays(startDay: PrimeCalendar, endDay: PrimeCalendar) | +RangeDays |
| When it sets true, month view shows two weeks (14 days) in each row for landscape screen orientation. | +Specifies initially picked range of days when the date picker has just shown. | ||
| • animateSelection | -boolean | +• autoSelectPickEndDay(autoSelect: Boolean) | +RangeDays |
| When it sets true, selected day/days will appear with animation. | +Specifies automatic selection of picking end day when the start day gets picked. | ||
| • animationDuration | -integer | +• initiallyPickedMultipleDays(pickedDays: List<PrimeCalendar>) | +MultipleDays |
| Specifies the duration of day selection animation. | +Specifies initially picked multiple days when the date picker has just shown. | ||
| Attribute | -Type | -
| • flingOrientation | -enum | -
| Specifies the fling orientation of calendar view. Its possible values are: vertical, horizontal. | -|
| • dividerColor | -color | -
| Specifies the color of divider lines separating month views. | -|
| • dividerThickness | -dimension | -
| Specifies the thickness of divider lines separating month views. | -|
| • dividerInsetLeft | -dimension | -
| Specifies the left margin of divider lines when the fling orientation is vertical. | -|
| • dividerInsetRight | -dimension | -
| Specifies the right margin of divider lines when the fling orientation is vertical. | -|
| • dividerInsetTop | -dimension | -
| Specifies the top margin of divider lines when the fling orientation is horizontal. | -|
| • dividerInsetBottom | -dimension | -
| Specifies the bottom margin of divider lines when the fling orientation is horizontal. | -|
| • loadFactor | -integer | -
| Specifies the number of month to be load in pagination (endless scrolling). | -|
| • maxTransitionLength | -integer | -
| Specifies the maximum number of month that are shown between current and target in transitions. It's used when goto method has called. | -|
| • transitionSpeedFactor | -float | -
| Specifies the speed factor of scrolling in transitions. It's used when goto method has called. | -|
| Variable | -Type | -
| • typeface | -Typeface | -
| Specifies the typeface of showing texts. | -|
| • pickedSingleDayCalendar | -PrimeCalendar | -
| Specifies the single picked date. | -|
| • pickedRangeStartCalendar | -PrimeCalendar | -
| Specifies the start date of the picked range. | -|
| • pickedRangeEndCalendar | -PrimeCalendar | -
| Specifies the end date of the picked range. | -|
| • pickedMultipleDaysList | -List<PrimeCalendar> | -
| Specifies the list of multiple picked dates. | -|
| • minDateCalendar | -PrimeCalendar | -
| Specifies the minimum feasible date of the view. | -|
| • maxDateCalendar | -PrimeCalendar | -
| Specifies the maximum feasible date of the view. | -|
| • pickType | -PickType | -
| Specifies the date picking type of the view. Its possible values are: SINGLE, RANGE_START, RANGE_END, MULTIPLE, NOTHING. | -|
| • animationInterpolator | -Interpolator | -
| Specifies the interpolator of day selection animation. | -|
| monthView.goto(PersianCalendar()) // or monthView.locale = Locale("fa") |
- monthView.goto(PersianCalendar(Locale.ENGLISH)) // or monthView.locale = Locale.ENGLISH |
-
![]() |
- ![]() |
-
| calendarView.goto(HijriCalendar()) // or calendarView.locale = Locale("ar") |
- calendarView.goto(HijriCalendar(Locale.ENGLISH)) // or calendarView.locale = Locale.ENGLISH |
+ Normal Light Theme | +Customized Light Theme |
![]() |
- ![]() |
+ ![]() |
+ ![]() |