android library dialog month picker
Download via Maven:
Add the JitPack repository to your build file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add the dependency
<dependency>
<groupId>com.github.lutvie72</groupId>
<artifactId>rackmonthpicker</artifactId>
<version>1.4</version>
</dependency>
via Gradle:
Add it in your root build.gradle at the end of repositories
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency
dependencies {
compile 'com.github.lutvie72:RackMonthPicker:1.4'
}
new RackMonthPicker(this)
.setLocale(Locale.ENGLISH)
.setPositiveButton(new DateMonthDialogListener() {
@Override
public void onDateMonth(int month, int startDate, int endDate, int year, String monthLabel) {
}
})
.setNegativeButton(new OnCancelMonthDialogListener() {
@Override
public void onCancel(AlertDialog dialog) {
}
}).show();
adding .setPositiveText(String text) or .setNegativeText(String Text) to change the text of a button.
adding .setLocale(Locale.ENGLISH) to change language.
adding .setColorTheme(R.color.primary) to change color theme.
adding .setSelectedMonth(4) to change default month selected.
Once the dialog is shown, you can dismiss it:
RackMonthPicker rackMonthPicker = new RackMonthPicker(this)
.......
.show();
rackMonthPicker.dismiss();